Page 1 of 1

Code sample for EF core model / repository and unit of work

Posted: Thu 10 Aug 2017 09:16
by vinz
Hello,
i have generate an EF core model of my database first and i have add the "repository and unit of work" Template. The wizard have done the job and now i tried to understand how to use the repository class in my project. Is there a place with project sample code that explain the use of the repository partern :
- How to use the unit of work ?
- How and where define the dbcontext in my project (web api) with dependance injection ?
- What is the EntityFrameworkUnitOfWorkFactory ?

In conclusion, is there some code help for the "repository and unit of work" ?

Thank's

Re: Code sample for EF core model / repository and unit of work

Posted: Fri 11 Aug 2017 10:57
by Shalex
There is no Devart sample code for the "Repository And Unit of Work" template. We recommend you to follow standard tutorials and use the code generated by templates shipped with Entity Developer (instead of creating the code manually). For example: https://docs.microsoft.com/en-us/aspnet ... st-web-api.

JIC:
* manage model templates via the Templates node in Model Explorer
* the Devart templates include the *Output properties to specify a folder for the generated code