Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Entity framework and LINQ vs Strongly typed dataset
Message
From
10/04/2012 09:55:25
 
 
General information
Forum:
ASP.NET
Category:
Other
Environment versions
Environment:
C# 2.0
Miscellaneous
Thread ID:
01540673
Message ID:
01540804
Views:
50
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform