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; }
  6.  
  7.   &nbs... Continue

Around big data world explosion

"Big data is a collection of data sets so large and complex that it becomes difficult to process using on-hand database management tools or traditional data processing applications. The challenges include capture, curation , storage, search, sharing, transfer, analysis, and visualization. The trend to larger data sets is due to the additional information derivable from analysis of a single large set of related data, as compared to separate smaller sets with the same total amount of data, allowing correlations to be found to "spot business trends, d... Continue

How to create UrlSlug in Asp.Net MVC

UrlSlug Is a way of generating a valid Url, and using the title of an article to generate a URL. UrlSlug is very important in CEO because google likes to index the meaningful Urls at the first and then it refers to other Urls. Spouse you wanna to create the this Url:

  1.  MyWebSite.com/Blog/Post/2013/4/14/how-to-create-url-slug-in-aspnet-mvc

create the model class :

  1.     public class Blog
  2.     {
  3.         public int Id { get; set; }
  4.         public s... Continue

Domain Driven Design alphabet

I'm too young to talk about Domain Driven Design , and This article is about what I've learned from Domain driven design by reading the resources that you can see at the end of this article .

Contents

  1. Introduction
  2. What is DDD ?
  3. Why DDD ??
  4. Domain Model and Subdomain
  5. Ubiquitous language... Continue

What's the meaning of POCO entity and Persistence ignorance

POCO which stands for "Plain Old CLR Objects" is an entity/class and doesn’t depend on any specific base class. It is like any other Dot net class you have seen before. These POCO entities (also known as persistence-ignorant objects) also support most of the same LINQ queries you use in you Data access layers for your business objects.  POCO is a simple object to be used with a complicated, special object framework such as an ORM component. In other definition POCOs are entities of your domain, so When you use enti... Continue

Introducing Z.bulkOperation

Today I was tackling with a problem. It was about inserting and updating 200000 records of data. I just wanted to find a solution rather than writing Store Procedure. I just searched on the web and found a library named Z.BulkOperation

I dare say I had never seen handling this amount of data nicely in application level without even using a line of SQL code, it's awesome!

Fire up visual studio and a simple console or MVC application and install the package via:

PM> Install-Package Z.BulkOperations

PM> Install-Pac... Continue

Different Kinds of Caching in asp.net MVC4

When your web site has so many users it means your server has so many recieved requests, there is no need to query for every request Made by users because it will make some performance issues, for example there are some static content in your web site that you don’t update them for several months, in these cases you can cache those content and don't force your server to get them from data base in every request. there are different kinds of caching in asp.net 

 

OutPutChaching: ASP.net has a b... Continue

Repository Pattern practice in data access layer via entity framework

To read about definitions of Repository patter refer to here or here and then let's begin! I'm gonna to show the using of repository pattern with entityframework in Data access layer. Sorry about the example because it's about product , category , brand , blah blah again! First of all create an interface called IAggregateRoot

  1.    public interface IAggregateRoot
  2.     {
  3.     }
  4. <... Continue

How to create portable area in asp.net mvc4

Sometimes you need to separate your areas from MVC project into another class library for making it readable and better management.  you can do that by using features of MvcContribe project. I recommend you to create your area in asp.net MVC and then transfer the content to the class library:

 

Contrib

 

Now add a class library to your solution and transfer the content(Controllers, ... Continue

ActionResult types in Asp.net MVC

Controller actions returns the ActionResult and it's possible to return kinds of results based on what we want in the output , let’s consider for types of result in by example in this article.

ActionResult: it just Initializes a new instance of the ActionResult class. ActionResult is the base class for other types of action.

  1.         //Action Result
  2.         public ActionResult Index()
  3.         {
  4. &nbs... Continue