DamageAssessment_Backend/DamageAssesmentApi/DamageAssesment.Api.Attachments/Db/AttachmentsDbContext.cs

21 lines
757 B
C#
Raw Normal View History

2023-08-15 22:52:30 -05:00
using Microsoft.EntityFrameworkCore;
2023-08-18 16:14:41 -05:00
using Microsoft.Extensions.Configuration;
2023-08-15 22:52:30 -05:00
namespace DamageAssesment.Api.Attachments.Db
{
public class AttachmentsDbContext:DbContext
{
2023-08-18 16:14:41 -05:00
private IConfiguration _Configuration { get; set; }
public AttachmentsDbContext(DbContextOptions options, IConfiguration configuration) : base(options)
2023-08-15 22:52:30 -05:00
{
2023-08-18 16:14:41 -05:00
_Configuration = configuration;
}
protected override void OnConfiguring(DbContextOptionsBuilder options)
{
// connect to sql server with connection string from app settings
options.UseSqlServer(_Configuration.GetConnectionString("AttachmentConnection"));
2023-08-15 22:52:30 -05:00
}
public DbSet<Db.Attachment> Attachments { get; set; }
}
}