-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'dev' into LNK-3055-Update-measure-eval-to-use-3.12-CQFr…
…amework-libraries
- Loading branch information
Showing
17 changed files
with
714 additions
and
69 deletions.
There are no files selected for viewing
368 changes: 368 additions & 0 deletions
368
Azure_Pipelines/azure-pipelines.db-schema-creation.yaml
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,43 @@ | ||
using LantanaGroup.Link.Audit.Domain.Entities; | ||
using Microsoft.EntityFrameworkCore; | ||
using Microsoft.EntityFrameworkCore.Design; | ||
|
||
namespace LantanaGroup.Link.Audit.Persistance | ||
namespace LantanaGroup.Link.Audit.Persistance; | ||
|
||
public class AuditDbContext : DbContext | ||
{ | ||
public class AuditDbContext : DbContext | ||
public AuditDbContext(DbContextOptions<AuditDbContext> options) : base(options) | ||
{ | ||
} | ||
|
||
public DbSet<AuditLog> AuditLogs { get; set; } = null!; | ||
|
||
protected override void OnModelCreating(ModelBuilder modelBuilder) | ||
{ | ||
public AuditDbContext(DbContextOptions<AuditDbContext> options) : base(options) | ||
{ | ||
} | ||
|
||
public DbSet<AuditLog> AuditLogs { get; set; } = null!; | ||
|
||
protected override void OnModelCreating(ModelBuilder modelBuilder) | ||
{ | ||
modelBuilder.ApplyConfigurationsFromAssembly(typeof(AuditDbContext).Assembly); | ||
base.OnModelCreating(modelBuilder); | ||
} | ||
|
||
modelBuilder.ApplyConfigurationsFromAssembly(typeof(AuditDbContext).Assembly); | ||
base.OnModelCreating(modelBuilder); | ||
} | ||
|
||
} | ||
|
||
public class AuditDbContextFactory : IDesignTimeDbContextFactory<AuditDbContext> | ||
{ | ||
public AuditDbContext CreateDbContext(string[] args) | ||
{ | ||
string env = Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT") ?? "Development"; | ||
|
||
IConfiguration config = new ConfigurationBuilder() | ||
.SetBasePath(Path.Combine(Directory.GetParent(Directory.GetCurrentDirectory()).FullName, "Audit")) | ||
.AddJsonFile("appsettings.json") | ||
.AddJsonFile($"appsettings.{env}.json", optional: true) | ||
//.AddEnvironmentVariables() | ||
.Build(); | ||
|
||
var optionsBuilder = new DbContextOptionsBuilder<AuditDbContext>(); | ||
var connectionString = config.GetConnectionString("SqlServer"); | ||
connectionString = string.IsNullOrWhiteSpace(connectionString) ? "Data Source;Initial;Integrated Security=True;" : connectionString; | ||
optionsBuilder.UseSqlServer(connectionString); | ||
|
||
return new AuditDbContext(optionsBuilder.Options); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,33 @@ | ||
using LantanaGroup.Link.Notification.Domain.Entities; | ||
using Microsoft.EntityFrameworkCore; | ||
using Microsoft.EntityFrameworkCore.Design; | ||
using System.Linq.Expressions; | ||
|
||
namespace LantanaGroup.Link.Notification.Persistence | ||
namespace LantanaGroup.Link.Notification.Persistence; | ||
|
||
public class NotificationDbContext : DbContext | ||
{ | ||
public class NotificationDbContext : DbContext | ||
public NotificationDbContext(DbContextOptions<NotificationDbContext> options) : base(options) | ||
{ | ||
public NotificationDbContext(DbContextOptions<NotificationDbContext> options) : base(options) | ||
{ | ||
} | ||
} | ||
|
||
public DbSet<NotificationEntity> Notifications { get; set; } = null!; | ||
public DbSet<NotificationConfig> NotificationConfigs { get; set; } = null!; | ||
public DbSet<NotificationEntity> Notifications { get; set; } = null!; | ||
public DbSet<NotificationConfig> NotificationConfigs { get; set; } = null!; | ||
|
||
protected override void OnModelCreating(ModelBuilder modelBuilder) | ||
protected override void OnModelCreating(ModelBuilder modelBuilder) | ||
{ | ||
modelBuilder.ApplyConfigurationsFromAssembly(typeof(NotificationDbContext).Assembly); | ||
base.OnModelCreating(modelBuilder); | ||
} | ||
|
||
public class NotificationDbContextFactory : IDesignTimeDbContextFactory<NotificationDbContext> | ||
{ | ||
public NotificationDbContext CreateDbContext(string[] args) | ||
{ | ||
modelBuilder.ApplyConfigurationsFromAssembly(typeof(NotificationDbContext).Assembly); | ||
base.OnModelCreating(modelBuilder); | ||
} | ||
var optionsBuilder = new DbContextOptionsBuilder<NotificationDbContext>(); | ||
optionsBuilder.UseSqlServer(); | ||
|
||
return new NotificationDbContext(optionsBuilder.Options); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,39 @@ | ||
using LantanaGroup.Link.Tenant.Entities; | ||
using LantanaGroup.Link.Tenant.Repository.Mapping; | ||
using Microsoft.EntityFrameworkCore; | ||
using Microsoft.EntityFrameworkCore.Design; | ||
|
||
namespace LantanaGroup.Link.Tenant.Repository.Context | ||
namespace LantanaGroup.Link.Tenant.Repository.Context; | ||
|
||
public class FacilityDbContext : DbContext | ||
{ | ||
public class FacilityDbContext : DbContext | ||
public FacilityDbContext(DbContextOptions<FacilityDbContext> options) : base(options) | ||
{ | ||
public FacilityDbContext(DbContextOptions<FacilityDbContext> options) : base(options) | ||
{ | ||
} | ||
} | ||
|
||
protected override void OnModelCreating(ModelBuilder modelBuilder) | ||
{ | ||
modelBuilder.ApplyConfiguration(new FacilityConfigMap()); | ||
protected override void OnModelCreating(ModelBuilder modelBuilder) | ||
{ | ||
modelBuilder.ApplyConfiguration(new FacilityConfigMap()); | ||
|
||
modelBuilder.Entity<FacilityConfigModel>() | ||
.Property(b => b.Id) | ||
.HasConversion( | ||
v => new Guid(v), | ||
v => v.ToString() | ||
); | ||
modelBuilder.Entity<FacilityConfigModel>() | ||
.Property(b => b.Id) | ||
.HasConversion( | ||
v => new Guid(v), | ||
v => v.ToString() | ||
); | ||
|
||
} | ||
} | ||
|
||
public DbSet<FacilityConfigModel> Facilities { get; set; } | ||
|
||
public DbSet<FacilityConfigModel> Facilities { get; set; } | ||
public class FacilityDbContextFactory : IDesignTimeDbContextFactory<FacilityDbContext> | ||
{ | ||
public FacilityDbContext CreateDbContext(string[] args) | ||
{ | ||
var optionsBuilder = new DbContextOptionsBuilder<FacilityDbContext>(); | ||
optionsBuilder.UseSqlServer(); | ||
|
||
return new FacilityDbContext(optionsBuilder.Options); | ||
} | ||
} | ||
} |
Oops, something went wrong.