-
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.
Support for EntityFrameworkCoreDatabaseBuilder for use database in ap…
…p setting
- Loading branch information
1 parent
17d9332
commit f764e97
Showing
9 changed files
with
67 additions
and
29 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
39 changes: 39 additions & 0 deletions
39
...yMicroservices.Cores.Relational.EntityFrameworkCore/EntityFrameworkCoreDatabaseBuilder.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 |
---|---|---|
@@ -0,0 +1,39 @@ | ||
using EasyMicroservices.Cores.Relational.EntityFrameworkCore.Intrerfaces; | ||
using Microsoft.EntityFrameworkCore; | ||
using Microsoft.Extensions.Configuration; | ||
|
||
namespace EasyMicroservices.Cores.Relational.EntityFrameworkCore; | ||
/// <summary> | ||
/// | ||
/// </summary> | ||
public abstract class EntityFrameworkCoreDatabaseBuilder : IEntityFrameworkCoreDatabaseBuilder | ||
{ | ||
/// <summary> | ||
/// | ||
/// </summary> | ||
protected readonly IConfiguration Configuration; | ||
/// <summary> | ||
/// | ||
/// </summary> | ||
/// <param name="configuration"></param> | ||
public EntityFrameworkCoreDatabaseBuilder(IConfiguration configuration) | ||
{ | ||
Configuration = configuration; | ||
} | ||
|
||
/// <summary> | ||
/// | ||
/// </summary> | ||
/// <param name="optionsBuilder"></param> | ||
public void OnConfiguring(DbContextOptionsBuilder optionsBuilder) | ||
{ | ||
OnConfiguring(optionsBuilder, Configuration.GetSection("Database:ProviderName").Value); | ||
} | ||
|
||
/// <summary> | ||
/// | ||
/// </summary> | ||
/// <param name="optionsBuilder"></param> | ||
/// <param name="name"></param> | ||
public abstract void OnConfiguring(DbContextOptionsBuilder optionsBuilder, string name); | ||
} |
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