Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature: logic to allow overriding base dbcontext (#434)
* logic to allow overriding base dbcontext * *BREAKING* detail how the ef generator needs to inherit the old model * factor in some changes on the efmodel gen * simplify creation of gen models for ef * update default for created, modified, rowversion columns
- Loading branch information
Showing
14 changed files
with
252 additions
and
177 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
23 changes: 23 additions & 0 deletions
23
...Dhgms.Nucleotide.Generators/Features/EntityFramework/GenerateCreatedAndModifiedColumns.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,23 @@ | ||
namespace Dhgms.Nucleotide.Generators.Features.EntityFramework | ||
{ | ||
/// <summary> | ||
/// Enum to dictate whether to generate created and modified columns on a DBSet. | ||
/// </summary> | ||
public enum GenerateCreatedAndModifiedColumns | ||
{ | ||
/// <summary> | ||
/// Don't generate either column. | ||
/// </summary> | ||
None, | ||
|
||
/// <summary> | ||
/// Generate only the created column. | ||
/// </summary> | ||
CreatedOnly, | ||
|
||
/// <summary> | ||
/// Generate both the created and modified columns. | ||
/// </summary> | ||
CreatedAndModified | ||
} | ||
} |
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
4 changes: 4 additions & 0 deletions
4
src/Dhgms.Nucleotide.Generators/Models/BaseEntityTypeGenerationModel.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,4 @@ | ||
namespace Dhgms.Nucleotide.Generators.Models | ||
{ | ||
public sealed record BaseEntityTypeGenerationModel(string FullyQualifiedClassName); | ||
} |
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 |
---|---|---|
|
@@ -9,6 +9,7 @@ public enum KeyType | |
Unknown, | ||
Guid, | ||
Int32, | ||
Int64 | ||
Int64, | ||
Inherited | ||
} | ||
} |
Oops, something went wrong.