.ToSafeDictionary() extension method in csharp
The .ToDictionary()
extension will throw an argument exception if we have duplicate keys added to the dictionary.
The .ToDictionary()
extension will throw an argument exception if we have duplicate keys added to the dictionary.
In this post, we’ll see how to generate sequence numbers along with the data that we need in LINQ C#.
Read More »Generating Sequence Numbers In LINQ QueryTo update many records in entity framework, it is good to use the .Attach
method of the db context instead of looping through every record and fetching the data through EF and updating it.
A strategy design pattern is the most commonly used design pattern in computer programming.
In this post, we’ll start with a basic switch case statement and then we’ll modify the code into strategy design pattern.
Read More »The strategy design pattern with an exampleThis post is a sequence for the previous article which shows why the Func delegate is not translated into the SQL statements.
This post as you read from the title is about unit testing for private methods. Do we really need to test the private methods in the unit tests?
In this post, I’ll show you what happens when you use a func delegate on the Entity Framework entities.
Read More »Don’t use Func delegate on the Entity Framework entitiesFiltering an item from a list of items is easy but if the item to filter is not known at compile time then filtering a list will be little complicated.
Read More »Building dynamic LINQ queries using Expression Trees and Func
In this post, we’ll try to find the shortest word in a string using LINQ.
Read More »Shortest word in a string with LINQThis is a post to get the specific type of items from a mixed list of items. I have tried couple of solutions for the problem but it looks like there’s more elegant solution than my solution.
Read More »Get only specific types from List in C#