EF (Entity framework) facilitates quick and easy way of generating the database using the domain entities.
Having creating the initial database. start focusing on the data layer for the operator API.
Focus is to create a Generic Repository pattern to access underlying data storage.
Read on following articles on Repository pattern.
Introduction from Martin Fowler
The Repository Pattern in Msdn
My generic repository implementation
Figure 1 shows the interface.
Figure 1
Figure 2 shows the implementation of the above interface with EF DataContext.
Figure 2
Using the Generic repository. I was able to reduce the needing of individual repositories for entities.
Having creating the initial database. start focusing on the data layer for the operator API.
Focus is to create a Generic Repository pattern to access underlying data storage.
Read on following articles on Repository pattern.
Introduction from Martin Fowler
The Repository Pattern in Msdn
My generic repository implementation
Figure 1 shows the interface.
Figure 1
Figure 2 shows the implementation of the above interface with EF DataContext.
Figure 2
Using the Generic repository. I was able to reduce the needing of individual repositories for entities.


No comments:
Post a Comment