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

Working with serialization in C#

Do you know how .Net mechanism stores your object in memory? I don't know! But we should know how to store the content of an object into a file (in the simplest form) or transfer the object between a network, passing an object from one domain to another, sending the object to a remote application by means of a Web Service , Rest, and so on. To do more security you should convert the content into different format and after the operation re-convert it to the same format. This operation is called Serialization. Sterilization in an operation defined in .Net, it's all ab... 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

Simple command handler in .net

I want to introduce a simple command handler pattern in order to separate commands and queries of your applications, if it’s needed. Sometimes specially in large scale applications you need to have two layers for read and write separated and assign two teams to work on them.

You can use the pattern in this post based on complexity and needs of your application. I recommend that don’t call this CQRS pattern as it’s something completely different and more complex.

 

Get started and Create an interface with no any member:... 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

Prototypes in JavaScript

JavaScript is a prototypical based language. In JavaScript objects are pairs of keys and values and these keys are Strings. Rather than keys and values, JavaScript objects have one another attribute called prototype which is a pointer to another objects . prototype property allows you to add properties and methods to an object.

 In regular form We can add a property to an object using Object.defineProperty like this:

  1. var obj = new Object.create(null);
  2. Object.defineProperties(obj, 'Name', { age: "24", propertyI... 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

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

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