• ASP.NET Implementation of dynamic webapi in core


    1、 Preface It has been several years since I came into contact with the word dynamic web API. I came into contact with it from the ABP framework. At that time, I was very curious about the ABP technology. After analyzing a wave, I tried to separate one from ABP and use it as an […]

  • asp.net An example of MVC webapi interface encryption method


    In many projects, because webapi is open to the outside world, at this time, we have to consider the security of interface exchange data. There are also many security mechanisms. For example, when Andriod and webapi exchange data, the two-way certificate method can be used, but the development cost is relatively high, Today we are […]

  • asp.net Core 2.0 webapi integration signalr


    I have been in the blog Garden for many years. I haven’t shared anything or written a blog, but I have learned from the knowledge of the blog Garden; These two days, I think I can’t be so selfless. Recently. Net core seems to be very popular, and I’ve made one myself asp.net core signalr […]

  • Method of creating Linux daemons by. Net core 3.0 webapi


    preface Generally, we can execute dotnet < app on Linux server_ assembly.dll >Command to run our. Net core webapi application. However, the application running in this way is very unstable. After closing the terminal window, the application will also stop running. In order to make it run stably, we need to make it become the […]

  • How to deploy. Net core webapi on Linux server


    Pigeon for a long time, finally have a time to continue to write, followed by the last one, and wrote (water) an article, there are any shortcomings, please point out, thank you very much. Here are two softwares that need to be used, putty and PSCP. I have uploaded them to the blog Garden. Please […]

  • ASP.NET Localization of core webapi (single resource file)


    At startupConfigureServicesServices required for registration localizationAddLocalizationandConfigure<RequestLocalizationOptions> public void ConfigureServices(IServiceCollection services) { services.AddLocalization(); services.Configure<RequestLocalizationOptions>(options => { var supportedCultures = new List<CultureInfo> { new CultureInfo(“en-us”), new CultureInfo(“zh-cn”) }; options.DefaultRequestCulture = new RequestCulture(culture: “en-us”, uiCulture: “en-us”); options.SupportedCultures = supportedCultures; options.SupportedUICultures = supportedCultures; options.RequestCultureProviders = new IRequestCultureProvider[] { new RouteDataRequestCultureProvider { IndexOfCulture = 1, IndexofUiCulture = 1 } }; […]

  • ASP.NET Core 2.0 webapi global configuration and log instance


    Recently, some of the original webservces are converted into webapi, which is used directly ASP.Net Core 2.0 framework, in use, found with the original asp.net Different places, through the search has been slowly solved, record down for backup. 1、 Global configuration stay asp.net The global change configuration is written in web.config , as shown below […]

  • asp.net Cross domain instance of core webapi server configuration


    In the separate development of front end and back end, the server only provides API interface for the front end, and the front and back end are often deployed separately, so the browser cross domain problem will appear. asp.net Core provides a simple and elegant solution. Add the following code to configure in the startup […]

  • ASP.NET Detailed explanation of core implementation of custom webapi model validation


    Framework Era  In the framework era, when we generally conduct parameter verification, the following code is very common [HttpPost] public async Task<JsonResult> SaveNewCustomerAsnyc(AddCustomerInput input) { if (!ModelState.IsValid) { return Json(Result.FromCode(ResultCode.InvalidParams)); } ….. } Or the advanced point is to implement iactionfilter to intercept, as follows: public class ApiValidationFilter : IActionFilter { public bool AllowMultiple => […]

  • Simple creation and usage of. Net core webapi


    preface According to the current development trend of software development, webapi is used more and more widely, no matter front-end and back-end separation or providing data services, and. Net core is also the future development trend of our. Net developers, so it is necessary to learn to use. Net core API. As a rookie of. […]

  • . net core webapi: a method to obtain request and response content through Middleware


    In this paper, middleware is used to implement the.net core webapiThe request and response data generated in are acquired and stored in the log file; The use of log files is not covered in detail here. You can access NLog, log4net, exceptionless, etc Middleware for creating interface records using Microliu.Core.Loggers; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Http; using […]

  • . net core3.0 use fluent validation validation in Web API (batch injection)


    Why use fluent validation 1. In daily development, it is necessary to verify the rationality of parameters, not only the front-end needs to verify the parameters of virus transmission, but also the back-end needs to verify the parameters2. It should also be verified in the domain model that it’s a good habit to do defensive […]