Skip to content

Commit 3f87ec0

Browse files
fix linter
1 parent e00b1c0 commit 3f87ec0

32 files changed

+92
-162
lines changed

src/EfCore.Ydb/src/Diagnostics/Internal/YdbCommandInterceptor.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,5 @@ public override InterceptionResult<DbDataReader> ReaderExecuting(
1010
DbCommand command,
1111
CommandEventData eventData,
1212
InterceptionResult<DbDataReader> result
13-
)
14-
{
15-
return result;
16-
}
13+
) => result;
1714
}

src/EfCore.Ydb/src/Infrastructure/Internal/YdbOptionsExtension.cs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,11 @@ public override DbContextOptionsExtensionInfo Info
2828

2929
private sealed class ExtensionInfo(IDbContextOptionsExtension extension) : RelationalExtensionInfo(extension)
3030
{
31-
private new YdbOptionsExtension Extension
32-
=> (YdbOptionsExtension)base.Extension;
31+
private new YdbOptionsExtension Extension => (YdbOptionsExtension)base.Extension;
3332

3433
public override bool IsDatabaseProvider => true;
3534

3635
// TODO: Right now it's stub
37-
public override void PopulateDebugInfo(IDictionary<string, string> debugInfo)
38-
{
39-
debugInfo["Hello"] = "World!";
40-
}
36+
public override void PopulateDebugInfo(IDictionary<string, string> debugInfo) => debugInfo["Hello"] = "World!";
4137
}
4238
}

src/EfCore.Ydb/src/Metadata/Conventions/YdbStringAttributeConvention.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,5 @@ protected override void ProcessPropertyAdded(
1515
YdbStringAttribute attribute,
1616
MemberInfo clrMember,
1717
IConventionContext context
18-
)
19-
{
20-
propertyBuilder.HasColumnType("string");
21-
}
18+
) => propertyBuilder.HasColumnType("string");
2219
}

src/EfCore.Ydb/src/Migrations/Internal/YdbHistoryRepository.cs

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -56,20 +56,11 @@ where table.Field<string>("table_type") == "TABLE"
5656
return Task.FromResult(foundTables.Count() == 1);
5757
}
5858

59-
public override string GetBeginIfNotExistsScript(string migrationId)
60-
{
61-
throw new NotImplementedException();
62-
}
59+
public override string GetBeginIfNotExistsScript(string migrationId) => throw new NotImplementedException();
6360

64-
public override string GetBeginIfExistsScript(string migrationId)
65-
{
66-
throw new NotImplementedException();
67-
}
61+
public override string GetBeginIfExistsScript(string migrationId) => throw new NotImplementedException();
6862

69-
public override string GetEndIfScript()
70-
{
71-
throw new NotImplementedException();
72-
}
63+
public override string GetEndIfScript() => throw new NotImplementedException();
7364

7465
private sealed class YdbMigrationDatabaseLock(
7566
string name,

src/EfCore.Ydb/src/Query/Internal/Translators/StubTranslator.cs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,8 @@ public class StubTranslator : IMethodCallTranslator, IMemberTranslator
1616
MethodInfo method,
1717
IReadOnlyList<SqlExpression> arguments,
1818
IDiagnosticsLogger<DbLoggerCategory.Query> logger
19-
)
20-
{
21-
return null;
22-
}
19+
) => null;
2320

2421
public SqlExpression? Translate(SqlExpression? instance, MemberInfo member, Type returnType,
25-
IDiagnosticsLogger<DbLoggerCategory.Query> logger)
26-
{
27-
return null;
28-
}
22+
IDiagnosticsLogger<DbLoggerCategory.Query> logger) => null;
2923
}

src/EfCore.Ydb/src/Query/Internal/YdbQuerySqlGenerator.cs

Lines changed: 12 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,7 @@ IRelationalTypeMappingSource typeMappingSource
2525
}
2626

2727
[return: NotNullIfNotNull("node")]
28-
public override Expression? Visit(Expression? node)
29-
{
30-
return node != null ? base.Visit(node) : null;
31-
}
28+
public override Expression? Visit(Expression? node) => node != null ? base.Visit(node) : null;
3229

3330
protected override Expression VisitColumn(ColumnExpression columnExpression)
3431
{
@@ -221,23 +218,16 @@ protected override void GenerateLimitOffset(SelectExpression selectExpression)
221218
}
222219
}
223220

224-
private bool IsComplexSelect(
225-
SelectExpression select,
226-
TableExpressionBase fromTable
227-
)
228-
{
229-
return select.Offset != null
230-
|| select.Limit != null
231-
|| select.Having != null
232-
|| select.Orderings.Count > 0
233-
|| select.GroupBy.Count > 0
234-
|| select.Projection.Count > 0
235-
|| select.Tables.Count > 1
236-
|| select.Predicate is InExpression
237-
|| !(select.Tables.Count == 1
238-
&& select.Tables[0].Equals(fromTable)
239-
);
240-
}
221+
private bool IsComplexSelect(SelectExpression select, TableExpressionBase fromTable) =>
222+
select.Offset != null
223+
|| select.Limit != null
224+
|| select.Having != null
225+
|| select.Orderings.Count > 0
226+
|| select.GroupBy.Count > 0
227+
|| select.Projection.Count > 0
228+
|| select.Tables.Count > 1
229+
|| select.Predicate is InExpression
230+
|| !(select.Tables.Count == 1 && select.Tables[0].Equals(fromTable));
241231

242232
protected override string GetOperator(SqlBinaryExpression binaryExpression)
243233
=> binaryExpression.OperatorType == ExpressionType.Add
@@ -262,7 +252,7 @@ protected override Expression VisitJsonScalar(JsonScalarExpression jsonScalarExp
262252
{
263253
var pathSegment = path[i];
264254
var isFirst = i == 0;
265-
255+
266256
switch (pathSegment)
267257
{
268258
case { PropertyName: { } propertyName }:

src/EfCore.Ydb/src/Query/Internal/YdbQueryTranslationPostprocessor.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ public class YdbQueryTranslationPostprocessor(
99
RelationalQueryCompilationContext queryCompilationContext
1010
) : RelationalQueryTranslationPostprocessor(dependencies, relationalDependencies, queryCompilationContext)
1111
{
12-
protected override Expression ProcessTypeMappings(Expression expression) =>
12+
protected override Expression ProcessTypeMappings(Expression expression) =>
1313
new YdbTypeMappingPostprocessor(Dependencies, RelationalDependencies, RelationalQueryCompilationContext)
1414
.Process(expression);
1515
}

src/EfCore.Ydb/src/Query/Internal/YdbSqlExpressionFactory.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ namespace EfCore.Ydb.Query.Internal;
88
public class YdbSqlExpressionFactory(SqlExpressionFactoryDependencies dependencies) : SqlExpressionFactory(dependencies)
99
{
1010
[return: NotNullIfNotNull("sqlExpression")]
11-
public override SqlExpression? ApplyTypeMapping(SqlExpression? sqlExpression, RelationalTypeMapping? typeMapping)
12-
{
13-
return base.ApplyTypeMapping(sqlExpression, typeMapping);
14-
}
11+
public override SqlExpression? ApplyTypeMapping(SqlExpression? sqlExpression, RelationalTypeMapping? typeMapping) =>
12+
base.ApplyTypeMapping(sqlExpression, typeMapping);
1513
}

src/EfCore.Ydb/src/Storage/Internal/IYdbRelationalConnection.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,5 @@ namespace EfCore.Ydb.Storage.Internal;
44

55
public interface IYdbRelationalConnection : IRelationalConnection
66
{
7-
87
IYdbRelationalConnection Clone();
98
}

src/EfCore.Ydb/src/Storage/Internal/Mapping/YdbDecimalTypeMapping.cs

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -26,19 +26,14 @@ protected override RelationalTypeMapping Clone(RelationalTypeMappingParameters p
2626

2727
protected override string ProcessStoreType(
2828
RelationalTypeMappingParameters parameters, string storeType, string storeTypeNameBase
29-
)
30-
{
31-
return storeType == "BigInteger" && parameters.Precision != null
32-
? $"Decimal({parameters.Precision}, 0)"
33-
: parameters.Precision is null
34-
? storeType
35-
: parameters.Scale is null
36-
? $"Decimal({parameters.Precision}, 0)"
37-
: $"Decimal({parameters.Precision}, {parameters.Scale})";
38-
}
29+
) => storeType == "BigInteger" && parameters.Precision != null
30+
? $"Decimal({parameters.Precision}, 0)"
31+
: parameters.Precision is null
32+
? storeType
33+
: parameters.Scale is null
34+
? $"Decimal({parameters.Precision}, 0)"
35+
: $"Decimal({parameters.Precision}, {parameters.Scale})";
3936

40-
public override MethodInfo GetDataReaderMethod()
41-
{
42-
return typeof(DbDataReader).GetRuntimeMethod(nameof(DbDataReader.GetDecimal), [typeof(int)])!;
43-
}
37+
public override MethodInfo GetDataReaderMethod() =>
38+
typeof(DbDataReader).GetRuntimeMethod(nameof(DbDataReader.GetDecimal), [typeof(int)])!;
4439
}

0 commit comments

Comments
 (0)