Skip to content

Commit 7173b04

Browse files
added EF SLO
1 parent d0a2bdb commit 7173b04

File tree

3 files changed

+13
-10
lines changed

3 files changed

+13
-10
lines changed

.github/workflows/slo.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
workload:
3333
- AdoNet
3434
- Dapper
35-
# - EF
35+
- EF
3636

3737
concurrency:
3838
group: slo-${{ github.ref }}-${{ matrix.workload }}

slo/src/EF/SloTableContext.cs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ await executeStrategy.ExecuteAsync(async () =>
4040
"VALUES (@Guid, @Id, @PayloadStr, @PayloadDouble, @PayloadTimestamp)",
4141
new YdbParameter
4242
{
43-
DbType = DbType.String,
43+
DbType = DbType.Guid,
4444
ParameterName = "Guid",
45-
Value = sloTable.Guid.ToString()
45+
Value = sloTable.Guid
4646
},
4747
new YdbParameter
4848
{
@@ -79,11 +79,9 @@ await executeStrategy.ExecuteAsync(async () =>
7979
int readTimeout
8080
)
8181
{
82-
// await using var dbContext = client();
83-
// await dbContext.SloEntities
84-
// .FirstAsync(table => table.Guid == select.Guid && table.Id == select.Id);
85-
86-
return (0, StatusCode.Success, null);
82+
await using var dbContext = client();
83+
return (0, StatusCode.Success, await dbContext.SloEntities.FirstOrDefaultAsync(
84+
table => table.Guid == select.Guid && table.Id == select.Id));
8785
}
8886

8987
protected override async Task<int> SelectCount(Func<TableDbContext> client)

src/EFCore.Ydb/src/Storage/Internal/YdbTypeMappingSource.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ RelationalTypeMappingSourceDependencies relationalDependencies
3232

3333
private static readonly YdbDecimalTypeMapping Decimal = new(typeof(decimal));
3434

35+
private static readonly GuidTypeMapping Guid = new("Uuid");
36+
3537
private static readonly YdbTextTypeMapping Text = YdbTextTypeMapping.Default;
3638
private static readonly YdbBytesTypeMapping Bytes = YdbBytesTypeMapping.Default;
3739
private static readonly YdbJsonTypeMapping Json = new("Json", typeof(JsonElement), null);
@@ -64,6 +66,9 @@ RelationalTypeMappingSourceDependencies relationalDependencies
6466
{ "Float", [Float] },
6567
{ "Double", [Double] },
6668

69+
{ "Decimal", [Decimal] },
70+
{ "Guid", [Guid] },
71+
6772
{ "Date", [Date] },
6873
{ "DateTime", [DateTime] },
6974
{ "Timestamp", [Timestamp] },
@@ -72,8 +77,6 @@ RelationalTypeMappingSourceDependencies relationalDependencies
7277
{ "Text", [Text] },
7378
{ "Bytes", [Bytes] },
7479

75-
{ "Decimal", [Decimal] },
76-
7780
{ "Json", [Json] }
7881
};
7982

@@ -95,6 +98,8 @@ RelationalTypeMappingSourceDependencies relationalDependencies
9598
{ typeof(double), Double },
9699
{ typeof(decimal), Decimal },
97100

101+
{ typeof(Guid), Guid },
102+
98103
{ typeof(string), Text },
99104
{ typeof(byte[]), Bytes },
100105
{ typeof(JsonElement), Json },

0 commit comments

Comments
 (0)