Repository pattern concept and implementation in asp.net MVC with C# and entity framework
source code: https://github.com/imtiajahammad/RepositoryPatternWithCSharpAndEntityFramework
#imtiajLearnings
#imtiajFables
Size: 826.96 KB
Language: en
Added: Apr 09, 2021
Slides: 21 pages
Slide Content
Repository Pattern with C# and Entity Framework Concept & implementation Overview
What is Repository Pattern? Mediates between the domain and data mapping layers, acting like an in-memory collection of domain objects
Benefits Minimizes duplicate query logic
Benefits Decouples your application from persistence frameworks Promotes testability
Repository pattern in a nutshell Should act like a collection of memory Repository should not have save or update method Repository should not have semantics of your database Should only be a collection of objects and memory
Repository pattern in a nutshell Then how are we going to save these objects to the database ? Solution : Unit of Work Unit of Work : Maintains a list of objects affected by a business transaction and coordinates the writing out of changes
Repository pattern in a nutshell
Implementing the Repository Pattern
Implementing the Repository Pattern
Implementing the Repository Pattern: IRepository
Implementing the Repository Pattern: Repository
Implementing the Repository Pattern: Repository
Implementing the Repository Pattern: Repository
Implementing the Repository Pattern: ICourseRepository
Implementing the Repository Pattern: CourseRepository
Implementing the Repository Pattern: IAuthorRepository
Implementing the Repository Pattern: AuthorRepository
Implementing the Repository Pattern: IUnitOfWork
Implementing the Repository Pattern: UnitOfWork
Implementing the Repository Pattern: Example
Thank you for your time Reference: https:// www.youtube.com/watch?v=rtXpYpZdOzM&t=1374s&ab_channel=ProgrammingwithMosh Assembled by: Imtiaj Ahammad Find me: https://www.linkedin.com/in/imtiaj-ahammad-2175a3130 / Source Code: https:// github.com/imtiajahammad/RepositoryPatternWithCSharpAndEntityFramework