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

505 questions
2
votes
2 answers

Error: “An entity object cannot be referenced by multiple instances of IEntityChangeTracker"

I'm currently using the repository pattern in an ASP.Net MVC project and have the following code: partial class Timesheet : ITimesheet { TimeSystemDBEntities _db; public Timesheet() { …
2
votes
3 answers

How to inherit from IdentityUser in entity framework designer

I have an asp.net mvc project that uses asp.net Identity to authenticate users. The database has been designed in entity framework designer. There is a table named "Farmers" and I want to allow each farmer to login to the application. As I know in…
2
votes
2 answers

Entity Framework - Merging 2 physical tables into one "virtual" table problems

I have been reading up on porting ASP.NET Membership Provider into .NET 3.5 using LINQ & Entities. However, the DB model that every single sample shows is the newer model while I've inherited a rather old model. Differences: The User Table is…
2
votes
1 answer

ADO.NET Entity Data Model first - generate DB Firebird .NET provider

I have a problem with creating a Firebird DB from Entity Data Model (Model first, Database first all same mistake). Setup: MS Visual Studio 2013 Pro Entity Framework 6.0.2 FirebirdClient 4.1.0.0 .NET4.5 I've created a Data connection to empty…
2
votes
3 answers

ASP.NET MVC View Model with LINQ To Entities

Let's say I create a query result var query = from a in tblXYZ join c in tblABC on a.id = b.id select new {a.x, b.x}; What's the best way to pass that into a view? Should I create a new object and copy the query result into it?
jameszhao00
  • 7,213
  • 15
  • 62
  • 112
2
votes
1 answer

ASP.NET MVC - Easy way to update the strongly typed view, when model adds additional fields?

Existing Model, Controller and View, all working well. Due to a requirement change, there is suddenly a change in the db schema, need to add a few new fields. Database is updated, model (ADO.NET Entity) is refreshed from database and new fields…
curtisk
  • 19,950
  • 4
  • 55
  • 71
2
votes
1 answer

EF6 Contains Query Casting

Edmx file has Corresponding object's property is Query: long[] ids = new long[]{1234567,1234568}; var results =…
2
votes
1 answer

Can´t update database from WPF datagrid via Entity Framework

I have simple C# WPF application which gets the data from the database into WPF datagrid via an Entity Framework model. In direction from database to WPF DataGrid everything works fine. My problem is the opposite direction from datagrid to the…
VilemRousi
  • 2,082
  • 4
  • 24
  • 34
2
votes
1 answer

How to change Connection String in Entity Data Model in Visual Studio 2012

How to change Connection String in Entity Data Model in Visual Studio 2012 I Can Not Change Connection String in Visual Studio 2012 Help Me Entity Data Model in Visual Studio 2012 Difference With Old Version
2
votes
1 answer

How to create an Entity Data Model for inherited generic types?

I have no clue how i can get an existing object structure based on the following classes (simplified) into a database using Entity Framework (EF is a constraint, i have to use it). public abstract class WahWahProperty { public string Name { get;…
JRoppert
  • 5,854
  • 5
  • 32
  • 37
2
votes
1 answer

OData Entity Design: Additional field for query

We are currently designing an OData compliant entity data model that will be consumed by a mobile application. The team is divided into two; the backend developers providing the OData services and the front-end developers consuming these…
Guven
  • 2,280
  • 2
  • 20
  • 34
2
votes
1 answer

ADO.NET Entity Framework: Best way of creating generic interface for business entities?

I am just getting started with the ADO.NET Entity Data Model and I was curious as to what was the best way of extending my entities behaviour. Say I have a table called "Customers" and I create an entity model based on this table. I now have a…
James
  • 80,725
  • 18
  • 167
  • 237
2
votes
1 answer

Timespan/Edm.Time format in OData

What is the correct format to be used for Edm.Time ? I see in the protocol document the format for DateTime and DateTimeOffset as follows: Datetime : "yyyy-MM-dd'T'HH:mm:ss.fff" DateTimeoffset : "yyyy-MM-dd'T'HH:mm:ss.fffZ" I did check the protocol…
Venki
  • 2,129
  • 6
  • 32
  • 54
2
votes
1 answer

Handle navigation properties when adding new object to entity model

I have the following data model: I am writing a WCF service that needs to support adding new Report: public bool CreateNewReport(Report report) { MyEntities context = new MyEntities(); context.AddToReports(Report); …
Michael
  • 22,196
  • 33
  • 132
  • 187
1
vote
3 answers

Best practice in returning select query in linq

I'm a little confused on what among this list below what to use in returning select in linq. 1.IEnumerable 2.List 3.ObjectQuery 4. ConvertLinqtoDataTable Which do you prefer? Currently we are used objectquery in returning records. public…
BizApps
  • 6,048
  • 9
  • 40
  • 62