-
Notifications
You must be signed in to change notification settings - Fork 127
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial support for Enumerations : document enum support #261
- Loading branch information
1 parent
4c47a6c
commit 5d7103e
Showing
46 changed files
with
2,410 additions
and
128 deletions.
There are no files selected for viewing
659 changes: 659 additions & 0 deletions
659
RepoDb.Core/RepoDb.Tests/RepoDb.IntegrationTests/EnumPropertyTest.cs
Large diffs are not rendered by default.
Oops, something went wrong.
8 changes: 8 additions & 0 deletions
8
RepoDb.Core/RepoDb.Tests/RepoDb.IntegrationTests/Enumerations/BooleanValue.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,8 @@ | ||
namespace RepoDb.IntegrationTests.Enumerations | ||
{ | ||
public enum BooleanValue | ||
{ | ||
False, | ||
True | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
RepoDb.Core/RepoDb.Tests/RepoDb.IntegrationTests/Enumerations/Continent.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,13 @@ | ||
namespace RepoDb.IntegrationTests.Enumerations | ||
{ | ||
public enum Continent | ||
{ | ||
Asia, | ||
Africa, | ||
Australia, | ||
Europe, | ||
NorthAmerica, | ||
SouthAmerica, | ||
Antartica | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
RepoDb.Core/RepoDb.Tests/RepoDb.IntegrationTests/Enumerations/Direction.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,10 @@ | ||
namespace RepoDb.IntegrationTests.Enumerations | ||
{ | ||
public enum Direction | ||
{ | ||
North, | ||
South, | ||
East, | ||
West | ||
} | ||
} |
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
33 changes: 33 additions & 0 deletions
33
RepoDb.Core/RepoDb.Tests/RepoDb.IntegrationTests/Models/EnumClasses.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,33 @@ | ||
using RepoDb.Attributes; | ||
using RepoDb.IntegrationTests.Enumerations; | ||
using System; | ||
using System.Data; | ||
|
||
namespace RepoDb.IntegrationTests.Models | ||
{ | ||
[Map("[dbo].[CompleteTable]")] | ||
public class EnumCompleteTable | ||
{ | ||
public Guid SessionId { get; set; } | ||
public BooleanValue? ColumnBit { get; set; } | ||
public Direction ColumnNVarChar { get; set; } | ||
public Direction? ColumnInt { get; set; } | ||
public Direction? ColumnBigInt { get; set; } | ||
public Direction? ColumnSmallInt { get; set; } | ||
} | ||
|
||
[Map("[dbo].[CompleteTable]")] | ||
public class EnumAsIntForStringCompleteTable | ||
{ | ||
public Guid SessionId { get; set; } | ||
[TypeMap(DbType.Int32)] | ||
public Direction ColumnNVarChar { get; set; } | ||
} | ||
|
||
[Map("[dbo].[CompleteTable]")] | ||
public class TypeLevelMappedForStringEnumCompleteTable | ||
{ | ||
public Guid SessionId { get; set; } | ||
public Continent ColumnNVarChar { get; set; } | ||
} | ||
} |
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
Oops, something went wrong.