Category:.NET Core

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

    Time:2021-2-26

    At startupConfigureServicesServices required for registration localizationAddLocalizationandConfigure public void ConfigureServices(IServiceCollection services) { services.AddLocalization(); services.Configure(options => { var supportedCultures = new List { 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 } }; […]

  • ABP (net core) + easyUI + efcore to realize warehouse management system

    Time:2021-2-25

    ABP (net core) + easyUI + efcore to realize the storage management system directory ABP (net core) + easyUI + efcore to realize warehouse management system ABP (net core) + easyUI + efcore to realize warehouse management system ABP (net core) + easyUI + efcore to realize warehouse management system  ABP (net core) + easyUI […]

  • Introduction to elasticsearch (3) Elasticsearch.Net &Nest as elasticsearch client

    Time:2021-2-23

    Introduction to elasticsearch (3) Elasticsearch.Net &Nest as elasticsearch client GitHub warehouse https://github.com/elastic/elasticsearch-net choiceElasticsearch.NetAs a client Connection mode var node = new Uri(“http://myserver:9200”); var config = new ConnectionConfiguration(node); var client = new ElasticLowLevelClient(config); var myJson = @”{ “”hello”” : “”world”” }”; client.Index(“myindex”, “1”, myJson); var myJson = new { hello = “world” }; client.Index(“myindex”, “1”, PostData.Serializable(myJson)); […]

  • Use of. Net core memorycache

    Time:2021-2-22

        It seems that you can use it directly without nuget package. using Microsoft.Extensions.Caching.Memory;   public static class CacheHelperNetCore { public static IMemoryCache _memoryCache = new MemoryCache(new MemoryCacheOptions()); /// ///Set key value cache /// /// ///Value ///Expiration time public static void SetCache(string key,object obj,TimeSpan timeSpan) { _memoryCache.Set(key,obj,timeSpan); } /// ///Get key value cache /// […]

  • Be careful of formurlencodecontent bug in httpclient

    Time:2021-2-21

    Be careful of formurlencodecontent bug in httpclient Intro Recently, I found that there are sometimes problems with the uploaded pictures in the booking project of the activity room. I took time to test it at the weekend and found that there is no problem with the uploading of small pictures, but there will be problems […]

  • Dotnet core 3. X dependency injection

    Time:2021-2-20

    If dependency injection is a relatively new thing in the previous version of dotnet, it can be seen everywhere in the dotnet core. It can be said that the framework of the whole dotnet core is built on the framework of dependency injection. This article explains the understanding of dependency injection in dotnet core. What […]

  • How to configure serilog.net core 3.1

    Time:2021-2-19

    How to configure serilog.net core 3.1 Installation packagedotnet add package Serilog dotnet add package Serilog.AspNetCore Early initialization mode public class Program { public static IConfiguration Configuration { get; } = new ConfigurationBuilder() .SetBasePath(Directory.GetCurrentDirectory()) .AddJsonFile(“appsettings.json”, optional: false, reloadOnChange: true) .AddJsonFile($”appsettings.{Environment.GetEnvironmentVariable(“ASPNETCORE_ENVIRONMENT”) ?? “Production”}.json”, optional: true) .AddEnvironmentVariables() .Build(); public static int Main(string[] args) { Log.Logger = new LoggerConfiguration() […]

  • ASP.NET Core 3. X API version control

    Time:2021-2-17

    preface Generally speaking, we only consider version control when we need to change our API, but I don’t think we should wait until then to implement it. We should have a version strategy, which has been formulated since our application development, and we have been developing according to this strategy. In fact, we can control […]

  • Middleware of dotnet core

    Time:2021-2-16

    A few days ago, a friend in the background of the official account asked Core’s middleware, so he devoted time to sort out such an article.   1、 Preface Middleware is initially a mechanical concept, which refers to the connector between two different motion structures. Later, this concept was extended to the software industry. We […]

  • api.versioning Version control automatically identifies the highest version

    Time:2021-2-14

    Microsoft.AspNetCore.Mvc . versioning // importing assembly The version control function of the API under. Net core needs no further discussion. Please refer to https://www.cnblogs.com/dc20181010/p/11313738.html The common version control is to control the API version reader through such methods as link and header. For example services.AddApiVersioning(o => { //o. Reportapiversions = true; // returns the available […]

  • Combining with AOP, it is easy to handle events and publish processing logs

    Time:2021-2-13

    Combining with AOP, it is easy to handle events and publish processing logs Intro Some time ago, we implemented event processing based on eventbus and eventqueue, but we didn’t do the part related to the event log. Originally, we wanted to add two interfaces to handle the event publishing log and event processing log. Recently, […]

  • 1、 Agile development framework query page model query page

    Time:2021-2-12

    http://oa.ecidh.com/KMS/AppKMS/Article/article.aspx?id=KMS202000090&strToken=6d1dd74cb51040a2af69745595f326a7   Agile development framework: query page model   Development of query page: Take user management as an example The opening effect is as follows: The overall structure is the above query conditions Next is the query button Then there are the function buttons Finally, the data list display This style of page in any […]