Create an Interceptor to find slow queries in EntityFramework Core


In this article we want to create an interceptor to find queries that take more than 2 seconds. To implement, we need to create a class that inherits from the DbCommandInterceptor class. The DbCommandInterceptor class is in EF Core 3 or higher ....
Read more

The difference between AsNoTracking and AsNoTrackingWithIdentityResolution


In the Entity Framework, every time we read one or more records of data from the database, they are tracked by ChangeTracker by default. And that gives us some performance reduction ....
Read more

Implementing NOLOCK in EntityFramework


In SQL when the records to be BULK INSERT stored large number of records SQL table to Lock and until all the data into SQL will not be able to get a data table read (by default). But in SQL itself you can read data UnCommited from tables. This can only retrieve data that is not Commit ....
Read more

Accurate tagging of queries in the Entity Framework Core


Sometimes we may write queries in the EF and retrieve a lot of data from the database, and as the project gets bigger, the number of queries increases, making it difficult or impossible to find heavy queries. If you get these queries in SQL Profiler, it is almost impossible to find a written query ....
Read more

ChangeTracker در Entity Framework


در Entity Framework زمانی که شما رکوردهایی را از دیتابیس میخوانید این رکوردها توسط ChangeTracker ردیابی میشوند. با استفاده از این قابلیت Entity Framework تمامی تغییرات بر روی موجودیت ها و پراپرتی ها را نگه میدارد. هر موجودیت در هر زمان دارای یکی از حالت های زیر است : ....
Read more

خودکار سازی فرآیند ثبت جداول دیتابیس و پیکربندی کلاس ها


در Entity Framework هر زمان که بخواهیم یک جدول جدید اضافه کنیم باید یک پراپرتی از نوع DbSet به کلاس کانتکست اضافه کنیم تا با استفاده از آن به محتوای جدول مورد نظر دسترسی داشته باشیم. به عنوان مثال در کد زیر سه جدول Post,Tags,PostTags را به کلاس کانتکست اضافه کرده ایم ....
Read more

پیاده سازی Identity در Asp.Net Core 2.1


آیدنتیتی یک سیستم کامل مدیریت کاربران است که توسط مایکروسافت ارائه شده است. با استفاده از آیدنتیتی کاربران میتوانند با ساخت یک اکانت جدید و یا با استفاده از اکانت های Google, FaceBook,LinkedIn و ... وارد سیستم شوند. در این مقاله به پیاده سازی آیدنتیتی میپردازیم. ....
Read more

ایجاد بانک اطلاعاتی و جداول مربوطه


در Entity framework برای برقرای ارتباط با دیتابیس نیاز به یک کلاس داریم که ارتباط بین پروژه و پایگاه داده را برقرار کند. در این دوره ما از پایگاه داده SQL Server استفاده خواهیم کرد. کلاس مربوطه باید از کلاس DbContext ارث بری کند و نام کلاس با کلمه Context خاتمه یابد. ....
Read more

معرفی EF Core


در این مقاله به بررسی Entity Framework و تاریخچه آن میپردازیم. Entity Framework و Entity Framework Core فریم ورک هایی هستند که امکان ارتباط با دیتابیس را مهیا میسازند. با استفاده از این فریم ورک ها شما میتوانید جداول ....
Read more