Questions tagged [ef-model-first]

231 questions
2
votes
1 answer

Multiple database schemas in EF model first

I want use model first approach to create database with Entity Framework. I also want use multiple database schemas. Is there any possibility to create additional database schemas (say "security") along with default "dbo"? I also wondered why after…
alloha
  • 133
  • 1
  • 13
2
votes
2 answers

Entity Framework view associations not working

I have two simple views I need to create an association between the CustomerOrderView and the CustomerView using the CustomerID. I added the Association like this: No here is where it seems to cause me problems. I double click on the…
goroth
  • 2,510
  • 5
  • 35
  • 66
2
votes
2 answers

Validation in Model-first Entity framework application

I'm working on ASP.NET MVC4 with Razor, using a model-first Entity Framework connection. I have a Login form made by scratch, that requests for username, password, and Usertype. Unfortunately, the form is able to post even if the fields are blank,…
2
votes
1 answer

EntityFramework 4.1 Code First Oracle Inserting PL/SQL Code

My project has two EF 4.1 contexts, one is model-first and the other is code-first. Both contexts extend DbContext and are connecting to an Oracle database. When executing an update to a large table (5M records), the model-first context produces SQL…
2
votes
1 answer

Entity Framework 5 and MySql in Visual Studio 2010 - Model First issue

I have application developed in Visual Studio 2010, .NET 4.0, using MySql database. I have installed Entity Framework 5.0 and EF 5.x DbContext Generator for VB (using NuGet), then MySql Connector 6.5.5. I'm using Model First approach, so I created…
2
votes
0 answers

Entity Framework Model First and Code First TPH issue

I'm facing two problems by trying to make a model first or code first using TPH concept. The problem is that I need to use table per hierarchy at three levels, so that: When I use Model First, the last hierarchy entity (third level) does not saves…
2
votes
1 answer

Remove auto generate comments

I create some classes using Model First, EF4x as you can see a similar example in this answer from algreat. My question is about the default comments that are generate as it shows in the block-quote…
Michel Ayres
  • 5,891
  • 10
  • 63
  • 97
2
votes
1 answer

What kind of parameters do I have to send to a WCF endpoint to insert an entry into a table that has a relationship with another table?

I'm working with Visual Studio 2012 and developing on C#. I just started started working a WCF web service, I created the database through the Model First approach and so far I've been able to insert, update, delete and get entries into simple…
2
votes
2 answers

EF Model First : Subclass object does not appear in Context

I have a model created using Model First approach. When I try to access the Book entity using the context it is not listed there; but the selling item is listed. What change need to be done inorder to add the Book entity to the context? Note:…
LCJ
  • 22,196
  • 67
  • 260
  • 418
2
votes
2 answers

Best alternative to periodically change the underlying EF model

I am developing a C# application using entity framework 4 with a model first approach (I am having a model where I generate my DB tables and classes from). What is the best way to periodically change a DB schema (table definitions, etc.), everytime…
AlexLiesenfeld
  • 2,872
  • 7
  • 36
  • 57
1
vote
1 answer

How to define a concurrency property in Model-First

I use Entity Framework Model-First, I want to define a column for concurrency checking. One of my property named Version, I set its Concurrency Mode to 'Fixed', type to 'Binary', 'StoreGeneratedPattern' to 'Computed'. I want the column like…
James
  • 2,570
  • 7
  • 34
  • 57
1
vote
2 answers

ObjectContext public in debug mode, internal in release mode

Is there an easy way to make an ObjectContext public in debug mode and internal in release mode? With Linqpad it is very convenient to connect to an ObjectContext for quick testing and querying, so for development purposes I want it to be public.…
Gert Arnold
  • 105,341
  • 31
  • 202
  • 291
1
vote
1 answer

How to retrieve data with MVC3 Many to Many relationship and EF4.1 Model First?

I'm a very beginner and I want to do something really simple, I guess I missed something but I could not find the answer. I have two tables with many-to-many relationship mapped with EF4.1 public partial class Activity { public Activity() { …
1
vote
1 answer

LINQ generates incorrect SQL (reference to a non-existent table)

MVC3 project, using LINQ to Entity, and Entity Framework 4 Code-First. In another post ( Return products which belong to all tags in a list using LINQ ), I received assistance in creating a LINQ statement to return a subset of data. The LINQ is…
John L
  • 305
  • 2
  • 3
  • 15
1
vote
1 answer

Cannot select table for discriminator (model-first)

I'm trying to kick off a project needing table-per-hierachy. I've done this in the past with NHibernate, but we want to avoid having to hand edit XML mapping files - so are trying to use Entity Framework and it's Designer. I've been following this…
bly
  • 1,532
  • 1
  • 12
  • 19