C# language

How to add attributes to classes generated by LINQ2SQL or Entity Framework?

INTRODUCTION In these days Microsoft developers tend to compose their Data Access Layers using LINQ2SQL or Entity Framework most of the times. The good ol’ ADO.NET was terrific in the past, but its days of glory are clearly over. Both of these frameworks offer great functionality and both of them can save up a lot of time. Assuming that you have a complete database prepared, generating business classes for that is just a matter of few clicks. And those classes are generated in a shipshape fashion...
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

GroupJoin method tutorial

INTRODUCTION Some time ago I published an article describing in very little details GroupBy method that comes with LINQ framework. Now I want to show you on an example step by step how to use another LINQ`s method – GroupJoin. GroupJoin method is somewhat similar to the previous one. The only difference is that it additionally applies inner join operation on given collections. This operation is applied before grouping. If you would like to swap those operation`s order then use GroupBy method followed...
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Understanding Expression Trees

Normal 0 21 false false false PL X-NONE X-NONE /* Style Definitions */ table.MsoNormalTable {mso-style-name:Standardowy; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-qformat:yes; mso-style-parent:""; mso-padding-alt:0cm 5.4pt 0cm 5.4pt; mso-para-margin-top:0cm; mso-para-margin-right:0cm; mso-para-margin-bottom:10.0pt; mso-para-margin-left:0cm; line-height:115%; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Calibri","sans...
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Nice trick for sorting collection of anonymous objects in one line of code

v\:* {behavior:url(#default#VML);} o\:* {behavior:url(#default#VML);} w\:* {behavior:url(#default#VML);} .shape {behavior:url(#default#VML);} Normal 0 false 21 false false false PL X-NONE X-NONE /* Style Definitions */ table.MsoNormalTable {mso-style-name:Standardowy; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-qformat:yes; mso-style-parent:""; mso-padding-alt:0cm 5.4pt 0cm 5.4pt; mso-para-margin-top:0cm; mso-para-margin-right:0cm;...
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Covariance, contravariance and invariance in C# language

v\:* {behavior:url(#default#VML);} o\:* {behavior:url(#default#VML);} w\:* {behavior:url(#default#VML);} .shape {behavior:url(#default#VML);} Normal 0 false false false MicrosoftInternetExplorer4 /* Style Definitions */ table.MsoNormalTable {mso-style-name:Standardowy; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin:0in; mso-para-margin-bottom:.000... mso-pagination:widow-orphan; font-size:10.0pt;...
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati