Skip to content

Commit ae99c7f

Browse files
committed
Merge branch 'dev/AppInfra' into 'master'
2 parents 4a05080 + 33ed384 commit ae99c7f

7 files changed

Lines changed: 15 additions & 12 deletions

File tree

AppInfraDemo/.Exercises/PointsOfAttention.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
code[class*=language-],pre[class*=language-]{color:#000;background:0 0;text-shadow:0 1px #fff;font-family:Consolas,Monaco,'Andale Mono','Ubuntu Mono',monospace;font-size:1em;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none}code[class*=language-] ::-moz-selection,code[class*=language-]::-moz-selection,pre[class*=language-] ::-moz-selection,pre[class*=language-]::-moz-selection{text-shadow:none;background:#b3d4fc}code[class*=language-] ::selection,code[class*=language-]::selection,pre[class*=language-] ::selection,pre[class*=language-]::selection{text-shadow:none;background:#b3d4fc}@media print{code[class*=language-],pre[class*=language-]{text-shadow:none}}pre[class*=language-]{padding:1em;margin:.5em 0;overflow:auto}:not(pre)>code[class*=language-],pre[class*=language-]{background:#f5f2f0}:not(pre)>code[class*=language-]{padding:.1em;border-radius:.3em;white-space:normal}.token.cdata,.token.comment,.token.doctype,.token.prolog{color:#708090}.token.punctuation{color:#999}.token.namespace{opacity:.7}.token.boolean,.token.constant,.token.deleted,.token.number,.token.property,.token.symbol,.token.tag{color:#905}.token.attr-name,.token.builtin,.token.char,.token.inserted,.token.selector,.token.string{color:#690}.language-css .token.string,.style .token.string,.token.entity,.token.operator,.token.url{color:#9a6e3a;background:hsla(0,0%,100%,.5)}.token.atrule,.token.attr-value,.token.keyword{color:#07a}.token.class-name,.token.function{color:#dd4a68}.token.important,.token.regex,.token.variable{color:#e90}.token.bold,.token.important{font-weight:700}.token.italic{font-style:italic}.token.entity{cursor:help}
2727
</style>
2828
<title>Points of Attention</title>
29+
<link rel="icon" href="https://oncodedesign.com/content/images/size/w256h256/2022/06/favicon.png" type="image/png">
2930
<meta http-equiv="cache-control" content="no-cache">
3031
</head>
3132
<body>

AppInfraDemo/.Exercises/readme.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
code[class*=language-],pre[class*=language-]{color:#000;background:0 0;text-shadow:0 1px #fff;font-family:Consolas,Monaco,'Andale Mono','Ubuntu Mono',monospace;font-size:1em;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none}code[class*=language-] ::-moz-selection,code[class*=language-]::-moz-selection,pre[class*=language-] ::-moz-selection,pre[class*=language-]::-moz-selection{text-shadow:none;background:#b3d4fc}code[class*=language-] ::selection,code[class*=language-]::selection,pre[class*=language-] ::selection,pre[class*=language-]::selection{text-shadow:none;background:#b3d4fc}@media print{code[class*=language-],pre[class*=language-]{text-shadow:none}}pre[class*=language-]{padding:1em;margin:.5em 0;overflow:auto}:not(pre)>code[class*=language-],pre[class*=language-]{background:#f5f2f0}:not(pre)>code[class*=language-]{padding:.1em;border-radius:.3em;white-space:normal}.token.cdata,.token.comment,.token.doctype,.token.prolog{color:#708090}.token.punctuation{color:#999}.token.namespace{opacity:.7}.token.boolean,.token.constant,.token.deleted,.token.number,.token.property,.token.symbol,.token.tag{color:#905}.token.attr-name,.token.builtin,.token.char,.token.inserted,.token.selector,.token.string{color:#690}.language-css .token.string,.style .token.string,.token.entity,.token.operator,.token.url{color:#9a6e3a;background:hsla(0,0%,100%,.5)}.token.atrule,.token.attr-value,.token.keyword{color:#07a}.token.class-name,.token.function{color:#dd4a68}.token.important,.token.regex,.token.variable{color:#e90}.token.bold,.token.important{font-weight:700}.token.italic{font-style:italic}.token.entity{cursor:help}
2727
</style>
2828
<title>Exercises</title>
29+
<link rel="icon" href="https://oncodedesign.com/content/images/size/w256h256/2022/06/favicon.png" type="image/png">
2930
<meta http-equiv="cache-control" content="no-cache">
3031
</head>
3132
<body>
@@ -145,7 +146,7 @@ <h2 id="dataaccess.entityinterceptors"><a id="pragma-line-135"></a>5. DataAccess
145146
<p id="pragma-line-137">!Objective: Understand and use EntityInterceptors</p>
146147
</blockquote>
147148
<p id="pragma-line-139">Use <code>EntityInterceptors</code> and <code>INotificationService</code> to implement:</p>
148-
<h3 id="implement-a-istatechangesubscribersalesorder-that-shows-on-the-console-when-a-salesorder-is-created-deleted-or-changed"><a id="pragma-line-141"></a>5.1. Implement a <code>IStateChangeSubscriber&lt;SalesOrder&gt;</code> that shows on the console when a <code>SalesOrder</code> is created, deleted or changed</h3>
149+
<h3 id="implement-a-istatechangesubscribersalesorderheader-that-shows-on-the-console-when-a-salesorderheader-is-created-deleted-or-changed"><a id="pragma-line-141"></a>5.1. Implement a <code>IStateChangeSubscriber&lt;SalesOrderHeader&gt;</code> that shows on the console when a <code>SalesOrderHeader</code> is created, deleted or changed</h3>
149150
<p id="pragma-line-143"><em>Hint:</em> This should be part of the Sales Module</p>
150151
<h3 id="implement-a-default-istatechangesubscribert-that-writes-in-a-text-file-when-any-dto-is-created-deleted-or-changed"><a id="pragma-line-145"></a>5.2 Implement a default <code>IStateChangeSubscriber&lt;T&gt;</code> that writes in a text file when any DTO is created, deleted or changed</h3>
151152
<p id="pragma-line-147"><em>Hint:</em> This should be part of the Notifications Module</p>
@@ -159,7 +160,7 @@ <h2 id="add-entity-auditing"><a id="pragma-line-153"></a>6. Add Entity Auditing<
159160
</blockquote>
160161
<h3 id="we-want-to-consistently-set-the-modifieddate-for-all-entities-that-have-this-column"><a id="pragma-line-157"></a>6.1. We want to consistently set the <code>ModifiedDate</code> for all entities that have this column</h3>
161162
<ul id="pragma-line-159">
162-
<li id="pragma-line-159">Now when we modify the order in exercise 4.3 or we add persons in exercise 5 the <code>ModifiedDate</code> is not set.</li>
163+
<li id="pragma-line-159">Now when we modify the order in exercise 4.3 or we add persons in exercise 8 the <code>ModifiedDate</code> is not set.</li>
163164
<li id="pragma-line-160">One way would be to go in all use cases where these entities are modified / created and set the <code>ModifiedDate</code> as well. This would be cumbersome and error prone</li>
164165
<li id="pragma-line-161">We should leverage the advantage of the encapsulated Data Access and extend the infrastructure, with an interceptor that does this for all entities.</li>
165166
</ul>

AppInfraDemo/.Exercises/readme.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ See the `SalesOrderHeaderStatusValues` class for the values of the `SalesOrderHe
139139
140140
Use `EntityInterceptors` and `INotificationService` to implement:
141141

142-
### 5.1. Implement a `IStateChangeSubscriber<SalesOrder>` that shows on the console when a `SalesOrder` is created, deleted or changed
142+
### 5.1. Implement a `IStateChangeSubscriber<SalesOrderHeader>` that shows on the console when a `SalesOrderHeader` is created, deleted or changed
143143

144144
*Hint:* This should be part of the Sales Module
145145

@@ -157,7 +157,7 @@ Use `EntityInterceptors` and `INotificationService` to implement:
157157
158158
### 6.1. We want to consistently set the `ModifiedDate` for all entities that have this column
159159

160-
- Now when we modify the order in exercise 4.3 or we add persons in exercise 5 the `ModifiedDate` is not set.
160+
- Now when we modify the order in exercise 4.3 or we add persons in exercise 8 the `ModifiedDate` is not set.
161161
- One way would be to go in all use cases where these entities are modified / created and set the `ModifiedDate` as well. This would be cumbersome and error prone
162162
- We should leverage the advantage of the encapsulated Data Access and extend the infrastructure, with an interceptor that does this for all entities.
163163

AppInfraDemo/DemoApplication.sln

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,18 +64,18 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".Exercises", ".Exercises",
6464
.Exercises\readme.md = .Exercises\readme.md
6565
EndProjectSection
6666
EndProject
67-
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".App_Data", ".App_Data", "{E42085D5-D451-49ED-89A7-962B5FE83C3D}"
68-
ProjectSection(SolutionItems) = preProject
69-
.App_Data\readme.md = .App_Data\readme.md
70-
EndProjectSection
71-
EndProject
7267
Project("{F088123C-0E9E-452A-89E6-6BA2F21D5CAC}") = "DependencyValidation", "Infrastructure\DependencyValidation\DependencyValidation.modelproj", "{9D8284B2-4F4E-40F7-B194-3F16F4E1E51B}"
7368
EndProject
7469
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{4A532F73-79FC-431C-B849-02EAF64507E2}"
7570
ProjectSection(SolutionItems) = preProject
7671
.editorconfig = .editorconfig
7772
EndProjectSection
7873
EndProject
74+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "_App_Data", "_App_Data", "{D12E3252-BC08-4F07-AB99-BF6A62D5409B}"
75+
ProjectSection(SolutionItems) = preProject
76+
_App_Data\readme.md = _App_Data\readme.md
77+
EndProjectSection
78+
EndProject
7979
Global
8080
GlobalSection(SolutionConfigurationPlatforms) = preSolution
8181
Debug|Any CPU = Debug|Any CPU

AppInfraDemo/UI/ConsoleApplication/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ private static IEnumerable<Assembly> GetApplicationAssemblies()
6464
private static void SetupDataDirectory()
6565
{
6666
string baseDirectory = AppDomain.CurrentDomain.BaseDirectory;
67-
AppDomain.CurrentDomain.SetData("DataDirectory", Path.GetFullPath(Path.Combine(baseDirectory, @"..\..\.App_Data")));
67+
AppDomain.CurrentDomain.SetData("DataDirectory", Path.GetFullPath(Path.Combine(baseDirectory, @"..\..\App_Data")));
6868
}
6969
}
7070
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
code[class*=language-],pre[class*=language-]{color:#000;background:0 0;text-shadow:0 1px #fff;font-family:Consolas,Monaco,'Andale Mono','Ubuntu Mono',monospace;font-size:1em;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none}code[class*=language-] ::-moz-selection,code[class*=language-]::-moz-selection,pre[class*=language-] ::-moz-selection,pre[class*=language-]::-moz-selection{text-shadow:none;background:#b3d4fc}code[class*=language-] ::selection,code[class*=language-]::selection,pre[class*=language-] ::selection,pre[class*=language-]::selection{text-shadow:none;background:#b3d4fc}@media print{code[class*=language-],pre[class*=language-]{text-shadow:none}}pre[class*=language-]{padding:1em;margin:.5em 0;overflow:auto}:not(pre)>code[class*=language-],pre[class*=language-]{background:#f5f2f0}:not(pre)>code[class*=language-]{padding:.1em;border-radius:.3em;white-space:normal}.token.cdata,.token.comment,.token.doctype,.token.prolog{color:#708090}.token.punctuation{color:#999}.token.namespace{opacity:.7}.token.boolean,.token.constant,.token.deleted,.token.number,.token.property,.token.symbol,.token.tag{color:#905}.token.attr-name,.token.builtin,.token.char,.token.inserted,.token.selector,.token.string{color:#690}.language-css .token.string,.style .token.string,.token.entity,.token.operator,.token.url{color:#9a6e3a;background:hsla(0,0%,100%,.5)}.token.atrule,.token.attr-value,.token.keyword{color:#07a}.token.class-name,.token.function{color:#dd4a68}.token.important,.token.regex,.token.variable{color:#e90}.token.bold,.token.important{font-weight:700}.token.italic{font-style:italic}.token.entity{cursor:help}
2727
</style>
2828
<title>App_Data</title>
29+
<link rel="icon" href="https://oncodedesign.com/content/images/size/w256h256/2022/06/favicon.png" type="image/png">
2930
<meta http-equiv="cache-control" content="no-cache">
3031
</head>
3132
<body>
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
Use this folder when you want to use the AdventureWorks2012 database from the local SQL Express.
22
-----------------
33

4-
The `AppInfraDemo\.App_Data` folder should contain the `AdventureWorks2012.mdf` in order to be attached to the local database on the application start.
4+
The `AppInfraDemo\_App_Data` folder should contain the `AdventureWorks2012.mdf` in order to be attached to the local database on the application start.
55

66
To configure this follow these steps:
77
1. Download the `AdventureWorks2012.mdf` from [https://1drv.ms/u/s!AttpJoJRCtSQiiG8WJT8t3C4y450](https://1drv.ms/u/s!AttpJoJRCtSQiiG8WJT8t3C4y450)
8-
2. Copy it to `AppInfraDemo\.App_Data` folder
8+
2. Copy it to `AppInfraDemo\_App_Data` folder
99
3. Make sure that your host app sets the |DataDirectory| on the AppDomain
1010
- see `AppInfraDemo\UI\ConsoleApplication\Program.SetupDataDirectory()`
1111
4. Set the connection string that uses `AttachDbFilename` setting

0 commit comments

Comments
 (0)