Null Object Design Pattern

A Null Object is an object with defined neutral (“null”) behavior(via url).You also known as Stub,  Active Null,  Active Nothing. An alternative to object null controls(validation,check) Let’s look codes Nested type NullStaff class in StaffBase abstract class doesn’t consist of operational code and set default value for variable types(for instance int=0,String.Empty) In the below you can see class diagram Null …

Continue reading ‘Null Object Design Pattern’ »

EF Codefirst Approach, Context Factory, Generic Repository Pattern, Unit of Work Pattern

Firstly i want to take a look at Generic Repository and Unit Of  Work Design Pattern. Repository Concept: Separate business code from data access Encapsulate data access Anytime you need data persistence Unit Of Work Concept: You can prefer for effecient data access Manage concurrency problems and transactions Now, Let’s write code for Context Factory …

Continue reading ‘EF Codefirst Approach, Context Factory, Generic Repository Pattern, Unit of Work Pattern’ »