A collection of tools for web development.
To install Aiursoft.WebTools
to your project from nuget.org:
dotnet add package Aiursoft.WebTools
- Easier application startup
- QRCode generation
- HttpContext extensions
It is a common practice to create a Program
class and a Startup
class in a ASP.NET Core application. However, it is a little bit annoying to write the same code again and again. So we created a Extends
class to help you to write less code.
using System.Reflection;
using Aiursoft.WebTools.Models;
namespace DemoApp;
public class Program
{
public static async Task Main(string[] args)
{
var app = Extends.App<Startup>(args);
await app.RunAsync();
}
}
public class Startup : IWebStartup
{
public void ConfigureServices(IConfiguration configuration, IWebHostEnvironment environment, IServiceCollection services)
{
services
.AddControllers()
.AddApplicationPart(Assembly.GetExecutingAssembly());
}
public void Configure(WebApplication app)
{
app.UseRouting();
app.MapDefaultControllerRoute();
}
}
We provide a QRCode generation service for you to generate QRCode image from a string.
var base64 = _qrCodeService.ToQRCodeBase64(somestring);
We provide some useful extensions for HttpContext
:
var isWeChat = HttpContext.IsWeChat();
var isMobile = HttpContext.IsMobileBrowser();
var allowTrack = HttpContext.AllowTrack();
There are many ways to contribute to the project: logging bugs, submitting pull requests, reporting issues, and creating suggestions.
Even if you with push rights on the repository, you should create a personal fork and create feature branches there when you need them. This keeps the main repository clean and your workflow cruft out of sight.
We're also interested in your feedback on the future of this project. You can submit a suggestion or feature request through the issue tracker. To make this process more effective, we're asking that these include more information to help define them more clearly.