DamageAssessment_Backend/DamageAssesmentApi/DamageAssesment.Api.Locations/Db/LocationDbContext.cs
2023-08-18 17:14:41 -04:00

21 lines
755 B
C#

using Microsoft.EntityFrameworkCore;
namespace DamageAssesment.Api.Locations.Db
{
public class LocationDbContext:DbContext
{
private IConfiguration _Configuration { get; set; }
public LocationDbContext(DbContextOptions options, IConfiguration configuration) : base(options)
{
_Configuration = configuration;
}
protected override void OnConfiguring(DbContextOptionsBuilder options)
{
// connect to sql server with connection string from app settings
options.UseSqlServer(_Configuration.GetConnectionString("LocationConnection"));
}
public DbSet<Db.Location> Locations { get; set; }
public DbSet<Db.Region> Regions { get; set; }
}
}