using EmployeeService.Model;
using Microsoft.EntityFrameworkCore;
namespace EmployeeService.Domain
{
public class Connection:DbContext
{
public Connection(DbContextOptions opt):base(opt)
{
}
public DbSet<Employee> Employee { get; set; }
}
}
https://www.entityframeworktutorial.net/efcore/entity-framework-core-migration.aspx
using Microsoft.EntityFrameworkCore;
namespace EmployeeService.Domain
{
public class Connection:DbContext
{
public Connection(DbContextOptions opt):base(opt)
{
}
public DbSet<Employee> Employee { get; set; }
}
}
services.AddDbContext<Connection>(sp => sp.UseSqlServer("server=servername;database=database name;integrated security=true;USER ID= user;Password=password"));
https://www.entityframeworktutorial.net/efcore/entity-framework-core-migration.aspx
No comments:
Post a Comment