Skip to content

Commit

Permalink
Support C# 10
Browse files Browse the repository at this point in the history
  • Loading branch information
EUROPE\PLTHLOU committed May 19, 2022
1 parent 5ca6cb9 commit bc4e25c
Show file tree
Hide file tree
Showing 28 changed files with 256 additions and 153 deletions.
2 changes: 1 addition & 1 deletion Dapper.Crud.Tests/Dapper.Crud.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Dapper.Crud.Tests</RootNamespace>
<AssemblyName>Dapper.Crud.Tests</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">15.0</VisualStudioVersion>
Expand Down
20 changes: 10 additions & 10 deletions Dapper.Crud.Tests/TestMethod.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public void GenerateInsert()
// Arrange
var objUser = new User();
IList<PropertyInfo> props = new List<PropertyInfo>(objUser.GetType().GetProperties());
var content = DapperGenerator.Insert("User", props, false, false, false, false, false);
var content = DapperGenerator.Insert("User", props, false, false, false, false, false, false);

// Act
var ret = MethodGenerator.GenerateInsert(content, model, false, false, false);
Expand All @@ -32,7 +32,7 @@ public void GenerateInsertAsync()
// Arrange
var objUser = new User();
IList<PropertyInfo> props = new List<PropertyInfo>(objUser.GetType().GetProperties());
var content = DapperGenerator.Insert("User", props, false, false, false, true, false);
var content = DapperGenerator.Insert("User", props, false, false, false, true, false, false);

// Act
var ret = MethodGenerator.GenerateInsert(content, model, false, true, false);
Expand All @@ -48,7 +48,7 @@ public void GenerateReturnIdInsert()
// Arrange
var objUser = new User();
IList<PropertyInfo> props = new List<PropertyInfo>(objUser.GetType().GetProperties());
var content = DapperGenerator.Insert("User", props, false, false, false, false, true);
var content = DapperGenerator.Insert("User", props, false, false, false, false, true, false);

// Act
var ret = MethodGenerator.GenerateInsert(content, model, false, false, true);
Expand All @@ -64,7 +64,7 @@ public void GenerateReturnIdInsertAsync()
// Arrange
var objUser = new User();
IList<PropertyInfo> props = new List<PropertyInfo>(objUser.GetType().GetProperties());
var content = DapperGenerator.Insert("User", props, false, false, false, true, true);
var content = DapperGenerator.Insert("User", props, false, false, false, true, true, false);

// Act
var ret = MethodGenerator.GenerateInsert(content, model, false, true, true);
Expand All @@ -80,7 +80,7 @@ public void GenerateSelect()
// Arrange
var objUser = new User();
IList<PropertyInfo> props = new List<PropertyInfo>(objUser.GetType().GetProperties());
var content = DapperGenerator.Select("User", props, false, false, false);
var content = DapperGenerator.Select("User", props, false, false, false, false);

// Act
var ret = MethodGenerator.GenerateSelect(content, model, false, false);
Expand All @@ -96,7 +96,7 @@ public void GenerateSelectAsync()
// Arrange
var objUser = new User();
IList<PropertyInfo> props = new List<PropertyInfo>(objUser.GetType().GetProperties());
var content = DapperGenerator.Select("User", props, false, false, true);
var content = DapperGenerator.Select("User", props, false, false, true, false);

// Act
var ret = MethodGenerator.GenerateSelect(content, model, false, true);
Expand All @@ -112,7 +112,7 @@ public void GenerateUpdate()
// Arrange
var objUser = new User();
IList<PropertyInfo> props = new List<PropertyInfo>(objUser.GetType().GetProperties());
var content = DapperGenerator.Update("User", props, false, false, false, false);
var content = DapperGenerator.Update("User", props, false, false, false, false, false);

// Act
var ret = MethodGenerator.GenerateUpdate(content, model, false, false);
Expand All @@ -128,7 +128,7 @@ public void GenerateUpdateAsync()
// Arrange
var objUser = new User();
IList<PropertyInfo> props = new List<PropertyInfo>(objUser.GetType().GetProperties());
var content = DapperGenerator.Update("User", props, false, false, false, true);
var content = DapperGenerator.Update("User", props, false, false, false, true, false);

// Act
var ret = MethodGenerator.GenerateUpdate(content, model, false, true);
Expand All @@ -144,7 +144,7 @@ public void GenerateDelete()
// Arrange
var objUser = new User();
IList<PropertyInfo> props = new List<PropertyInfo>(objUser.GetType().GetProperties());
var content = DapperGenerator.Delete("User", props, false, false, false);
var content = DapperGenerator.Delete("User", props, false, false, false, false);

// Act
var ret = MethodGenerator.GenerateDelete(content, model, false, false);
Expand All @@ -160,7 +160,7 @@ public void GenerateDeleteAsync()
// Arrange
var objUser = new User();
IList<PropertyInfo> props = new List<PropertyInfo>(objUser.GetType().GetProperties());
var content = DapperGenerator.Delete("User", props, false, false, true);
var content = DapperGenerator.Delete("User", props, false, false, true, false);

// Act
var ret = MethodGenerator.GenerateDelete(content, model, false, true);
Expand Down
8 changes: 4 additions & 4 deletions Dapper.Crud.VSExtension/Dapper.Crud.VSExtension.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Dapper.Crud.VSExtension</RootNamespace>
<AssemblyName>Dapper.Crud.VSExtension</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<GeneratePkgDefFile>true</GeneratePkgDefFile>
<IncludeAssemblyInVSIXContainer>true</IncludeAssemblyInVSIXContainer>
<IncludeDebugSymbolsInVSIXContainer>true</IncludeDebugSymbolsInVSIXContainer>
Expand Down Expand Up @@ -338,15 +338,15 @@
<Version>2.2.0</Version>
</PackageReference>
<PackageReference Include="Microsoft.CodeDom.Providers.DotNetCompilerPlatform">
<Version>3.6.0</Version>
<Version>4.1.0-preview1</Version>
</PackageReference>
<PackageReference Include="Microsoft.Net.Compilers">
<Version>3.8.0</Version>
<Version>4.2.0</Version>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.Net.Compilers.Toolset">
<Version>3.8.0</Version>
<Version>4.2.0</Version>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
Expand Down
2 changes: 1 addition & 1 deletion Dapper.Crud.VSExtension/Helpers/AssemblyHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ private static Assembly BuildAssembly(string code)
{
GenerateExecutable = false,
GenerateInMemory = true,
CompilerOptions = "/unsafe /optimize /langversion:8.0"
CompilerOptions = "/unsafe /optimize /langversion:10.0"
};

var assemblies = AppDomain.CurrentDomain
Expand Down
2 changes: 1 addition & 1 deletion Dapper.Crud.VSExtension/VSPackage.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

38 changes: 24 additions & 14 deletions Dapper.Crud.VSExtension/app.config
Original file line number Diff line number Diff line change
@@ -1,39 +1,49 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<appSettings>
<add key="aspnet:RoslynCompilerLocation" value="roslyn"/>
<add key="ClientSettingsProvider.ServiceUri" value=""/>
<add key="aspnet:RoslynCompilerLocation" value="roslyn" />
<add key="ClientSettingsProvider.ServiceUri" value="" />
</appSettings>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Microsoft.VisualStudio.Threading" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-15.0.0.0" newVersion="15.0.0.0"/>
<assemblyIdentity name="Microsoft.VisualStudio.Threading" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-15.0.0.0" newVersion="15.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.VisualStudio.Validation" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-15.0.0.0" newVersion="15.0.0.0"/>
<assemblyIdentity name="Microsoft.VisualStudio.Validation" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-15.0.0.0" newVersion="15.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.VisualStudio.Utilities" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-15.0.0.0" newVersion="15.0.0.0"/>
<assemblyIdentity name="Microsoft.VisualStudio.Utilities" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-15.0.0.0" newVersion="15.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.VisualStudio.CoreUtility" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-15.0.0.0" newVersion="15.0.0.0"/>
<assemblyIdentity name="Microsoft.VisualStudio.CoreUtility" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-15.0.0.0" newVersion="15.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
<system.web>
<membership defaultProvider="ClientAuthenticationMembershipProvider">
<providers>
<add name="ClientAuthenticationMembershipProvider" type="System.Web.ClientServices.Providers.ClientFormsAuthenticationMembershipProvider, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri=""/>
<add name="ClientAuthenticationMembershipProvider" type="System.Web.ClientServices.Providers.ClientFormsAuthenticationMembershipProvider, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri="" />
</providers>
</membership>
<roleManager defaultProvider="ClientRoleProvider" enabled="true">
<providers>
<add name="ClientRoleProvider" type="System.Web.ClientServices.Providers.ClientRoleProvider, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri="" cacheTimeout="86400"/>
<add name="ClientRoleProvider" type="System.Web.ClientServices.Providers.ClientRoleProvider, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri="" cacheTimeout="86400" />
</providers>
</roleManager>
</system.web>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2"/></startup></configuration>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" /></startup> <system.codedom>
<compilers>
<compiler language="c#;cs;csharp" extension=".cs" warningLevel="4" compilerOptions="/langversion:default /nowarn:1659;1699;1701" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
<providerOption name="UseAspNetSettings" value="false" />
</compiler>
<compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" warningLevel="4" compilerOptions="/langversion:default /nowarn:41008 /optionInfer+" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.VBCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
<providerOption name="UseAspNetSettings" value="false" />
</compiler>
</compilers>
</system.codedom>
</configuration>
Loading

0 comments on commit bc4e25c

Please sign in to comment.