Archive

Posts Tagged ‘entity framework’

What’s support & What’s not in Entity Framework 4.0

May 25th, 2009 ayah No comments

Well I can give you some information, because all this has already been announced through various means including the EF Design Blog :

POCO – yes
Enum Support – unlikely
EDM Designer Enhancements – yes, lots.
Object Services API enhancements – yes, not sure what you are asking for exactly, but there have been numerous improvements to make life easier.
L2E Math function mapping – not sure exactly what you mean but we have much better support for function in L2E now, you can even register your own ‘stubs’ for database functions and even ‘model’ functions.
ForeignKey support – yes
Custom Code Generation – yes (using T4)
Table Value Functions – unlikely, but see Model Defined Functions below.

Others (off the top of my head, not an exhaustive list):
Model Defined Functions (similar to a TVF because they are composable, big difference is that they are defined in the CSDL and as a result are in terms of the Conceptual Model not the Storage Model).
Model First (i.e. create a model and build a database from the model)
ComplexType support in the designer
- Better support for Stored Procedures

Pasted from <http://www.thedatafarm.com/Blog/2009/05/13/EF4WhatIsAndIsNotSupported.aspx>

Preview : Entity Framework 4.0

May 13th, 2009 ayah No comments

Percaya ato nggak, EF 4.0 datang dengan perubahan yang signifikan, thanks to ADO.NET Developers. Salah satu perubahan yang ada di EF 4.0 dibandingkan release sebelumnya adalah kemampuan untuk generate dari Model menjadi DDL Database, tapi dalam hal ini database yang baru di support adalah SQL Server.

Misalkan kita punya model seperti ini

clip_image002_thumb[1]

Untuk generate DDLnya kita tinggal klik kanan di Model, nanti ada tulisan Generate Database from Model.

clip_image002%5B7%5D_thumb[1]

Alhasil nanti keluar hasil DDLnya seperti ini

 

-- Creating table 'IngredientSet_Protien'
CREATE TABLE [dbo].[IngredientSet_Protien] (
    [Cut] nvarchar(100)  NOT NULL,
    [Type] nvarchar(70)  NULL,
    [Id] int  NOT NULL
);
GO
-- Creating table 'IngredientSet_Plant'
CREATE TABLE [dbo].[IngredientSet_Plant] (
    [IsFruit] bit  NOT NULL,
    [IsHerb] bit  NOT NULL,
    [IsVegetable] bit  NOT NULL,
    [Id] int  NOT NULL
);
GO

-- --------------------------------------------------
-- Creating all Primary Key Constraints
-- --------------------------------------------------

-- Creating primary key on [Id] in table 'RecipeSet'
ALTER TABLE [dbo].[RecipeSet] WITH NOCHECK
ADD CONSTRAINT [PK_RecipeSet]
    PRIMARY KEY CLUSTERED ([Id] ASC)
    ON [PRIMARY]
GO
…
-- --------------------------------------------------
-- Creating all Foreign Key Constraints
-- --------------------------------------------------

-- Creating foreign key on [Chef_Id] in table 'RecipeSet'
ALTER TABLE [dbo].[RecipeSet] WITH NOCHECK
ADD CONSTRAINT [FK_ChefRecipe]
    FOREIGN KEY ([Chef_Id])
    REFERENCES [dbo].[ChefSet]
        ([Id])
    ON DELETE NO ACTION ON UPDATE NO ACTION
Categories: Programming Tags: ,

Debugging Lambdas

March 21st, 2009 ayah No comments

Susah juga ngedebug untuk method kali ini, karena secara default, Visual Studio 2008 / 2008 SP 1 belum bisa ngedebug Lambda expression di window watch. Kalau kita coba masukan expression tersebut ke window watch, nanti ada tulisan

Expression cannot contain lambda expression

Menyebalkan banget ya kalau seperti ini, bisa menghambat kecepatan untuk debug bila ada masalah.
Tapi, hal ini bisa kita atasi dengan cara menginstall sebuah plugins. Cara installnya juga gampang, copy ke

…\Documents\Visual Studio 2008\Visualizers

Kalau pake windows XP copy ke

…\My Documents\Visual Studio 2008\Visualizers

Kalau binun silahkan cek lokasinya ke Tools | Options | Projects and Solutions | General

Hasil yang diharapkan adalah seperti ini
Preview 1
Preview 1
Preview 2
Preview 2
Preview 3
Preview 3

Referensi
1. Ling Farm
2. Expression Tree basics