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()
کتابخانه instafetch
If you use the Instagram API to make a call, you will only get 33 results back, no matter what you specify in the count paramter. Instafetch will help you fetch more media than the limit imposes, in exchange for more API calls, which can count against your hourly limit. Demo
Entity Framework Core 2.0 introduces global query filters that can be applied to entities when a model is created. It makes it easier to build multi-tenant applications and support soft deleting of entities. This blog post gives a deeper overview of how to use global query filters in real-life applications and how to apply global query filters to domain entities automatically.
NewSQL چیست؟
Some NewSQL solutions
NewSQL-db-logosVoltDB (in-memory database) : http://voltdb.com
ClustrixDB (distributed peer-to-peer SQL database) : http://www.clustrix.com
NuoDB (distributed database management) : http://www.nuodb.com
GenieDB (based on MySQL) : http://www.geniedb.com
ScaleArc (SQL traffic manager ) : http://www.scalearc.com
ScaleDB (MySQL scalability) : http://scaledb.com
Tokutek/TokuDB (MySQL/MariaDB scallability): http://www.tokutek.com
JustoneDB (built upon PostgreSQL) : http://www.justonedb.com
MemSQL (in-memory database) : http://www.memsql.com
پیش نمایش MAUI و اجرای یک مثال
In this video Anders Hejlsberg spends some time discussing TypeScript. He starts with the reasons behind creating TypeScript (the so called elevator speech) and then moves on to some of the features coming in the next release. He mentions a number of features but spends the time discussing the null (and corresponding undefined) types and how TypeScript 2 makes handling them much easier.
سری بررسی پشت صحنهی دات نت
In this series I answer various .NET questions. Some of them are asked during interviews, some of them I see on the internet, some of them are completely made up. The goal is to provide short answer with links to references if needed. This is by no means a .NET tutorial or experts reference, this is just a bunch of useful answers to refresh your knowledge.