Martin Kulov's Blog
VSTS, Oslo, INETA, ASP.NET, Debugging .NET Applications, Tips and Tricks
September 15, 2005
LINQ and database definition
Microsoft presented the
LINQ (Language Integrated Query) Project
, a new syntax for querying databases and objects from C# 3.0. LINQ has been founded on generics, anonymous methods and nullable types that are going to be delivered in C# 2.0. The SQL integration is amazing. For example if you want to define a table created with the following DDL:
create table Orders (
OrderID nvarchar(32) primary key not null,
Customer nvarchar(32) not null,
Amount int
)
the CLR representation will be like next one:
[Table(Name="Orders")]
public class Order {
[Column(DbType="nvarchar(32) not null", Id=true)]
public string OrderID;
[Column(DbType="nvarchar(32) not null")]
public string Customer;
[Column]
public int? Amount;
}
I suppose that in the future the database model will be enough to create the database DDL script, data class definitions and data access layers using a code generator.
#
posted by Martin Kulov @ 2:02 AM
Comments
|
Trackback
<< Home
Calendar
RSS
Martin Kulov's Facebook profile
Recent posts
Multiple IIS sites in Windows XP
VSTO debugging
MSDN Webcasts series
Willingness and Experience
Totally disconnected
Blog News
NHibernate presented by SofiaDev.Org
SQL 2005 Reporting Service
MS Days demos and presentation
Go go go
History
November 2004
December 2004
January 2005
February 2005
March 2005
April 2005
May 2005
June 2005
July 2005
August 2005
September 2005
October 2005
November 2005
December 2005
January 2006
February 2006
March 2006
April 2006
May 2006
June 2006
July 2006
September 2006
October 2006
November 2006
December 2006
January 2007
February 2007
March 2007
April 2007
May 2007
June 2007
July 2007
August 2007
September 2007
October 2007
November 2007
December 2007
January 2008
February 2008
March 2008
April 2008
June 2008
July 2008
August 2008
October 2008
Copyright © 2004-2008 CodeAttest Ltd. All Rights Reserved.