Questions tagged [ado.net-entity-data-model]

Covers the Entity Data Model-part of ADO.NET

Covers the Entity Data Model-part of ADO.NET

510 questions
15
votes
2 answers

What is the meaning of the "Pluralize or singularize generated object names" setting?

When setting up a new Entity data Model, there is an option to [x] Pluralize or singularize generated object names I have noticed this is an option in LINQ as well. Also, now that I am studying the ADO.NET entity framework, I noticed it also has…
user287745
  • 2,847
  • 9
  • 49
  • 97
14
votes
4 answers

EF4 is throwing an error "Schema specified is not valid"

I'm getting a weird EF4 "Entity Framework v4" error when I do a select on the context. There I get is: Schema specified is not valid. Errors: The relationship 'AnalyzerConfigurationModel.FK_AnalyzerMetadataParameters_AnalyzerMetadata' was not…
13
votes
3 answers

Using multiple edmx file vs. one large edmx file?

I'm new to the Entity model thing and i'm looking for an advise how to organize my Entity model. should i create one entity model file (.edmx) which will contain all the tables in my database or should i break it logical files for user, orders,…
Or A
  • 1,759
  • 5
  • 29
  • 54
11
votes
1 answer

Changing the Name of the Connection String that Entity Framework Uses

How do you change the name of the connection string that Entity Framework models are bound to by default? Let's say I create an Entity Framework data model named "Model1.edmx" by pointing it to a databased named "MyDb" and picking some objects to…
Derek Morrison
  • 5,024
  • 4
  • 27
  • 24
10
votes
1 answer

How to Copy Data From Sql Object to C# Model Property

I have two tables: Employee: Id, Name, DepartmentId Department: Id, Name Employee.cs: public int Id {get;set;} public string Name {get;set;} public int DepartmentId {get;set;} Department.cs: public int Id {get;set;} public string Name…
Bimal Das
  • 1,682
  • 4
  • 25
  • 47
10
votes
1 answer

Unable to determine the principal end of an association between the types

Here is the situation. There are two type of ElectricConsumer ie CommercialConsumers & DomesticConsumers(Quaters) and one Quater is allocated to one Employee. Below is my code but encountring the exception . Unable to determine the principal end…
10
votes
3 answers

ASP.NET Web API OData - Translating DTO queries into Entity queries

We are currently investigating the use of OData query syntax in our Web APIs. We are not looking to implement a full OData implementation - merely leverage the query syntax. It is generally considered good application architecture to separate your…
10
votes
2 answers

How to display a collection in View of ASP.NET MVC 4 Razor project?

I have the following Model: public class ContractPlain { public int Id { get; set; } public Guid ContractGuid { get; set; } public int SenderId { get; set; } public int RecvId { get; set; } public int ContractType { get; set; } …
user2402179
9
votes
3 answers

Can SQL Server views have primary and foreign keys?

Is it possible to define primary and foreign keys for database Views in Microsoft SQL Server Management Studio? How? I'm trying to create an ADO.NET Entity Data Model to read from four old, poorly-formed database tables that I cannot modify. I've…
9
votes
3 answers

Cannot drag tables from model browser into edmx design surface

I am using ODP.NET. I have added an ADO.NET model to the project. That way, an edmx file was created. I chose "create from database" and after I selected the tables and click finish, edmx design surface appeared empty, however, the model browser…
jstuardo
  • 2,687
  • 10
  • 44
  • 101
8
votes
2 answers

asp.net mvc - pass partial data model to partial view

I wish to build a partial view that gets a model column and print it. Something like that: At the view: @model IEnumerable @{ ViewBag.Title = "Index"; var Brand = (from r in Model select…
Nir
  • 2,017
  • 8
  • 35
  • 54
8
votes
3 answers

Entity Framework Not Generating Classes for Tables or Procedures

I'm using the Entity Framework to generate the classes and functions in C# I need to interact with the SQL server. For reference, here's one of my tables: SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [dbo].[Area]( [ID]…
7
votes
4 answers

How to access associations in a LINQ query?

I'm having problems quering this (I am new to LINQ, please forgive me) and I have spent hours trawling the web. In SQL I just want to do this SELECT c.Forname, c.Surname cg.Title, g.GroupName FROM Contact c inner join ContactGroup cg on…
PKCS12
  • 527
  • 4
  • 27
7
votes
1 answer

Entity Framework - Inserting entity with multiple models and databases

I have my domain split into multiple Entity Framework models. I have some shared entities that span multiple models (named Lookup), however, these are replaced with "using" references using the methods described in Working With Large Models In…
Reddog
  • 14,009
  • 3
  • 47
  • 61
7
votes
4 answers

Adding a Business Layer to ADO .NET Entity Framework

I'm working on my first .NET project (.NET 3.5, ADO.NET and C#). We've built our entity models and are trying to build a clean business objects layer. We've got our basic entity model and we want to add certain business-level semantics to the…
1
2
3
33 34