Skip to content

Commit

Permalink
cleaup project files, updated devtools, added netcore target, updated…
Browse files Browse the repository at this point in the history
… version
  • Loading branch information
davidegironi committed Jan 15, 2025
1 parent f931416 commit e7e94e3
Show file tree
Hide file tree
Showing 26 changed files with 534 additions and 317 deletions.
8 changes: 4 additions & 4 deletions DGDataModel/DGDataModel.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
<RootNamespace>DG.Data.Model</RootNamespace>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<AssemblyName>DGDataModel</AssemblyName>
<Version>1.2.30113.11</Version>
<AssemblyVersion>1.2.30113.11</AssemblyVersion>
<FileVersion>1.2.30113.11</FileVersion>
<PackageVersion>1.2.30113.11</PackageVersion>
<Version>1.2.30115.12</Version>
<AssemblyVersion>1.2.30115.12</AssemblyVersion>
<FileVersion>1.2.30115.12</FileVersion>
<PackageVersion>1.2.30115.12</PackageVersion>
<Title>DGDataModel</Title>
<Description>Generic data access layer built on top of the .NET Entity Framework</Description>
<Product>DGDataModel</Product>
Expand Down
34 changes: 17 additions & 17 deletions DGDataModelSampleModel.Test/App.config
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 --></configSections>
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" />
<providers>
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
</providers>
</entityFramework>
<connectionStrings>
<add name="dgdatamodeltestContext"
connectionString=""
providerName="System.Data.EntityClient"/>
</connectionStrings>
<appSettings>
<add key="dgdatamodeltestConnectionString" value="" />
</appSettings>
<configSections>
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 --></configSections>
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" />
<providers>
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
</providers>
</entityFramework>
<connectionStrings>
<add name="dgdatamodelContext"
connectionString=""
providerName="System.Data.EntityClient"/>
</connectionStrings>
<appSettings>
<add key="dgdatamodelConnectionString" value="" />
</appSettings>
</configuration>
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
namespace DG.DataModelSample.Model.Test
{
[TestFixture]
public partial class DGDataModelTest
public partial class DGDataModelSampleModel
{
[Test]
public void DGPredicateBuilder1()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
<OutputType>Library</OutputType>
<RootNamespace>DG.DataModelSample.Model.Test</RootNamespace>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<Version>1.2.30113.11</Version>
<AssemblyVersion>1.2.30113.11</AssemblyVersion>
<FileVersion>1.2.30113.11</FileVersion>
<Version>1.2.30115.12</Version>
<AssemblyVersion>1.2.30115.12</AssemblyVersion>
<FileVersion>1.2.30115.12</FileVersion>
</PropertyGroup>
<ItemGroup>
<None Update="App.Debug.config">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,19 @@
namespace DG.DataModelSample.Model.Test
{
[TestFixture]
public partial class DGDataModelTest
public partial class DGDataModelSampleModel
{
DGDataModelSampleModel samplemodel = null;
Model.DGDataModelSampleModel samplemodel = null;

public DGDataModelTest()
public DGDataModelSampleModel()
{
#if !NETFRAMEWORK
File.Copy($"{System.Reflection.Assembly.GetExecutingAssembly().Location}.config", ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None).FilePath, true);
#endif

Directory.SetCurrentDirectory(TestContext.CurrentContext.TestDirectory);

samplemodel = new DGDataModelSampleModel();
samplemodel = new Model.DGDataModelSampleModel();

//load language from file
samplemodel.LanguageHelper.LoadFromFile(GenericDataModel.GenericDataModelLanguageHelper.DefaultLanguageFilename);
Expand All @@ -49,7 +49,7 @@ public DGDataModelTest()
public void ClearData()
{
SqlConnection sqlConnection = new SqlConnection();
sqlConnection.ConnectionString = ConfigurationManager.AppSettings["dgdatamodeltestConnectionString"];
sqlConnection.ConnectionString = ConfigurationManager.AppSettings["dgdatamodelConnectionString"];
sqlConnection.Open();

new SqlCommand(@"DELETE FROM footertextdesc", sqlConnection).ExecuteNonQuery();
Expand Down Expand Up @@ -82,7 +82,7 @@ public void TimeData()
AddTestData();

SqlConnection sqlConnection = new SqlConnection();
sqlConnection.ConnectionString = ConfigurationManager.AppSettings["dgdatamodeltestConnectionString"];
sqlConnection.ConnectionString = ConfigurationManager.AppSettings["dgdatamodelConnectionString"];
sqlConnection.Open();

List<blogs> listtest = new List<blogs>();
Expand Down Expand Up @@ -123,7 +123,7 @@ public void TimeData()
}

efStopWatch.Start();
using (var context = new dgdatamodeltestContext())
using (var context = new dgdatamodelContext())
{
listtest = context.blogs.ToList();
}
Expand Down Expand Up @@ -524,7 +524,7 @@ public void TestHelperConcurrency1()

//update post by third part
sqlConnection = new SqlConnection();
sqlConnection.ConnectionString = ConfigurationManager.AppSettings["dgdatamodeltestConnectionString"];
sqlConnection.ConnectionString = ConfigurationManager.AppSettings["dgdatamodelConnectionString"];
sqlConnection.Open();
new SqlCommand(@"UPDATE posts SET posts_text = 'test text 2' WHERE posts_id = " + _posts.posts_id, sqlConnection).ExecuteNonQuery();
sqlConnection.Close();
Expand All @@ -535,7 +535,7 @@ public void TestHelperConcurrency1()

//update post by third part (take it back to original values)
sqlConnection = new SqlConnection();
sqlConnection.ConnectionString = ConfigurationManager.AppSettings["dgdatamodeltestConnectionString"];
sqlConnection.ConnectionString = ConfigurationManager.AppSettings["dgdatamodelConnectionString"];
sqlConnection.Open();
new SqlCommand(@"UPDATE posts SET posts_text = 'test text 1' WHERE posts_id = " + _posts.posts_id, sqlConnection).ExecuteNonQuery();
sqlConnection.Close();
Expand All @@ -545,7 +545,7 @@ public void TestHelperConcurrency1()
[Test]
public void TestHelperGetDatabaseName1()
{
string expected = "tst_dgdatamodeltest";
string expected = "dev_dgdatamodel";
string actual = samplemodel.Blogs.Helper.GetDatabaseName();

Assert.That(expected, Is.EqualTo(actual));
Expand Down
6 changes: 0 additions & 6 deletions DGDataModelSampleModel.Test/packages.config

This file was deleted.

2 changes: 1 addition & 1 deletion DGDataModelSampleModel/DGDataModelSampleModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public class DGDataModelSampleModel : GenericDataModel
/// </summary>
public DGDataModelSampleModel()
{
Type contextType = typeof(dgdatamodeltestContext);
Type contextType = typeof(dgdatamodelContext);

object[] contextParameters = null;

Expand Down
6 changes: 3 additions & 3 deletions DGDataModelSampleModel/DGDataModelSampleModel.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
<OutputType>Library</OutputType>
<RootNamespace>DG.DataModelSample.Model</RootNamespace>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<Version>1.2.30113.11</Version>
<AssemblyVersion>1.2.30113.11</AssemblyVersion>
<FileVersion>1.2.30113.11</FileVersion>
<Version>1.2.30115.12</Version>
<AssemblyVersion>1.2.30115.12</AssemblyVersion>
<FileVersion>1.2.30115.12</FileVersion>
</PropertyGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net40'">
<PackageReference Include="EntityFramework" Version="6.0.0" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netcoreapp3.1;net5.0;net6.0;net7.0;net8.0</TargetFrameworks>
<Version>1.2.30113.11</Version>
<RootNamespace>DG.DataModelSample.Model</RootNamespace>
<UserSecretsId>e340026d-0f00-421a-b7da-06f74603b829</UserSecretsId>
<NoWarn>$(NoWarn);CS8981</NoWarn>
<RootNamespace>DG.DataModelSample.Model</RootNamespace>
<Version>1.2.30115.12</Version>
<AssemblyVersion>1.2.30115.12</AssemblyVersion>
<FileVersion>1.2.30115.12</FileVersion>
</PropertyGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp3.1'">
<PackageReference Include="System.Configuration.ConfigurationManager" Version="5.0.0" />
Expand Down
Loading

0 comments on commit e7e94e3

Please sign in to comment.