Sử dụng EF Core Code First trong .NET Core để tạo cơ sở dữ liệu
Đầu tiên, cài đặt các gói NuGet cần thiết:
Microsoft.EntityFrameworkCore
Microsoft.EntityFrameworkCore.SqlServer
Microsoft.EntityFrameworkCore.Tools
Khởi tạo hai lớp thực thể đại diện cho bảng trong cơ sở dữ liệu:
public class DonVi
{
[Key]
public int Ma { get; set; }
public string MaCap { get; set; }
public string Ten ...
Đăng vào ngày 14 tháng 6 lúc 19:42