.Net Links

Tuesday, April 24, 2012

Entity Framework


What is the Entity Framework?
• Entity Framework (EF) is an object-relational mapping (ORM) framework for the .NET Framework.
• It abstracts the relational (logical) schema of the data that is stored in a database and presents its conceptual schema to the application.
History
• Entity Framework (EFv1) was included with .NET Framework 3.5 Service Pack 1 released on 11 August 2008
• The second version of Entity Framework, named Entity Framework 4.0 (EFv4), was released as part of .NET 4.0 on 12 April 2010
• A third version of Entity Framework, version 4.1, was released on April 12, 2011
Advantages
1.Basically the Entity Data Models that are built using the Entity Framework. It is going to be the centerpiece of communications with several technologies.
2.This enables developers to “model” the data for their application without changing the actual database
For more details of this topic, please read this article

Thanks to ChandraDevs Blog

Labels: , , , , , , , ,

Data Access Technologies - Should I use ADO, LINQ, nHibernate or the Entity Framework?

Click here

Labels: , , , ,

Monday, April 2, 2012

Scope of Static and Local Variable by an Example


Program





using System;
using System.Collections.Generic;
using System.Text;


namespace Winform_Events
{
     
    class Static_Variables
    {
       private static int x = 1;

       public static void Main(string[] args)
        {
            int x = 5; // method's local variable x hides static variable x


            Console.WriteLine("local x in method Main is {0}", x);


            // UseLocalVariable has its own local x
            UseLocalVariable();


            // UseStaticVariable uses class Scope's static variable x
            UseStaticVariable();


            // UseLocalVariable reinitializes its own local x
            UseLocalVariable();


            // class Scope's static variable x retains its value
            UseStaticVariable();


            Console.WriteLine("\nlocal x in method Main is {0}", x);
            Console.ReadLine();
        }


       public static void UseLocalVariable()
       {
            
           int x = 25; // initialized each time UseLocalVariable is called


           Console.WriteLine("\nlocal x on entering method UseLocalVariable is {0}", x);
           ++x; // modifies this method's local variable x
           Console.WriteLine("local x before exiting method UseLocalVariable is {0}", x);
       } // end method UseLocalVariable


       // modify class Scope's static variable x during each call
       public static void UseStaticVariable()
       {
          
           Console.WriteLine("\nstatic variable x on entering {0} is {1}","method UseStaticVariable", x);
             x *= 10; // modifies class Scope's static variable x
           Console.WriteLine("static variable x before exiting {0} is {1}","method UseStaticVariable", x);
       } // end method UseStaticVariable


    }
}



O/P
local x in method Main is 5


local x on entering method UseLocalVariable is 25
local x before exiting method UseLocalVariable is 26


static variable x on entering method UseStaticVariable is 1
static variable x before exiting method UseStaticVariable is 10


local x on entering method UseLocalVariable is 25
local x before exiting method UseLocalVariable is 26


static variable x on entering method UseStaticVariable is 10
static variable x before exiting method UseStaticVariable is 100


local x in method Main is 5

Labels: , , , ,