Update RentACarDbContext.cs
This commit is contained in:
1 parent
8eeb6b28a4
commit
f2a4fd68a0
1 file changed
+9
-1
@@ -4,12 +4,20 @@ using Microsoft.EntityFrameworkCore;
|
|||||||
|
|
||||||
namespace Data
|
namespace Data
|
||||||
{
|
{
|
||||||
public class RentACarDbContext
|
public class RentACarDbContext : DbContext
|
||||||
{
|
{
|
||||||
public virtual DbSet<User> Users { get; set; }
|
public virtual DbSet<User> Users { get; set; }
|
||||||
public virtual DbSet<Car> Cars { get; set; }
|
public virtual DbSet<Car> Cars { get; set; }
|
||||||
public virtual DbSet<Rents> Rents { get; set; }
|
public virtual DbSet<Rents> Rents { get; set; }
|
||||||
|
|
||||||
|
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
||||||
|
{
|
||||||
|
if (!optionsBuilder.IsConfigured)
|
||||||
|
{
|
||||||
|
optionsBuilder.UseSqlServer("Server=.;Database=RentACarDb;Integrated Security=true;");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user