اشتراک‌ها
اعتبارسنجی 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
اشتراک‌ها
task ها در سی شارپ

In this article, we will learn:
What is a Task in C# ?
Properties of Task class
Different Methods in Task class
How to create a Task in C#?
Return a Value from Task
Attaching Child Task to Parent Task
Task Factory

task ها در سی شارپ
اشتراک‌ها
Visual Studio 2019 version 16.3.3 منتشر شد
Visual Studio 2019 version 16.3.3 منتشر شد
مطالب
Dependency Injection

در ادامه مباحث بهتر کد بنویسیم و الگوهایی که در این رابطه معرفی شدند، اخیرا کتابی از انتشارات manning منتشر شده تحت عنوان Dependency Injection . هر چند به ظاهر این کتاب برای جاوا کارها تهیه شده اما قسمت عمده‌ای از آن برای سایر زبان‌های برنامه نویسی دیگر نیز قابل استفاده است.




DESCRIPTION
In object-oriented programming, a central program normally controls other objects in a module, library, or framework. With dependency injection, this pattern is inverted—a reference to a service is placed directly into the object which eases testing and modularity. Spring or Google Guice use dependency injection so you can focus on your core application and let the framework handle infrastructural concerns.
Dependency Injection explores the DI idiom in fine detail, with numerous practical examples that show you the payoffs. You'll apply key techniques in Spring and Guice and learn important pitfalls, corner-cases, and design patterns. Readers need a working knowledge of Java but no prior experience with DI is assumed.

WHAT'S INSIDE:
◊ How to apply it (Understand it first!)
◊ Design patterns and nuances
◊ Spring, Google Guice, PicoContainer, and more
◊ How to integrate DI with Java frameworks


راستی، این کتاب تر و تازه رو می‌تونید از همین کتاب فروشی‌های دور و اطراف نیز تهیه کنید! در سایت booktraining دات ارگ در قسمت graphics-and-design به تاریخ 4 آگوست.



نظرات اشتراک‌ها
نکاتی که برنامه نویس‌های خوب باید بیشتر بر روی آن‌ها تمرکز کنند
مثل اینکه نویسنده مقاله با جاوا مشکل داره
تازه به جای یک بار هم یکی به عنوان پی نوشت درج کرده
الان که به خاطر اندروید توی بورس هم افتاده
یکی توی نظرات نوشته
Java is “so” dead that it is the second most demanding programming language in Europe at least. Obviously, this post was written by a newbie. 
اشتراک‌ها
Reflector 10 منتشر شد

What's new in this release?

  • Full C#7.0 support
  • .NET Core support

For more information, please see the release notes.

Upgrading to .NET Reflector 10
.NET Reflector 10 is a major upgrade from .NET Reflector 9. If your current license includes a valid support and upgrades package for .NET Reflector 10, the same license serial number will automatically activate .NET Reflector 10.

If your v9.x license does not include support and upgrades, Reflector will upgrade to a 14-day trial of v10.0. 

Reflector 10 منتشر شد