I will put there list of git commands with a short description.
Let’s say you have a Web API controller and you want to validate Create(POST)and Update(PUT) operations. You also don’t want to pollute your action methods with validation logic and encapsulate validation mechanism.
Check out the descent Generic Unit Of Work and Repositories framework. It allows quickly bootstrap your application with Entity Framework. This lightweight framework will also allow you to elegantly, unobtrusively, and easily patternize your applications and systems with Repository, Unit of Work, and Domain Driven Design. To use Generic Repositories or not? The framework allows […]
We will implement logging of actions in controllers and catch all exceptions in application and log them. First, go to the visual studio and create ASP.NET Web API project. Then, using Nuget Package Manager add log4net to this project.
I often bumped into questions like: What is the GetHashCode metho? Why use it? How to implement it correctly? So let’s try to ask on them. What is GetHashCode used for? It is used for putting object in a hash table. Why do we have this method implemented on Object? In order to be able […]
Shallow copies duplicate as little as possible. A shallow copy of a collection is a copy of the collection structure, not the elements. With a shallow copy, two collections now share the individual elements. Deep copies duplicate everything. A deep copy of a collection is two collections with all of the elements in the original […]
Why it is bad practice to use virtual method inside the constructor? When you make a virtual method call in a constructor, and it is not the most derived type in its inheritance hierarchy, that it will be called on a class whose constructor has not been run, and therefore may not be in a […]
10 + 10 + ’10′ – result is “2010″. ’10′ + 10 + 10 = “101010″ Difference between two declarations of methods. and Difference relates to perfomance. In first example method has to be created every time the constructor fucntion runs when method that declared with prototype is shared across all instances. What does this […]
Contra-variant Meaning that the generic type parameter can change from a class to a class derived from it. In C#, you indicate contra-variant generic type parameters with the in keyword. Contra-variant generic type parameters can appear only in input positions such as a method’s argument. Covariant Meaning that the generic type argument can change from a class to […]
When you define a generic class, you can apply restrictions to the kinds of types that client code can use for type arguments when it instantiates your class. If client code tries to instantiate your class by using a type that is not allowed by a constraint, the result is a compile-time error. These restrictions […]