Merged new dev changes

This commit is contained in:
uppuv
2023-09-13 13:16:42 -04:00
137 changed files with 2247 additions and 1254 deletions

View File

@ -7,8 +7,15 @@ namespace DamageAssesment.Api.Documents.Db
{
public class DocumentDbContext : DbContext
{
public DocumentDbContext(DbContextOptions options) : base(options)
private IConfiguration _Configuration { get; set; }
public DocumentDbContext(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("DocumentConnection"));
}
public DbSet<Db.Document> Documents { get; set; }
public DbSet<Db.LinkType> LinkTypes { get; set; }

View File

@ -17,7 +17,7 @@ builder.Services.AddScoped<IAzureBlobService, AzureBlobService>();
builder.Services.AddAutoMapper(AppDomain.CurrentDomain.GetAssemblies()); //4/30
builder.Services.AddDbContext<DocumentDbContext>(option =>
{
option.UseInMemoryDatabase("DocumentConnection");
option.UseSqlServer("DocumentConnection");
});
var app = builder.Build();

View File

@ -6,6 +6,9 @@
}
},
"AllowedHosts": "*",
"ConnectionStrings": {
"DocumentConnection": "Server=DESKTOP-OF5DPLQ\\SQLEXPRESS;Database=da_survey_dev;Trusted_Connection=True;TrustServerCertificate=True;"
},
"Fileupload": {
"folderpath": "DASA_Documents/Active",
"Deletepath": "DASA_Documents/Deleted"