Skip to content

Commit d1f05ca

Browse files
authored
Add extra notes to creating an application service
1 parent ec140bf commit d1f05ca

File tree

1 file changed

+27
-8
lines changed

1 file changed

+27
-8
lines changed

README.md

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
# ASP\.NETBoilerplate Tutorial
2-
* [How to Initialize and Run a Clean Template](how-to-initialize-and-run-a-clean-template)
3-
* [How to Create an Entity]()
4-
* [How to Update the Database]()
5-
* [How to Create an Application Service]()
1+
# ASP\.NET Boilerplate Tutorials
2+
* [How to Initialize and Run a Clean Template](#how-to-initialize-and-run-a-clean-template)
3+
* [How to Create an Entity](#how-to-create-an-entity)
4+
* [How to Update the Database](#how-to-update-the-database)
5+
* [How to Create an Application Service](#how-create-an-application-service)
66

7-
## How to Initialize and Run a Clean Template
7+
# How to Initialize and Run a Clean Template
88
1. [Download ASP\.NET Boilerplate template](#1-download-template)
99
2. [Fix EFCore Versions & Add DotNet Tooling](#2-fix-efcore-versions--add-dotnet-tooling)
1010
3. [Change Database Connection String](#3-change-database-connection-string)
@@ -25,7 +25,7 @@
2525
\.NET Core can be thought of as a cross-platform version of the \.NET Framework supporting Windows, macOS and Linux, and can be used in device, cloud, and embedded/IoT scenarios. It implements the \.NET Standard Library specification.
2626

2727
#### ASP\.NET Core
28-
ASP\.NET Core is no longer based on System\.Web\.dll
28+
ASP\.NET Core is no longer based on __System.Web.dll__
2929
ASP\.NET Core apps can run on \.NET Core or on the full \.NET Framework
3030

3131
#### Entity Framework Core
@@ -56,7 +56,7 @@ Note there is an extra reference added to enable using the Entity Framework Core
5656
```
5757

5858
## 3. Change Database Connection String
59-
Edit _appsettings.json_ in __/aspnet-core/src/project.Web.Host__ to change the connection string to use __localdb__.
59+
Edit _appsettings.json_ in __.Web.Host__ to change the connection string to use __localdb__.
6060
```javascript
6161
"ConnectionStrings": {
6262
"Default": "Data Source=(localdb)\\MSSQLLocalDB; Initial Catalog=PeopleProject;"
@@ -107,3 +107,22 @@ http://localhost:4200
107107
# Congratulations! We're halfway there!
108108
> At this point we've downloaded, initialized and run the bare template. Well done on making it this far.
109109
> Now we can start to create our own customizations on top of the ASP\.NET Boilerplate platform.
110+
111+
# How to Create an Entity
112+
TODO
113+
# How to Update the Database
114+
TODO
115+
# How to Create an Application Service
116+
* [Unit of Work](#unit-of-work)
117+
* [Hide from Controller](#hide-from-controller)
118+
119+
### Unit of Work
120+
By default functions in an application service are transactional, meaning if there's an exception in the function then all repository functions are rolled back. It can be turned off by adding the ```UnitOfWork``` attribute to your function and setting ```IsDisabled``` to ```true```.
121+
```csharp
122+
[UnitOfWork(IsDisabled: true)]
123+
```
124+
### Hide from Controller
125+
The __.Web.Core__ module is configured to generate WebAPI controllers for any application services found in __.Application__. To prevent a specific application service or function in a service from being generated, add the ```RemoteService``` attibute and set ```isEnabled``` to ```false```.
126+
```csharp
127+
[RemoteService(isEnabled: false)]
128+
```

0 commit comments

Comments
 (0)