اشتراک‌ها
Entity Framework Core 5.0 Preview 5 منتشر شد

Database collations

The default collation for a database can now be specified in the EF model.
This will flow through to generated migrations to set the collation when the database is created.
For example:

 modelBuilder.UseCollation("German_PhoneBook_CI_AS");
Entity Framework Core 5.0 Preview 5 منتشر شد
اشتراک‌ها
اعتبارسنجی IOptions توسط کتابخانه MiniValidation

In this post I described the problem that by default, DataAnnotation validation doesn't recursively inspect all properties in an object for DataAnnotation attributes. There are several solutions to this problem, but in this post I used the MiniValidation library from Damian Edwards. This simple library provides a convenience wrapper around DataAnnotation validation, as well as providing features like recursive validation. Finally I showed how you can replace the built-in DataAnnotation validation with a MiniValidation-based validator

var builder = WebApplication.CreateBuilder(args);

builder.Services.AddOptions<MySettings>()
    .BindConfiguration("MySettings")
    .ValidateMiniValidation() // 👈 Replace with mini validation
    .ValidateOnStart();

var app = builder.Build();
OptionsValidationException: 
  DataAnnotation validation failed for 'MySettings' member: 'Nested.Value' with errors: 'The Value field is required.'.; 
  DataAnnotation validation failed for 'MySettings' member: 'Nested.Count' with errors: 'The field Count must be between 1 and 100.'.
Microsoft.Extensions.Options.OptionsFactory<TOptions>.Create(string name)
Microsoft.Extensions.Options.OptionsMonitor<TOptions>+<>c__DisplayClass10_0.<Get>b__0()


اعتبارسنجی IOptions  توسط کتابخانه MiniValidation
اشتراک‌ها
Visual Studio 2017 version 15.3.2 منتشر شد

These are the customer-reported issues addressed in this version:

Visual Studio crashes when you open a solution with a test project.
Visual Studio Freezes in Debug with Chrome.
Failure to install HelpViewer.
UI delay while typing R code.
C# 7.0 Regression in Tuples.
Xamarin - Dynamic Type Platform not supported exception.
Xamarin – Dynamic object is not supported.
Xamarin - Xamarin.iOS: ArgumentNullException for instruction parameter in Mono.Linker's MarkException() method.

Visual Studio 2017 version 15.3.2 منتشر شد
اشتراک‌ها
با سی شارپ 8 از دست NullReferenceExceptions ها خلاص شوید

A .NET guideline specifies that an application should never throw a NullReferenceException. However, many applications and libraries do. The NullReferenceException is the most common exception happening. That’s why C# 8 tries to get rid of it. With C# 8, reference types are not null be default. This is a big change, and a great feature. However, what about all the legacy code? Can old libraries be used with C# 8 applications, and can C# 7 applications make use of C# 8 libraries?

This article demonstrates how C# 8 allows mixing old and new assemblies. 

با سی شارپ 8 از دست NullReferenceExceptions ها خلاص شوید
اشتراک‌ها
نگارش‌های 5.0.4, 3.1.13, 2.1.26 دات نت و NET Core. منتشر شدند

Today, we are releasing the .NET March 2021 Updates. These updates contains reliability and security improvements. See the individual release notes for details on updated packages.

You can download 5.0.4 , 3.1.13, 2.1.26 versions for Windows, macOS, and Linux, for x86, x64, Arm32, and Arm64.

نگارش‌های 5.0.4, 3.1.13, 2.1.26 دات نت و NET Core. منتشر شدند