-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update to new structure and multi tenancy
- Loading branch information
1 parent
b6fe280
commit 9e8e9a9
Showing
17 changed files
with
284 additions
and
83 deletions.
There are no files selected for viewing
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
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
17 changes: 9 additions & 8 deletions
17
src/CSharp/EasyMicroservices.IdentityMicroservice.StartUp/DatabaseBuilder.cs
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,22 @@ | ||
using EasyMicroservices.Cores.Relational.EntityFrameworkCore.Intrerfaces; | ||
using EasyMicroservices.Cores.Relational.EntityFrameworkCore; | ||
using Microsoft.EntityFrameworkCore; | ||
using Microsoft.Extensions.Configuration; | ||
|
||
namespace EasyMicroservices.IdentityMicroservice | ||
{ | ||
public class DatabaseBuilder : IEntityFrameworkCoreDatabaseBuilder | ||
public class DatabaseBuilder : EntityFrameworkCoreDatabaseBuilder | ||
{ | ||
IConfiguration _configuration; | ||
public DatabaseBuilder(IConfiguration configuration) | ||
public DatabaseBuilder(IConfiguration configuration) : base(configuration) | ||
{ | ||
_configuration = configuration; | ||
} | ||
|
||
public void OnConfiguring(DbContextOptionsBuilder optionsBuilder) | ||
public override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) | ||
{ | ||
//optionsBuilder.UseInMemoryDatabase("IdentityDatabase"); | ||
optionsBuilder.UseSqlServer(_configuration.GetConnectionString("local")); | ||
var entity = GetEntity(); | ||
if (entity.IsSqlServer()) | ||
optionsBuilder.UseSqlServer(entity.ConnectionString); | ||
else if (entity.IsInMemory()) | ||
optionsBuilder.UseInMemoryDatabase("Identity"); | ||
} | ||
} | ||
} |
Oops, something went wrong.