Categories: ASP.NETASP.NET MVC

Generic Type in Repository – .NET MVC Part

Step 2. Create the new repository class file under the Infra project. The new repository class file name sets “GenericTypeRepository.” The GenericTypeRepository class must inherit the IGenericTypeRepository interface class’s method. It also does the same as the thing that marks the note above the method name position.

Fig 3. Infra project’s solution explorer
Fig 4. GenericTypeRepository repository class file source code

Note: If you want to see the complete source code about the new interface class file, please, click my GitHub repository.

Step 3. Create new controller files under the web project’s Controller folder. The controller file name sets “GenericTypeController.” Create view files under the web project’s Views folder.

Fig 6. GenericTypeController controller file source code

Note: If you want to see the complete source code about the new interface class file, please, click my GitHub repository.

Page: 1 2 3

davidsky69

Recent Posts

SOLID Principles – Single-responsibility principle

The single-responsibility principle (SRP) is a computer-programming principle that states that every module, class or…

4 years ago

Microservices – Command and Query Responsibility Segregation(CQRS)

Command query responsibility segregation (CQRS) generalizes CQS to message-driven and event-driven architectures: it applies the CQS…

4 years ago

Microservices – Domain-driven design(DDD)

Domain-driven design (DDD) is a software design approach focusing on modelling software to match a…

4 years ago

Microservices – Onion architecture

A microservice architecture – a variant of the service-oriented architecture (SOA) structural style – arranges…

4 years ago

Unit Of Work pattern concepts in .NET

The Repository pattern and Unit of Work pattern are used together in most time. Unit…

5 years ago

Behavioral Patterns – Visitor

Visitor – It allows the program changes the algorithm and the operations that base on the visitor…

5 years ago