Created
June 15, 2017 15:32
-
-
Save scionwest/bad9e70a16c20a40fe33499bfc1ca7d5 to your computer and use it in GitHub Desktop.
Unit of WOrk
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Create repositories as part of a unit of work. | |
using (IUnitOfWork unitOfWork = this.UnitOfWorkFactory.CreateUnitOfWork()) | |
{ | |
IMovieHeaderRepository repo2 = unitOfWork.GetRepository<IMovieHeaderRepository>(); | |
await repo2.Save(this.Movie); | |
IGenreRepository repo3 = unitOfWork.GetRepository<IGenreRepository>(); | |
foreach(Movie movie in movies) | |
await repo3.Save(movie.Genre); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment