Questions tagged [edmx]

An .edmx file is an XML file in the .Net Entity Framework that defines a conceptual model, a storage model, and the mapping between these models.

Resources:

How to Create an edmx

The Entity Framework and ASP.NET

edmx File Overview

781 questions
22
votes
3 answers

How can I make the Entity data model designer use my database column descriptions?

I am using EF4 with Visual Studio 2010. I have a SQL database already created and all my columns are documented with the Description property in SQL management studio. When I create the edmx in Visual Studio, how can I make it read those…
Jack
  • 269
  • 2
  • 6
20
votes
2 answers

Provider connection string from Entity Framework

If you are using object contex data model (with EDMX file), during its creation you might want to specify the connection string inside your config file. The connection string is unfortunately not the common connection string as it contains some…
Mirek
  • 4,013
  • 2
  • 32
  • 47
19
votes
1 answer

Entity Framework: Where do I extend the CSDL/MSL?

I'm using Entity Framework 4. I am using a database first model, meaning that I generated the EDM from the database. Now I want to add some model-defined functions. My question is ... where? If I put them in the .edmx file, won't all my additions…
Rap
  • 6,851
  • 3
  • 50
  • 88
18
votes
7 answers

How to properly delete and re-add Entity Data Model

newbie to Entity Framework here. Using VS 2010 and SQL Server 2008 express DB. I was having trouble refreshing an Entity Data Model after adding new tables. So, I followed a suggestion I found here to just delete and regenerate the model. I get to…
David
  • 337
  • 1
  • 3
  • 7
18
votes
5 answers

Retrieve varbinary value as BASE64 in MSSQL

I'm looking for a way for retrieving Entity Data Model (EDM) from __MigrationHistory table using only T-SQL (so anyone, using Microsoft SQL Server Management Studio only, could do the same). I want to have a valid BASE64 string value. I don't want…
pizycki
  • 1,249
  • 4
  • 14
  • 26
18
votes
5 answers

Tables don't show when re-adding them to entity-model (edmx)

I have a db with 5 tables. At the beginning, I've added those tables in, but then decided to remove some due to some relationship compile error. Now, when i want to add them back, i'm opening the edmx file -> update model from database... I don't…
Or A
  • 1,789
  • 5
  • 29
  • 55
16
votes
3 answers

Net Framework 4.8 EF6 EDMX T4 Error _generationEnvironment is NULL

This started with an EDMX suddenly not generating class files. The .context.cs file contains the class declaration like public virtual DbSet myTable { get; set; } but the actual class files are not being generated. Both .tt files are…
Serexx
  • 1,232
  • 1
  • 15
  • 32
16
votes
3 answers

SQL Server and performance for dynamic searches

I was wondering what were the best practices for making a query in sql with a dynamic value, lets say i have a Value(nvarchar(max)) value: "912345678" select * from AllData where Number like '%912345678%' value: "Michael" select * from…
BrunoMartinsPro
  • 1,646
  • 1
  • 24
  • 48
16
votes
3 answers

Enum Support for Entity Framework Database First

I can find a bunch of tutorials on how to implement enum support for model first and code first like these: http://msdn.microsoft.com/en-us/data/jj248772.aspx http://msdn.microsoft.com/en-us/data/hh859576.aspx Can anyone explain to me or provide me…
TMan
  • 4,044
  • 18
  • 63
  • 117
15
votes
2 answers

How can I generate the database from .edmx file in Entity Framework?

I have had to suddenly switch to working on Code First Entity Framework 4.1. I started off not knowing anything about this framework but in the last 8 hrs I am now much more comfortable having read blogs and articles. This blog in particular is one…
Red Swan
  • 15,157
  • 43
  • 156
  • 238
13
votes
1 answer

Occasional "The underlying provider failed on Open" errors when using EF4 (edmx model)

I hope someone can help me with a solution to the following error. The application in which the error happens is running in production and I never experience the error myself. However around 20 times a day I receive an error mail telling me: The…
hylle
  • 133
  • 1
  • 1
  • 5
13
votes
1 answer

How to add an EF6 Association to a Candidate Key / Unique Key which is not the Primary Key?

Using Schema First, I have a database structure, as so ExternalDataItems --- edataitem_id PK -- surrogate auto-increment - NOT for FK relation here datahash UX -- Candidate Key / Unique Index (binary(20)) ExternalMaps --- emap_id …
12
votes
4 answers

Exporting a large Entity Framework Diagram

I have a fairly large Entity Diagram. I tried to export it to an image, unfortunately because it's so large the image comes out all pixelated. See this link…
Stephen Lacy
12
votes
2 answers

The number of primary key values passed must match number of primary key values defined on the entity

I've created a view in SQL Server that contains the most important columns from different tables. Printing the content of the table to the ASP.NET MVC view works fine, but when I want to get the details of a single record the problem occur. The…
Ørjan
  • 2,749
  • 2
  • 16
  • 24
12
votes
1 answer

Entity Framework 4.3.1 to 6 EDMX (ObjectContext)

I'm trying to upgrade a project from EF 4.3.1 to EF 6.0 The template uses ObjectContext and now, whenever I change the template, it's overwriting the generated code in the *.Designer.cs file with the old EF 4.3.1 namespaces, so the build breaks. Is…
Keith Jackson
  • 3,078
  • 4
  • 38
  • 66
1
2
3
52 53