Tag:WebApi

  • asp.net Core 2.0 webapi integration signalr

    Time:2020-10-21

    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

    Time:2020-9-19

    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

    Time:2020-9-17

    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)

    Time:2020-8-1

    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

    Time:2020-7-20

    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

    Time:2020-7-15

    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

    Time:2020-6-9

    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

    Time:2020-5-23

    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

    Time:2020-5-14

    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)

    Time:2020-4-5

    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 […]

  • An example of Web API implementing front and back end separation

    Time:2020-2-29

    With the development of web technology, there are numerous frameworks, front-end and back-end. The pressure on the whole stack of engineers is increasing. The current front-end framework can be used for both web and app. The front-end framework is updated more and more quickly. Traditional model Front end and back end debugging, modification are very […]

  • Solution to cross domain call of asp.net webapi

    Time:2020-2-4

    discover problems Recently, I am working on a project. The front end is Vue, the back end is webapi, and the business is the addition, deletion, modification and query of some entities. At the beginning of the project, I predicted that there was a cross domain problem, so I also looked for the information and […]