Users and Finance Ops work wip
This commit is contained in:
parent
4d56898bce
commit
77a5c56e84
|
@ -14,13 +14,13 @@ namespace BlueWest.WebApi.Controllers
|
||||||
[Route("[controller]")]
|
[Route("[controller]")]
|
||||||
public class CountryController : ControllerBase
|
public class CountryController : ControllerBase
|
||||||
{
|
{
|
||||||
private readonly CountriesDbContext _dbContext;
|
private readonly CountryDbContext _dbContext;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Controller responsible for handling country data in the Country table
|
/// Controller responsible for handling country data in the Country table
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="dbContext"></param>
|
/// <param name="dbContext"></param>
|
||||||
public CountryController(CountriesDbContext dbContext)
|
public CountryController(CountryDbContext dbContext)
|
||||||
{
|
{
|
||||||
_dbContext = dbContext;
|
_dbContext = dbContext;
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,9 +15,9 @@ namespace BlueWest.WebApi.Controllers
|
||||||
[Route("[controller]")]
|
[Route("[controller]")]
|
||||||
public class CurrencyController : ControllerBase
|
public class CurrencyController : ControllerBase
|
||||||
{
|
{
|
||||||
private readonly CountriesDbContext _dbContext;
|
private readonly CountryDbContext _dbContext;
|
||||||
|
|
||||||
public CurrencyController(CountriesDbContext dbContext)
|
public CurrencyController(CountryDbContext dbContext)
|
||||||
{
|
{
|
||||||
_dbContext = dbContext;
|
_dbContext = dbContext;
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,7 @@ namespace BlueWest.WebApi.MySQL;
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Countries and Currencies
|
/// Countries and Currencies
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class CountriesDbContext : DbContext
|
public class CountryDbContext : DbContext
|
||||||
{
|
{
|
||||||
|
|
||||||
public DbSet<Country> Countries { get; set; }
|
public DbSet<Country> Countries { get; set; }
|
||||||
|
@ -23,7 +23,7 @@ public class CountriesDbContext : DbContext
|
||||||
/// Options to be injected in the app
|
/// Options to be injected in the app
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="options"></param>
|
/// <param name="options"></param>
|
||||||
public CountriesDbContext(DbContextOptions<CountriesDbContext> options) : base(options)
|
public CountryDbContext(DbContextOptions<CountryDbContext> options) : base(options)
|
||||||
{
|
{
|
||||||
Database.EnsureCreated();
|
Database.EnsureCreated();
|
||||||
|
|
|
@ -88,7 +88,7 @@ namespace BlueWest.WebApi
|
||||||
|
|
||||||
|
|
||||||
services
|
services
|
||||||
.AddDbContextPool<CountriesDbContext>(options => options.GetSqlSettings(Configuration))
|
.AddDbContextPool<CountryDbContext>(options => options.GetSqlSettings(Configuration))
|
||||||
.AddDbContextPool<UserDbContext>(options => options.GetSqlSettings(Configuration))
|
.AddDbContextPool<UserDbContext>(options => options.GetSqlSettings(Configuration))
|
||||||
.AddDbContextPool<FinanceDbContext>(options => options.GetSqlSettings(Configuration))
|
.AddDbContextPool<FinanceDbContext>(options => options.GetSqlSettings(Configuration))
|
||||||
;
|
;
|
||||||
|
|
Loading…
Reference in New Issue