Skip to content

Commit acd1a26

Browse files
authored
Merge pull request #2 from MetallicBlueDev/next-version
Doc, sample, config
2 parents 0081a41 + 65f0b95 commit acd1a26

26 files changed

+2007
-47
lines changed

MetallicBlueDev.EntityGate/MetallicBlueDev.EntityGate.sln

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
1010
EndProject
1111
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MetallicBlueDev.EntityGate", "MetallicBlueDev.EntityGate\MetallicBlueDev.EntityGate.csproj", "{1898D29F-7FE8-4C29-A6FF-57860703D4D0}"
1212
EndProject
13+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MetallicBlueDev.Sample.EntityGate", "MetallicBlueDev.Sample.EntityGate\MetallicBlueDev.Sample.EntityGate.csproj", "{CD267A11-4D5F-4AA9-B411-29E630681909}"
14+
EndProject
15+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MetallicBlueDev.Sample.Data", "MetallicBlueDev.Sample.Data\MetallicBlueDev.Sample.Data.csproj", "{52F9655C-6895-4FBC-B3D2-F50EA9CC5356}"
16+
EndProject
1317
Global
1418
GlobalSection(SolutionConfigurationPlatforms) = preSolution
1519
Debug|Any CPU = Debug|Any CPU
@@ -20,6 +24,14 @@ Global
2024
{1898D29F-7FE8-4C29-A6FF-57860703D4D0}.Debug|Any CPU.Build.0 = Debug|Any CPU
2125
{1898D29F-7FE8-4C29-A6FF-57860703D4D0}.Release|Any CPU.ActiveCfg = Release|Any CPU
2226
{1898D29F-7FE8-4C29-A6FF-57860703D4D0}.Release|Any CPU.Build.0 = Release|Any CPU
27+
{CD267A11-4D5F-4AA9-B411-29E630681909}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
28+
{CD267A11-4D5F-4AA9-B411-29E630681909}.Debug|Any CPU.Build.0 = Debug|Any CPU
29+
{CD267A11-4D5F-4AA9-B411-29E630681909}.Release|Any CPU.ActiveCfg = Release|Any CPU
30+
{CD267A11-4D5F-4AA9-B411-29E630681909}.Release|Any CPU.Build.0 = Release|Any CPU
31+
{52F9655C-6895-4FBC-B3D2-F50EA9CC5356}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
32+
{52F9655C-6895-4FBC-B3D2-F50EA9CC5356}.Debug|Any CPU.Build.0 = Debug|Any CPU
33+
{52F9655C-6895-4FBC-B3D2-F50EA9CC5356}.Release|Any CPU.ActiveCfg = Release|Any CPU
34+
{52F9655C-6895-4FBC-B3D2-F50EA9CC5356}.Release|Any CPU.Build.0 = Release|Any CPU
2335
EndGlobalSection
2436
GlobalSection(SolutionProperties) = preSolution
2537
HideSolutionNode = FALSE

MetallicBlueDev.EntityGate/MetallicBlueDev.EntityGate/Configuration/ClientConfiguration.cs

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ public int Timeout
104104
///
105105
/// If the main entity implements the <see cref="InterfacedObject.IEntityObjectArchival"/> interface, the backup is automatically enabled.
106106
/// </summary>
107-
public bool AutomaticCheckOfOriginValues { get; set; }
107+
public bool AutomaticCheckOfOriginalValues { get; set; }
108108

109109
/// <summary>
110110
/// Log internal messages. Include messages from Entity Framework.
@@ -143,10 +143,7 @@ public void ChangeConnectionString(string connectionName)
143143

144144
if (currentConfig != null)
145145
{
146-
MaximumNumberOfAttempts = currentConfig.MaximumNumberOfAttempts;
147-
AttemptDelay = currentConfig.AttemptDelay;
148-
LazyLoading = currentConfig.LazyLoading;
149-
ConnectionString = EntityGateConfigLoader.GetConnectionString(currentConfig.ConnectionName);
146+
CopyConfiguration(currentConfig);
150147

151148
if (CanUseLogging)
152149
{
@@ -205,6 +202,21 @@ internal void ConfigurationUpdated()
205202
}
206203
}
207204

205+
/// <summary>
206+
/// Copy of the configuration.
207+
/// </summary>
208+
/// <param name="config"></param>
209+
private void CopyConfiguration(EntityGateConfig config)
210+
{
211+
ConnectionString = EntityGateConfigLoader.GetConnectionString(config.ConnectionName);
212+
213+
MaximumNumberOfAttempts = config.MaximumNumberOfAttempts;
214+
AttemptDelay = config.AttemptDelay;
215+
LazyLoading = config.LazyLoading;
216+
Timeout = config.Timeout;
217+
AutomaticCheckOfOriginalValues = config.AutomaticCheckOfOriginalValues;
218+
}
219+
208220
/// <summary>
209221
/// Indicates that the context is synchronized to this configuration.
210222
/// </summary>

MetallicBlueDev.EntityGate/MetallicBlueDev.EntityGate/Configuration/EntityGateConfig.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,6 @@ internal class EntityGateConfig
3434
/// <summary>
3535
/// Determines if the backup of the original values is performed automatically.
3636
/// </summary>
37-
internal bool AutomaticCheckOfOriginValues { get; set; } = true;
37+
internal bool AutomaticCheckOfOriginalValues { get; set; } = true;
3838
}
3939
}

MetallicBlueDev.EntityGate/MetallicBlueDev.EntityGate/Core/EntityGateCore.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1132,7 +1132,7 @@ private void FireAutoSaveOriginalValues()
11321132
/// </summary>
11331133
private void CheckEntityForAutoSaveOriginalValues()
11341134
{
1135-
if (Configuration.AutomaticCheckOfOriginValues)
1135+
if (Configuration.AutomaticCheckOfOriginalValues)
11361136
{
11371137
var oldState = Token.SaveOriginalValues;
11381138
var newState = entity.IsEntityArchival();

MetallicBlueDev.EntityGate/MetallicBlueDev.EntityGate/MetallicBlueDev.EntityGate.csproj

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,6 @@
8383
<Compile Include="Core\EntityGateTracking.cs" />
8484
<Compile Include="Core\EntityStateTracking.cs" />
8585
</ItemGroup>
86-
<ItemGroup>
87-
<None Include="App.configsample" />
88-
</ItemGroup>
8986
<ItemGroup>
9087
<PackageReference Include="EntityFramework">
9188
<Version>6.3.0</Version>

MetallicBlueDev.EntityGate/MetallicBlueDev.EntityGate/Properties/AssemblyInfo.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66
// set of attributes. Change these attribute values to modify the information
77
// associated with an assembly.
88
[assembly: AssemblyTitle("MetallicBlueDev.EntityGate")]
9-
[assembly: AssemblyDescription("")]
9+
[assembly: AssemblyDescription("EntityGate")]
1010
[assembly: AssemblyConfiguration("")]
11-
[assembly: AssemblyCompany("")]
11+
[assembly: AssemblyCompany("MetallicBlueDev")]
1212
[assembly: AssemblyProduct("MetallicBlueDev.EntityGate")]
13-
[assembly: AssemblyCopyright("Copyright © 2019")]
13+
[assembly: AssemblyCopyright("MetallicBlueDev")]
1414
[assembly: AssemblyTrademark("")]
1515
[assembly: AssemblyCulture("")]
1616

@@ -32,5 +32,5 @@
3232
// You can specify all the values or you can default the Build and Revision Numbers
3333
// by using the '*' as shown below:
3434
// [assembly: AssemblyVersion("1.0.*")]
35-
[assembly: AssemblyVersion("1.0.0.0")]
36-
[assembly: AssemblyFileVersion("1.0.0.0")]
35+
[assembly: AssemblyVersion("1.0.1.0")]
36+
[assembly: AssemblyFileVersion("1.0.1.0")]
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<configuration>
3+
<connectionStrings>
4+
<add name="SampleDataContainer" connectionString="metadata=res://*/SampleData.csdl|res://*/SampleData.ssdl|res://*/SampleData.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=(LocalDB)\MSSQLLocalDB;attachdbfilename=|DataDirectory|\SampleDbTest.mdf;integrated security=True;connect timeout=30;MultipleActiveResultSets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient" />
5+
</connectionStrings>
6+
</configuration>
Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
4+
<PropertyGroup>
5+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7+
<ProjectGuid>{52F9655C-6895-4FBC-B3D2-F50EA9CC5356}</ProjectGuid>
8+
<OutputType>Library</OutputType>
9+
<AppDesignerFolder>Properties</AppDesignerFolder>
10+
<RootNamespace>MetallicBlueDev.Sample.Data</RootNamespace>
11+
<AssemblyName>MetallicBlueDev.Sample.Data</AssemblyName>
12+
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
13+
<FileAlignment>512</FileAlignment>
14+
<Deterministic>true</Deterministic>
15+
</PropertyGroup>
16+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
17+
<DebugSymbols>true</DebugSymbols>
18+
<DebugType>full</DebugType>
19+
<Optimize>false</Optimize>
20+
<OutputPath>bin\Debug\</OutputPath>
21+
<DefineConstants>DEBUG;TRACE</DefineConstants>
22+
<ErrorReport>prompt</ErrorReport>
23+
<WarningLevel>4</WarningLevel>
24+
</PropertyGroup>
25+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
26+
<DebugType>pdbonly</DebugType>
27+
<Optimize>true</Optimize>
28+
<OutputPath>bin\Release\</OutputPath>
29+
<DefineConstants>TRACE</DefineConstants>
30+
<ErrorReport>prompt</ErrorReport>
31+
<WarningLevel>4</WarningLevel>
32+
</PropertyGroup>
33+
<ItemGroup>
34+
<Reference Include="System" />
35+
<Reference Include="System.Core" />
36+
<Reference Include="System.Runtime.Serialization" />
37+
<Reference Include="System.Security" />
38+
<Reference Include="System.Xml.Linq" />
39+
<Reference Include="System.Data.DataSetExtensions" />
40+
<Reference Include="Microsoft.CSharp" />
41+
<Reference Include="System.Data" />
42+
<Reference Include="System.Net.Http" />
43+
<Reference Include="System.Xml" />
44+
</ItemGroup>
45+
<ItemGroup>
46+
<Compile Include="OtherEntity.Interface.cs" />
47+
<Compile Include="SampleEntity1.Interface.cs" />
48+
<Compile Include="OtherEntity.cs">
49+
<DependentUpon>SampleData.tt</DependentUpon>
50+
</Compile>
51+
<Compile Include="Properties\AssemblyInfo.cs" />
52+
<Compile Include="SampleData.Context.cs">
53+
<AutoGen>True</AutoGen>
54+
<DesignTime>True</DesignTime>
55+
<DependentUpon>SampleData.Context.tt</DependentUpon>
56+
</Compile>
57+
<Compile Include="SampleData.cs">
58+
<AutoGen>True</AutoGen>
59+
<DesignTime>True</DesignTime>
60+
<DependentUpon>SampleData.tt</DependentUpon>
61+
</Compile>
62+
<Compile Include="SampleData.Designer.cs">
63+
<AutoGen>True</AutoGen>
64+
<DesignTime>True</DesignTime>
65+
<DependentUpon>SampleData.edmx</DependentUpon>
66+
</Compile>
67+
<Compile Include="SampleEntity1.cs">
68+
<DependentUpon>SampleData.tt</DependentUpon>
69+
</Compile>
70+
</ItemGroup>
71+
<ItemGroup>
72+
<EntityDeploy Include="SampleData.edmx">
73+
<Generator>EntityModelCodeGenerator</Generator>
74+
<LastGenOutput>SampleData.Designer.cs</LastGenOutput>
75+
</EntityDeploy>
76+
</ItemGroup>
77+
<ItemGroup>
78+
<None Include="App.Config" />
79+
<None Include="SampleData.edmx.diagram">
80+
<DependentUpon>SampleData.edmx</DependentUpon>
81+
</None>
82+
</ItemGroup>
83+
<ItemGroup>
84+
<Content Include="SampleData.Context.tt">
85+
<Generator>TextTemplatingFileGenerator</Generator>
86+
<LastGenOutput>SampleData.Context.cs</LastGenOutput>
87+
<DependentUpon>SampleData.edmx</DependentUpon>
88+
</Content>
89+
<Content Include="SampleData.edmx.sql" />
90+
<Content Include="SampleData.tt">
91+
<Generator>TextTemplatingFileGenerator</Generator>
92+
<LastGenOutput>SampleData.cs</LastGenOutput>
93+
<DependentUpon>SampleData.edmx</DependentUpon>
94+
</Content>
95+
</ItemGroup>
96+
<ItemGroup>
97+
<Service Include="{508349B6-6B84-4DF5-91F0-309BEEBAD82D}" />
98+
</ItemGroup>
99+
<ItemGroup>
100+
<PackageReference Include="EntityFramework">
101+
<Version>6.3.0</Version>
102+
</PackageReference>
103+
</ItemGroup>
104+
<ItemGroup>
105+
<ProjectReference Include="..\MetallicBlueDev.EntityGate\MetallicBlueDev.EntityGate.csproj">
106+
<Project>{1898D29F-7FE8-4C29-A6FF-57860703D4D0}</Project>
107+
<Name>MetallicBlueDev.EntityGate</Name>
108+
</ProjectReference>
109+
</ItemGroup>
110+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
111+
</Project>
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
using MetallicBlueDev.EntityGate.InterfacedObject;
2+
3+
namespace MetallicBlueDev.Sample.Data
4+
{
5+
public partial class OtherEntity : IEntityObjectIdentifier
6+
{
7+
/// <summary>
8+
/// Mandatory implementation of the <see cref="IEntityObjectIdentifier"/> interface.
9+
/// </summary>
10+
public object Identifier => Id;
11+
}
12+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
//------------------------------------------------------------------------------
2+
// <auto-generated>
3+
// This code was generated from a template.
4+
//
5+
// Manual changes to this file may cause unexpected behavior in your application.
6+
// Manual changes to this file will be overwritten if the code is regenerated.
7+
// </auto-generated>
8+
//------------------------------------------------------------------------------
9+
10+
namespace MetallicBlueDev.Sample.Data
11+
{
12+
public partial class OtherEntity
13+
{
14+
public int Id { get; set; }
15+
public string Description { get; set; }
16+
}
17+
}

0 commit comments

Comments
 (0)