Skip to content

Commit ffd90ba

Browse files
committed
delete annotations
1 parent 815542c commit ffd90ba

File tree

2 files changed

+23
-11
lines changed

2 files changed

+23
-11
lines changed

slo/src/Linq2db.Slo/Linq2db.Slo.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,5 @@
1515
</ItemGroup>
1616
<ItemGroup>
1717
<PackageReference Include="linq2db" Version="6.0.0-rc.3" />
18-
<PackageReference Include="JetBrains.Annotations" Version="2025.2.2" />
1918
</ItemGroup>
2019
</Project>

slo/src/Linq2db.Slo/SloTableContext.cs

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
using Internal;
2-
using JetBrains.Annotations;
32
using Linq2db.Ydb;
43
using Linq2db.Ydb.Internal;
54
using LinqToDB;
@@ -21,7 +20,8 @@ static SloTableContext()
2120

2221
public sealed class Linq2dbClient(string connectionString)
2322
{
24-
public DataConnection Open() => new(new DataOptions().UseConnectionString("YDB", connectionString));
23+
public DataConnection Open()
24+
=> new(new DataOptions().UseConnectionString("YDB", connectionString));
2525
}
2626

2727
protected override Linq2dbClient CreateClient(Config config) => new(config.ConnectionString);
@@ -71,7 +71,21 @@ protected override async Task<int> Save(Linq2dbClient client, SloTable sloTable,
7171
db.CommandTimeout = readTimeout;
7272

7373
var t = db.GetTable<SloRow>();
74-
return await t.FirstOrDefaultAsync(r => r.Guid == select.Guid && r.Id == select.Id);
74+
75+
// Намеренно «используем» все столбцы, чтобы ReSharper не ругался на «неиспользуемые» поля.
76+
var row = await t
77+
.Where(r => r.Guid == select.Guid && r.Id == select.Id)
78+
.Select(r => new
79+
{
80+
r.Guid,
81+
r.Id,
82+
r.PayloadStr,
83+
r.PayloadDouble,
84+
r.PayloadTimestamp
85+
})
86+
.FirstOrDefaultAsync();
87+
88+
return row;
7589
}
7690

7791
protected override async Task<int> SelectCount(Linq2dbClient client)
@@ -80,14 +94,13 @@ protected override async Task<int> SelectCount(Linq2dbClient client)
8094
return await db.GetTable<SloRow>().CountAsync();
8195
}
8296

83-
[UsedImplicitly(ImplicitUseTargetFlags.WithMembers)]
8497
[Table(SloTable.Name)]
85-
public sealed class SloRow
98+
private sealed class SloRow(DateTime payloadTimestamp, double payloadDouble, string? payloadStr, int id, Guid guid)
8699
{
87-
[Column] public Guid Guid { get; set; }
88-
[Column] public int Id { get; set; }
89-
[Column] public string? PayloadStr { get; set; }
90-
[Column] public double PayloadDouble { get; set; }
91-
[Column] public DateTime PayloadTimestamp { get; set; }
100+
[Column] public Guid Guid { get; } = guid;
101+
[Column] public int Id { get; } = id;
102+
[Column] public string? PayloadStr { get; } = payloadStr;
103+
[Column] public double PayloadDouble { get; } = payloadDouble;
104+
[Column] public DateTime PayloadTimestamp { get; } = payloadTimestamp;
92105
}
93106
}

0 commit comments

Comments
 (0)