Generic Free Pattern Improved C#

Hi, some time ago I posted information about Generic Free Pattern, but I used there the reflection. Today I would like to share with you a much faster solution. The source of creation is a bridge between non-generic and generic classes in the Creator method. The usage of the pattern is at the end of the code. Where you can create a class EntityManager that is non-generic, but the logic that is called behind the scenes redirects the execution to the generic version of this class named EntityManager. The nice thing about this pattern is that it automatically figured out Continue ReadingGeneric Free Pattern Improved C#

Action and Func in Java 8

Hi, as a .NET/C# coder I found the issue that there is not Action<T> and Func<T, TResult> equivalents in Java environment. I am self-study this to prepare myself for the OCA certification, and I had the idea that I could use lambda expression and implement simple equivalents of C# delegates in Java 8. Below you can find implementation with test cases. I found that the code can be straightforward because lambda expressions work as anonymous methods in C#. Moreover, use T as an internal class of method. You can have an entity available inside the lambda and outside, too, so Continue ReadingAction and Func in Java 8

Third usage of C# out keyword with Roslyn Intro

Hi, today I want to share with you innovative solution idea I want to make with Visual Studio 14 CTP that I found by looking to Roslyn project on CodePlex site. So what is the case here? Do you remember one of my last blog entry about Generic Free Pattern. That solution can make C# similar to JavaScript when you write the code but type-safe when the compiler uses it simultaneously. So what is the case of the third usage of our keyword? Let’s say we have a generic class with generic type argument T, and we have a constructor Continue ReadingThird usage of C# out keyword with Roslyn Intro