Notatki dla .NET w języku programowania C#

Rest Api Core Culture and disable auto valid

services.Configure<ApiBehaviorOptions>(options =>
            {
                options.SuppressModelStateInvalidFilter = true;
            });
 
            services.AddLocalization(options => options.ResourcesPath = "Resources");
            // Configure supported cultures and localization options
            services.Configure<RequestLocalizationOptions>(options =>
            {
                var supportedCultures = new[]
                {
                    new CultureInfo("en"),
                    new CultureInfo("pl"),
                    new CultureInfo("de")
                };
                options.DefaultRequestCulture = new RequestCulture(culture: "en", uiCulture: "en");
 
                // You must explicitly state which cultures your application supports.
                // These are the cultures the app supports for formatting numbers, dates, etc.
                options.SupportedCultures = supportedCultures;
 
                // These are the cultures the app supports for UI strings, i.e. we have localized resources for.
                options.SupportedUICultures = supportedCultures;
                //options.RequestCultureProviders.Insert(0, new QueryStringRequestCultureProvider());
            });
 
            services.AddMvc().AddViewLocalization().AddDataAnnotationsLocalization(); 
Kategoria: 

System.Drawing.Common linux

https://www.hanselman.com/blog/HowDoYouUseSystemDrawingInNETCore.aspx

Linux install

sudo apt install libc6-dev 
sudo apt install libgdiplus

Soap call me


ServiceReference.BiesSoapClient soap = new ServiceReference.BesSoapClient(new ServiceReference.BiesSoapClient.EndpointConfiguration());
ServiceReference.UserAuth user = new ServiceReference.UserAuth();

Kategoria: 

WSDL to dotnet class

dotnet tool install --global dotnet-svcutil

dotnet-svcutil http://localhost:50611/Btes.asmx?WSDL

Kategoria: 

Strony

Subskrybuj Notatki dla .NET w języku programowania C#