اشتراک‌ها
روش‌های مقابله با مشکل امنیتی Mass Assignment در ASP.NET Core
  • Use BindAttribute on the action method 
  • Use [Editable] or [BindNever] on the model 
  • Use two different models 
  • Use a base class 
  • Use ModelMetadataTypeAttribute 
  • Explicit binding via TryUpdateModelAsync<> 

This was a very quick run down of some of the options available to you to prevent mass assignment. Which approach you take is up to you, though I would definitely suggest using one of the latter 2-model approaches. There are other options too, such as doing explicit binding via TryUpdateModelAsync<> but the options I've shown represent some of the most common approaches. Whatever you do, don't just blindly bind your view models if you have properties that should not be edited by a user, or you could be in for a nasty surprise.

And whatever you do, don't bind directly to your EntityFramework models. Pretty please. 

روش‌های مقابله با مشکل امنیتی Mass Assignment در ASP.NET Core
اشتراک‌ها
نکاتی درباره استفاده از Automappers
Never use automappers to map DTOs to domain classes.
Use them only to map from domain classes to DTOs.
Automappers might not add much value in complex domain models. In such scenarios, you can as well just implement the mapping manually.
Automappers are still useful as scaffolding mechanism when you start your project out, or if your domain isn’t too complex. 
نکاتی درباره استفاده از Automappers
اشتراک‌ها
مقاله ای مفید در مورد برنامه نویسی غیرهمزمان از مد تورگسن

Asynchronous methods in the upcoming versions of Visual Basic and C# are a great way to get the callbacks out of your asynchronous programming. In this article, I’ll take a closer look at what the new await keyword actually does, starting at the conceptual level and working my way down to the iron. 

مقاله ای مفید در مورد برنامه نویسی غیرهمزمان از مد تورگسن
اشتراک‌ها
چگونه یک کد آنالیزر Roslyn بنویسیم؟

Roslyn analyzers inspect your code for style, quality, maintainability, design and other issues. Because they are powered by the .NET Compiler Platform, they can produce warnings in your code as you type even before you’ve finished the line. In other words, you don’t have to build your code to find out that you made a mistake. Analyzers can also surface an automatic code fix through the Visual Studio light bulb prompt that allows you to clean up your code immediately. 

چگونه یک کد آنالیزر Roslyn بنویسیم؟
اشتراک‌ها
Microsoft.Data.Sqlite 2.1 منتشر شد
// User-defined functions

connection.CreateFunction(
    "volume",
    (double radius, double height)
        => Math.PI * Math.Pow(radius, 2) * height);

// And use the function in SQL to find the biggest cylinder.

SELECT id, volume(radius, height) AS volume
FROM cylinder
ORDER BY volume DESC
LIMIT 1
Microsoft.Data.Sqlite 2.1 منتشر شد