Skip to content

Commit 688757d

Browse files
committed
style: reformat code with dotnet format
1 parent 6460e9c commit 688757d

File tree

5 files changed

+78
-55
lines changed

5 files changed

+78
-55
lines changed

.editorconfig

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
root = true
2+
3+
[*]
4+
insert_final_newline = true
5+
6+
[*.cs]
7+
8+
# Microsoft .NET properties
9+
csharp_style_expression_bodied_accessors = true:suggestion
10+
csharp_style_expression_bodied_constructors = true:suggestion
11+
csharp_style_expression_bodied_methods = true:suggestion
12+
csharp_style_expression_bodied_properties = true:suggestion
13+
csharp_style_namespace_declarations = file_scoped:warning
14+
csharp_style_implicit_object_creation_when_type_is_apparent = true:warning
15+
dotnet_separate_import_directive_groups = true
16+
17+
# ReSharper properties
18+
resharper_csharp_max_line_length = 160
19+
resharper_object_creation_when_type_evident = target_typed
20+
21+
[{*.props, *.csproj, *.vbproj}]
22+
indent_style = space
23+
indent_size = 2

appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
version: 1.0.{build}
2-
image: Visual Studio 2019
2+
image: Visual Studio 2022
33
environment:
44
IGNORE_NORMALISATION_GIT_HEAD_MOVE: 1
55
build_script:

src/NHibernate.Driver.MySqlConnector/ConnectionConfigurationExtensionMySqlConnector.cs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,9 @@
22
using NHibernate.Driver.MySqlConnector;
33

44
// ReSharper disable once CheckNamespace
5-
namespace NHibernate.Cfg
5+
namespace NHibernate.Cfg;
6+
7+
public static class ConnectionConfigurationExtensionMySqlConnector
68
{
7-
public static class ConnectionConfigurationExtensionMySqlConnector
8-
{
9-
public static void MySqlConnectorDriver(this IDbIntegrationConfigurationProperties cfg) => cfg.Driver<MySqlConnectorDriver>();
10-
}
11-
}
9+
public static void MySqlConnectorDriver(this IDbIntegrationConfigurationProperties cfg) => cfg.Driver<MySqlConnectorDriver>();
10+
}

src/NHibernate.Driver.MySqlConnector/MySqlConnectorDriver.cs

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -6,43 +6,43 @@
66
using NHibernate.AdoNet;
77
using NHibernate.Engine;
88

9-
namespace NHibernate.Driver.MySqlConnector
9+
namespace NHibernate.Driver.MySqlConnector;
10+
11+
/// <summary>
12+
/// Provides a database driver for MySQL using <a href="https://mysqlconnector.net/">MySqlConnector</a>.
13+
/// </summary>
14+
/// <remarks>
15+
/// Uses <see cref="GenericBatchingBatcherFactory" /> for batching.
16+
/// </remarks>
17+
public class MySqlConnectorDriver : DriverBase, IEmbeddedBatcherFactoryProvider
1018
{
11-
/// <summary>
12-
/// Provides a database driver for MySQL using <a href="https://mysqlconnector.net/">MySqlConnector</a>.
13-
/// </summary>
14-
/// <remarks>
15-
/// Uses <see cref="GenericBatchingBatcherFactory"/> for batching.
16-
/// </remarks>
17-
public class MySqlConnectorDriver : DriverBase, IEmbeddedBatcherFactoryProvider
18-
{
19-
public override bool UseNamedPrefixInSql => true;
19+
public override bool UseNamedPrefixInSql => true;
20+
21+
public override bool UseNamedPrefixInParameter => true;
2022

21-
public override bool UseNamedPrefixInParameter => true;
23+
public override string NamedPrefix => "@";
2224

23-
public override string NamedPrefix => "@";
25+
public override bool SupportsMultipleQueries => true;
2426

25-
public override bool SupportsMultipleQueries => true;
27+
public override bool SupportsMultipleOpenReaders => false;
2628

27-
public override bool SupportsMultipleOpenReaders => false;
29+
/// <summary>
30+
/// MySqlConnector prepares commands if <b>IgnorePrepare</b> is set to false in the connection string (default is
31+
/// true),
32+
/// otherwise calling <see cref="MySqlCommand.Prepare" /> is a no-op.
33+
/// </summary>
34+
protected override bool SupportsPreparingCommands => true;
2835

29-
/// <summary>
30-
/// MySqlConnector prepares commands if <b>IgnorePrepare</b> is set to false in the connection string (default is true),
31-
/// otherwise calling <see cref="MySqlCommand.Prepare"/> is a no-op.
32-
/// </summary>
33-
protected override bool SupportsPreparingCommands => true;
36+
// As of v5.7, lower dates may "work" but without guarantees.
37+
// https://dev.mysql.com/doc/refman/5.7/en/datetime.html
38+
/// <inheritdoc />
39+
public override DateTime MinDate => new(1000, 1, 1);
3440

35-
public override DbConnection CreateConnection() => new MySqlConnection();
41+
public System.Type BatcherFactoryClass => typeof(GenericBatchingBatcherFactory);
3642

37-
public override DbCommand CreateCommand() => new MySqlCommand();
43+
public override DbConnection CreateConnection() => new MySqlConnection();
3844

39-
public override IResultSetsCommand GetResultSetsCommand(ISessionImplementor session) => new BasicResultSetsCommand(session);
45+
public override DbCommand CreateCommand() => new MySqlCommand();
4046

41-
// As of v5.7, lower dates may "work" but without guarantees.
42-
// https://dev.mysql.com/doc/refman/5.7/en/datetime.html
43-
/// <inheritdoc />
44-
public override DateTime MinDate => new DateTime(1000, 1, 1);
45-
46-
public System.Type BatcherFactoryClass => typeof(GenericBatchingBatcherFactory);
47-
}
47+
public override IResultSetsCommand GetResultSetsCommand(ISessionImplementor session) => new BasicResultSetsCommand(session);
4848
}
Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,29 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>net461;netstandard2.0</TargetFrameworks>
5-
<SignAssembly>true</SignAssembly>
6-
<AssemblyOriginatorKeyFile>NHibernate.MySqlConnector.snk</AssemblyOriginatorKeyFile>
7-
<Authors>NHibernate community</Authors>
8-
<Company>NHibernate.info</Company>
9-
<Copyright>Licensed under LGPL.</Copyright>
10-
<PackageLicenseExpression>LGPL-2.1-only</PackageLicenseExpression>
11-
<PackageProjectUrl>http://nhibernate.info</PackageProjectUrl>
12-
<PackageTags>nhibernate; mysqlconnector; mysql; mariadb;</PackageTags>
13-
<Description>NHibernate driver for MySQL/MariaDB using MySqlConnector.</Description>
14-
<RepositoryUrl>https://github.com/nhibernate/NHibernate.MySqlConnector</RepositoryUrl>
15-
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
16-
<Product>NHibernate.Driver.MySqlConnector</Product>
17-
<PackageId>NHibernate.Driver.MySqlConnector</PackageId>
18-
<IncludeSymbols>true</IncludeSymbols>
19-
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
20-
<EmbedUntrackedSources>true</EmbedUntrackedSources>
4+
<TargetFrameworks>net461;netstandard2.0</TargetFrameworks>
5+
<SignAssembly>true</SignAssembly>
6+
<AssemblyOriginatorKeyFile>NHibernate.MySqlConnector.snk</AssemblyOriginatorKeyFile>
7+
<Authors>NHibernate community</Authors>
8+
<Company>NHibernate.info</Company>
9+
<Copyright>Licensed under LGPL.</Copyright>
10+
<PackageLicenseExpression>LGPL-2.1-only</PackageLicenseExpression>
11+
<PackageProjectUrl>http://nhibernate.info</PackageProjectUrl>
12+
<PackageTags>nhibernate; mysqlconnector; mysql; mariadb;</PackageTags>
13+
<Description>NHibernate driver for MySQL/MariaDB using MySqlConnector.</Description>
14+
<RepositoryUrl>https://github.com/nhibernate/NHibernate.MySqlConnector</RepositoryUrl>
15+
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
16+
<Product>NHibernate.Driver.MySqlConnector</Product>
17+
<PackageId>NHibernate.Driver.MySqlConnector</PackageId>
18+
<IncludeSymbols>true</IncludeSymbols>
19+
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
20+
<EmbedUntrackedSources>true</EmbedUntrackedSources>
21+
<LangVersion>10</LangVersion>
2122
</PropertyGroup>
2223

2324
<ItemGroup>
24-
<PackageReference Include="MySqlConnector" Version="1.0.0" />
25-
<PackageReference Include="NHibernate" Version="5.1.0" />
25+
<PackageReference Include="MySqlConnector" Version="1.0.0"/>
26+
<PackageReference Include="NHibernate" Version="5.1.0"/>
2627
</ItemGroup>
2728

2829
</Project>

0 commit comments

Comments
 (0)