forked from JonPSmith/SampleMvcWebApp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCodeView.cshtml
More file actions
38 lines (35 loc) · 2.32 KB
/
Copy pathCodeView.cshtml
File metadata and controls
38 lines (35 loc) · 2.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
@{
ViewBag.Title = "CodeView";
}
<h2>Introduction to GenericServices</h2>
<p>
GenericServices is a .NET class library which helps a developer build a
<a href="http://martinfowler.com/eaaCatalog/serviceLayer.html" target="_blank">service layer</a>,
i.e. a layer that acts as a facard/adapter between your business/data service layers and your User Interface or HTTP service.
It does this by providing standard database CRUD (Create, Read, Update and Delete) methods and a standard way of
calling business methods, each with clear extension points.
The aim is to cut out the standard boiler-plate code so the user only has to write the data or business specific code.
</p>
<p>
Some ASP.NET MVC specific features which build on the GenericService are also included.
For instance the best way to call GenericService commands in a Controller and handling long-running tasks.
</p>
<hr />
<h3>Summary of the features covered by this example web site</h3>
<h4>1. Simple, but robust database services</h4>
<p>
Database accesses are normally a big part of enterprise systems build with APS.NET MVC. However, my experience is that creating these services
in a robust and comprehensive form can lead to a lot of repetative code that does the same thing, but for different data.
The aim of the GenericFramework framework is to handles all of the standard cases, and include extension points for when special handling is required.
Examples of there use on this web site are:
</p>
<ul>
<li>See normal, synchronous access using a <abbr title="Data Transfer Object">DTO</abbr> for shaping in the @Html.ActionLink("Posts", "Index", "Posts") Controller</li>
<li>See new EF6 async access using a <abbr title="Data Transfer Object">DTO</abbr> for shaping in the @Html.ActionLink("PostsAsync", "Index", "PostsAsync") Controller</li>
<li>See normal, synchronous access directly via data class in the @Html.ActionLink("Tags", "Index", "Tags") Controller</li>
<li>See new EF6 async access directly via data class in the @Html.ActionLink("TagsAsync", "Index", "TagsAsync") Controller</li>
</ul>
<p>
Note that the SampleMvcWebApp uses <a href="https://github.com/autofac/Autofac/wiki/Getting-Started" target="_blank">AutoFac</a>
dependency injection framework to insert calls to the various GenericServices services.
</p>