Code and prod logo

Code and Prod Complet Projects

Follow me

Code First data annotations

Code First data annotations in .net 7

Code First data annotations in .net 7 are .NET attributes that can be applied to entity classes or properties to override the default conventions of entity framework core (EF Core) like column names, database types, definitions, and rules.

Remove Migration EF Core

Remove Migration EF Core

Remove Migration EF Core : in many cases and after apllaying add migrations you may find that you need to make additional changes to your EF Core model (add or remove property, chage data type, etc.) before applying them . Use this command to remove the last migration.

Data seeding

Data Seeding in migration using EF Core

Data seeding is a process where you populate a database with an initial set of data.
There are several ways to accomplish this in Entity Framework Core (EF Core): Model seed data, Manual migration customization, and Custom initialization logic.

Insert data using DbSet and DbContext

Insert data using DbSet and DbContext

Insert data using DbSet and DbContext: how we can use these two objects for inserting data into a database, so we will see how to Insert data via DbSet and how to Insert data via the DbContext.

Create New Project .NET7

Create New Project DotNet 7

Create New Project using .NET7 CLI, and dotnet new command. The command-line interface (CLI) is a cross-platform toolchain for developing, building, running, and publishing applications

DbContext And DbSet .NET7

DbContext and DbSet in EF Core

DbContext and DbSet are the most used classes when working with the Entity Framework Core. We can use these two classes to easily perform CRUD operations.

Visual Studio Code .NET 7

Visual studio code setup

Visual Studio Code (VS Code) is a free, cross-platform, and lightweight source-code editor developed by Microsoft for Windows, Linux, and Mac operating systems.

Entity Framework Core .NET7

Entity Framework Core .NET7

Entity Framework Core .NET7 or EF Core is an object-relational mapper (O/RM) that enables .NET developers to work with a database using .NET objects