نظرات مطالب
آشنایی با NHibernate - قسمت هشتم
سلام با تشکر از مطلب خوبتون
لینک زیر نحوه ترکیب Repository با EF رو توضیح داده که البته ادامه داره و در پست های بعدی مطلب رو تکمیل و به روز کرده
http://huyrua.wordpress.com/2010/07/13/entity-framework-4-poco-repository-and-specification-pattern/
پاسخ به بازخورد‌های پروژه‌ها
درخواست راهنمایی سیستم Decision
مقاله «بررسی نحوه‌ی راه اندازی پروژه‌ی Decision» به شما دید می‌ده که بانک اطلاعاتی اون چطور درست یا به روز میشه. مطلب « خودکار کردن تعاریف DbSetها در EF Code first» رو هم مطالعه کنید. ضمنا مباحث Migrations رو هم باید بخونید: Entity framework code-first  
اشتراک‌ها
سری کار با Web API

My road for the series is as follows,

    RESTful Day #1: Enterprise level application architecture with Web APIs using Entity Framework, Generic Repository pattern and Unit of Work.
    RESTful Day #2: Inversion of control using dependency injection in Web APIs using Unity Container and Bootstrapper.
    RESTful Day #3: Resolve dependency of dependencies using Inversion of Control and dependency injection in Asp.net Web APIs with Unity Container and Managed Extensibility Framework (MEF).
    RESTful Day #4: Custom URL Re-Writing/Routing using Attribute Routes in MVC 4 Web APIs.
    RESTful Day #5: Basic Authentication and Token based custom Authorization in Web APIs using Action Filters.
    RESTful Day #6: Request logging and Exception handing/logging in Web APIs using Action Filters, Exception Filters and nLog.
    RESTful Day #7: Unit testing ASP.NET Web APIs controllers using nUnit.
    RESTful Day #8: Extending OData support in ASP.NET Web APIs.

سری کار با Web API
اشتراک‌ها
NET Core 3. و پشتیبانی از Windows Desktop Applications

At Microsoft Build Live today, we are sharing a first look at our plans for .NET Core 3. The highlight of .NET Core 3 is support for Windows desktop applications, specifically Windows Forms, Windows Presentation Framework (WPF), and UWP XAML. You will be able to run new and existing Windows desktop applications on .NET Core and enjoy all the benefits that .NET Core has to offer. 

NET Core 3. و پشتیبانی از Windows Desktop Applications
اشتراک‌ها
دوره مقدماتی ASP.NET Core از Microsoft Virtual Academy

Explore ASP.NET Core SDK and tooling, look at .NET Core CLI, and learn how to build an ASP.NET Core app with Razor Pages MVC. Plus, get the details on logging and diagnostics. Find lots of cross-platform goodness and get .NET ready, as you learn more about this framework for building modern cloud-based web apps. Build your first ASP.NET project, and gear up for the intermediate ASP.NET Core course. 

دوره مقدماتی ASP.NET Core از Microsoft Virtual Academy
مطالب
Entity Framework و InnerException
در Entity Framework  بیشتر استثناها تودرتو هستند و ما باید تمام استثناها رو بررسی کنیم تا به پیغام اصلی خطا برسیم. با استفاده از تکه کد زیر به راحتی می‌تونیم استثناها رو پیمایش کنیم و متن خطا را مشخص کنیم.
                catch (Exception ex)
                {
                    StringBuilder errorMsg = new StringBuilder();
                    for (Exception current = ex; current != null; current = current.InnerException)
                    {
                        if (errorMsg.Length > 0)
                            errorMsg.Append("\n");

                        errorMsg.Append(current.Message.Replace("See the inner exception for details.", string.Empty));
                    }
                    // log
                    errorMsg.ToString();
                }
برای استفاده در قسمت‌های مختلف برنامه یک متد الحاقی مانند زیر تعریف می‌کنیم: 
        public static string ExceptionToString(this Exception ex)
        {
            StringBuilder errorMsg = new StringBuilder();
            for (Exception current = ex; current != null; current = current.InnerException)
            {
                if (errorMsg.Length > 0)
                    errorMsg.Append("\n");
                errorMsg.Append(current.Message.
                    Replace("See the inner exception for details.", string.Empty));
            }
            return errorMsg.ToString();
        }
catch (Exception ex)
                {
                    // log
                    ex.ExceptionToString();
                }
نظرات مطالب
بالا بردن سرعت بارگذاری اولیه EF Code first با تعداد مدل‌های زیاد
یک نکته‌ی تکمیلی: امکان بالابردن سرعت بارگذاری برنامه‌های مبتنی بر EF 6.2 به صورت توکار

با به روز رسانی ارجاعات EF مورد استفاده:
To Update 
PM> Update-Package EntityFramework -Version 6.2.0

To install
PM> Install-Package EntityFramework -Version 6.2.0
 تنها کافی است قطعه کد ذیل را به اسمبلی حاوی Context خود اضافه کنید:
public class MyDbConfiguration : DbConfiguration
{
   public MyDbConfiguration() : base()
   {
       SetModelStore(new DefaultDbModelStore(Directory.GetCurrentDirectory()));
   }
}
تشخیص و استفاده‌ی از آن توسط EF 6.2 خودکار است. پس از آن یک کش محلی، از مدل سیستم تهیه می‌شود (Entity Framework Code First Model Cache) و در مسیری که قید شده (پارامتر DefaultDbModelStore)، ذخیره خواهد شد؛ مانند:
 /bin/Debug/MyAssembly.MyNamespace.MyDbContext.edmx
بازسازی این کش محلی بجای تولید پویای آن در هربار بارگذاری برنامه (که سرعت آغاز برنامه را کاهش می‌دهد)، بر اساس مقایسه‌ی تاریخ آخرین تغییر اسمبلی حاوی Context برنامه با تاریخ آخرین تغییر فایل کش محلی است. اگر این دو یکی نبودند، این کش بازتولید خواهد شد.

پس از این تغییر کوچک، اولین بار اجرای برنامه همانند حالت تولید پویای Entity Framework Code First Model Cache که پیشتر در حافظه انجام می‌شد، اندکی طول کشیده و نتیجه‌ی آن در فایل edmx یاد شده ذخیره می‌شود. از بار دوم اجرای برنامه، Model Cache از فایل edmx محلی خوانده شده و به این ترتیب سرعت آغاز برنامه به شدت افزایش خواهد یافت.
برای نمونه عنوان شده‌است که با استفاده از این روش، سرعت بارگذاری Context ایی با 600 مدل، از 14 ثانیه به 2 ثانیه کاهش یافته‌است.

یک نکته: برای برنامه‌های وب بهتر است از مسیر پوشه‌ی محافظت شده‌ی App_Data به عنوان پارامتر DefaultDbModelStore استفاده کنید:
var appDataDirectory = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "App_Data");
//OR
var appDataDirectory = AppDomain.CurrentDomain.GetData("DataDirectory").ToString();
اشتراک‌ها
ویژگی های جدید dotNET Core 2.1

Earlier this week, Microsoft published the roadmap for .NET Core 2.1, ASP.NET Core 2.1 and EF Core 2.1, expected to be out in the first quarter of 2018. The team also talked about several new features with this new release. This release is more of a feedback-oriented release based on .NET Core 2.0 release. The.NET Core 2.0 is a huge success and already more than half a million developers are now using .NET Core 2.0. All thanks to .NET Standard 2.0 release . In this post find out about the new features of .NET Core 2.1. 

ویژگی های جدید dotNET Core 2.1