DesignPatternCSharp C# singleton repository and unit of work factory strategy state decorator chain of responsibility lazy load builder command observer adapter