Note about the Deferred Execution in LINQ component

Maybe you know about the deferred execution unconsciously. This sexy phrase refers to the point of LINQ queries when it executed. Although executing the LINQ query should be considered and after doing join, group, let and every LINQ instructions, finally, it should be executed; because it will be executed in every call if you don't execute it! Take a look at the following example:

  1.   public IEnumerable<Blog> GetAllPosts()
  2.         {
  3.          &... Continue

Practicing different kinds of joins via Linq

I'm interested in to share these samples about different kinds of joins via LINQ. have fun!

  1.     public class Brand
  2.     {
  3.         public int Id { get; set; }
  4.         public string Name { get; set; }
  5.     }
  7.     public class Category
  8.     {
  9.         public int Id { get; set; }
  10.         public string Name { get; set; }
  11.     }... Continue

How to query over Icollection<> of a type with linq

When you are implementing many to many relation in SQL, in the case of using entity framework code fist you must use Icollection<> or Ilist<> of an entity. Imagine that you have this classes , an Author class which has a collection of books

  1.     public class Author
  2.     {
  3.         public int Id { get; set; }
  4.         public string FirstName { get; set; }
  5.         public string LastName { get; set; }
  7.   &nbs... Continue

An overview to Linq by considering example

"Language Integrated Query (LINQ, pronounced "link") is a Microsoft .NET Framework component that adds native data querying capabilities to.NET languages, although ports exist for Java, PHP, JavaScript and ActionScript". wikipedia

Linq provides some C# standard method that you can call them by method syntax instead of query syntax in C# development environment ,very useful for retrieving information from data bases by formulating quer... Continue