Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Entity framework and LINQ vs Strongly typed dataset
Message
De
10/04/2012 09:55:25
 
 
À
10/04/2012 02:51:53
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Versions des environnements
Environment:
C# 2.0
Divers
Thread ID:
01540673
Message ID:
01540804
Vues:
51
Add the [NotMapped] attribute to the property.

>If I add a property to an entity and run 'Generate database from Model' I get a warning that the existing store schema will be overwritten and the generated SQL contains something like this:
-- --------------------------------------------------
>-- Dropping existing tables
>-- --------------------------------------------------
>
>IF OBJECT_ID(N'[dbo].[Customers]', 'U') IS NOT NULL
>    DROP TABLE [dbo].[Customers];
>GO
>-- --------------------------------------------------
>-- Creating all tables
>-- --------------------------------------------------
>
>-- Creating table 'Customers'
>CREATE TABLE [dbo].[Customers] (
>    [Id] int IDENTITY(1,1) NOT NULL,
>    [Name] nvarchar(max)  NOT NULL,
>    [FristName] nvarchar(max)  NOT NULL
>);
>GO
How do you get the generator to change that behaviour ?
Craig Berntson
MCSD, Microsoft .Net MVP, Grape City Community Influencer
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform