Questions tagged [edmx]

1

votes
0

answer
69

Views

Import PostgreSQL view to Entity Framework

I'm using Entity Framework 6 and PostgreSQL. I generated a Database and now i need to import a View inside my .edmx designer, but the problem is that i get an exception, because EF wasn't able to import the view because there is no explicit key inside of it. I've tried to add a Key column inside the...
Dr. Roggia
1

votes
0

answer
131

Views

Entity Framework - DB first foreign key table won't show as model

I have created a table with two primary keys and two foreign keys, both foreign keys refer to the same column in the base table - script as follows: CREATE TABLE [dbo].[TG_PitzulHafrashotShliliVsShotef]( [PitzulHafrashotIdShlili] [int] NOT NULL, [PitzulHafrashotIdShotef] [int] NOT NULL, [TaarichIdk...
Barr J
1

votes
2

answer
551

Views

edmx error 'Unable to cast object of type 'MySql.Data.MySqlClient.MySqlProviderServices' 'System.Data.Common.DBProviderServices'

Getting edmx error Unable to cast object of type 'MySql.Data.MySqlClient.MySqlProviderServices' to type 'System.Data.Common.DBProviderServices' when trying to open edmx designer for MySQL model. I have both Entity Framework 6 for SQL service in the project as well as references to MySQL. Here is wha...
user559854
1

votes
0

answer
33

Views

Entity Framework - Not able to add edmx file in MVC project

I am using VS 2015 and created MVC project. Now I have created tons of edmx files with SQL server database but I am facing issue with MySQL database. At certain point, wizard got disappear and not able to add edmx file to project. In above picture, after selecting EF Designer from Db, I select conne...
theDarthVader
1

votes
0

answer
23

Views

How to incorporate EDMX into solution effectively

One of the architects at my organization has provided me with an EDMX file for the web application I will be working on. Another team will be making updates directly to the database at this time. Adding tables, changing columns etc. How should I effectively incorporate this EDMX file into my solutio...
Jason Jay
1

votes
1

answer
1.1k

Views

DomainService only works with EDMX file?

I want to add a new domain service class within vs2010. I choose my entity framework database context in the dialog 'Add New Domain Service Class', but it doesen't show me the available entities. If I click 'ok' VS2010 gives me the following error message: --------------------------- Microsoft Visua...
Jeldrik
1

votes
2

answer
1.3k

Views

How to programatically generate CSDL or EDMX from a set of existing POCO objects

I'd like to simulate what WCF Data Services does with it's '$metadata' tag... that is, send a CSDL document that describes an existing set of objects that may (or may not) be part of an Entity Framework model. In fact, assume the EF is not part of this discussion... I want to create a service that i...
Simon Gillbee
1

votes
1

answer
4.3k

Views

How to get List of all tables in the Entity data framework?

I need to get the list of All tables in the Entity Data Framework. I know that in Linq2SQL we can use something like this. var dataContext = new DataContext(); var dataContextTableNames = (from tables in dataContext.Mapping.GetTables() select tables.TableName).ToList(); But, I need to get list of al...
SKumar
1

votes
1

answer
508

Views

creating a UI with a button which will dynamically create .edmx file at runtime

i want to create a user interface will should give me the option to select the database from the present ones and accordingly create its .edmx file.
dave
1

votes
1

answer
1.4k

Views

Entity Framework: 0..1-to-many foreign key constraint not recognized?

I am using EF4 to map a DB schema to an object model; I initially generated the EDMX from the database but have been editing the XML directly (trying to leave the SSDL the same while changing the CSDL/MSL to approximate the object model I want). The database contains, among many other things, a coup...
Max Strini
1

votes
1

answer
1.5k

Views

ADO.NET Entity Framework Hierarchical Data

Consider following database model: And following query code: using (var context = new DatabaseEntities()) { return context.Feed.ToHierarchy(f => f.Id_Parent, null); } Where ToHierarchy is an extension to ObjectSet as: public static List ToHierarchy(this ObjectSet set, Func parentIdProperty, TPropert...
Ali
1

votes
1

answer
436

Views

How to integrate my own structural annotations engine in the Entity Framework designer?

In the accepted answer to this SO question there is an explanation about structural annotations, a way to customize the data on the EDMX files generated by the Entity Framework designer. This feature is used by the Portable Extensible Metadata framework in order to add validation information to the...
Konamiman
1

votes
1

answer
1.5k

Views

MVC 3 - Updating table row with EDMX model

I've tried several ways to update an object in my database. I've also read a couple of questions out here and other forums concerning updating data. But except for one way nothing else is working for me. What works? If I update all attributes manually it works. Something like this: [HttpPost] public...
Gyocol
1

votes
1

answer
617

Views

Many-to-many relationship, edmx, Entity Framework, SQL express DB

I have a question regarding many-to-many relationships in regards to entity framework. Ok, so I have an existing SQL express db which I have extended to included a new table called 'Country'. Since I want to have a many to many relationship between 'Country' and another table 'Language' I have made...
sreddy
1

votes
1

answer
86

Views

multiplicity between tables on edmx shema

I'm trying to understand an .edmx shema and i don't know what exactly means the '->' on the table name and what kind of multiplicity is. I haven't saw something like this before..can you help me? .edmx photo: http://imageshack.us/photo/my-images/706/50490471.png/
stelios
1

votes
1

answer
649

Views

Where should I instantiate the Entity Framework's ObjectContext in a 3-tier applicaiton

I have a 3-tier web application wit ha bunch of simple forms. One to list records, one to edit a single record, etc. The works. I have a DataLayer where my EDMX is. I have an App Layer where my POCOs are. I haev a BusinessLayer with all my controller classes, etc. (not MVC!) I have a UI layer where...
John
1

votes
1

answer
2.1k

Views

entitydatasource one to many to one

I am trying to build a drop down list with an entitydatasource and a query. I am recieving the following error message, I am unsure about what I am doing wrong: 'UserId' is not a member of 'Transient.collection [WebAppModel. UserSite(Nullable=True, DefaultValue=)]'. To extract a property of a collec...
Jason
1

votes
2

answer
3k

Views

EntityFramework - How to get tables name from Edmx

I'm working with asp.net mvc3. I have a edmx that was created ADO.NET Entity Data Model. (Data-First) TestDb.Designer.cs namespace Test.Web.DataModel { public partial class TestDbContext : ObjectContext { public ObjectSet T_Members { ... } public ObjectSet T_Documents { ... } .... } } T_Members, T_D...
isnotnull
1

votes
2

answer
664

Views

EDMX is overwriting Key data annotations

This applies to EF 5 and database first modeling. My model was built useing the EF generator from an existing DB. I'm using the [Key] data annotation in my model classes because the primary key fields have names that are not in line with EF conventions. Everything works, but when I open the root EDM...
tintyethan
1

votes
1

answer
460

Views

Retrieving related data using edmx and repository pattern

I am writing a simple mvc application with edmx and repository pattern. I have the following table structure. 1) Employee ColumnName:Name,ProjectCode 2) Project ColumnName:Code,ProjectName There is only data relationship between these two table,no association is defined in database between them. I h...
user3079115
1

votes
1

answer
77

Views

Can I render an entity framework edmx file in the browser [closed]

Ok I know it sounds nuts, but I have a project where I need to show the relationships between different tables in a web app for internal use. I know I can generate an edmx file on the fly, but how do I show it to the user in the browser? Thoughts?
Steven Roman
1

votes
1

answer
106

Views

Entity Framework Designer NavigationProperty Custom Variable

Is it possible to add some of property or variable or custom attribute to a particular column or navigation property within the EDMX designer so I can utilize it in my T4 template? I want to be able to say (in my T4 template) 'If this property is set, write an [XmlIgnore] attribute for this property...
DaleyKD
1

votes
1

answer
189

Views

How to generate UI using EDMX file

What is an EDMX file and what is it used to do? Could I create a UI screen from EDMX file? If yes, how? Thanks
Tintin
1

votes
3

answer
3k

Views

How to get System.Data.SQLite Database File Option in DataSource

I've followed below tutorials http://geekswithblogs.net/danielggarcia/archive/2013/12/22/portable-databases-ii-using-sqlite-with-entity-framework.aspx But after installation of System.Data.SQLite using Net-Gu Package manager, no option is available for SQLite Database File in
1

votes
1

answer
1.8k

Views

Entity Framework 6 Switch between DB Providers

I know in past versions of EF, in order to support say MySql and SQL Server, you needed to write your own ssdl. Now with EF 6, the SSDL is embedded in the edmx. So does that mean all I have to do is add another 'Schema' tag for the new provider in my edmx? Update So I tried added another 'schema'...
Zeus82
1

votes
1

answer
1.2k

Views

Why do I have to build my Domain Project that contains my EDMX before my application will run?

I have ASP.NET MVC application solution split into 3 projects: MyApp.Domain (EDMX File and Repositories) MyApp.Test (Unit Tests) MyApp.WebUI (MVC App) When I get my application out of source control, set project MyApp.WebUI to the Startup project and F5 to run, I get an error from my DbContext... An...
Luke
1

votes
1

answer
49

Views

EDMX Entities not populating data

I am working on a project where I am using Entity Framework. There is a very strange problem I came across. I am getting the User table information via EDMX which has relation with a Contacts table (through UserID column). Now, User collection has retrieved ContactID and it should also retrieve...
Anil C
1

votes
1

answer
890

Views

How to generate CSDL and MSL files programmatically?

I'm trying to achieve the dynamic ORM models generation using C# language. I need this because of the tasks in my work. I've achieved how to create SSDL file programmatically in C#. I'm using EntityStoreSchemaGenerator class, which is writing data this way: var store = new EntityStoreSchemaGenerator...
1

votes
2

answer
3.1k

Views

Asp.net 5 mvc 6 Entity Framework 7 database first

I noticed that this type of project does not support files edmx. What is the right way to develop a project in Asp.net 5 MVC 6 using Entity Framwork 7?
Dallas
1

votes
1

answer
148

Views

Entity Framework - Botched association

I am attempting to create 'code first from database' classes using Entity Framework 6.1.3 but it seems E.F. is having trouble making associations (or I am simply not setting something up correctly in my database). Here are the two tables in question, I am making classes from using entity framework;...
n00b
1

votes
1

answer
331

Views

Use multiple edmx (from different databases) along with unit of work and repository pattern

I am working on a project with unit of work and repository pattern. Now there comes a new module that we need to integrate but having different database and edmx. Please help me out how can i extend my UOW and Repository to use two contexts. I have search a lot how to use multiple edmx. but didn't...
Gerry
1

votes
2

answer
534

Views

How to Select a Navigation Property efficiently in LINQ C#

I'm having Three Table Table #1 : BossEmp SNo JobID BossID EMPID StartDt _____________________________________________________ 1 1 6 1 05-20-2016 2 1 6 2 05-20-2016 3 2 7 3 06-20-2016...
1

votes
1

answer
458

Views

How do enable migrations to a Model First EF project? (edmx based)

I started a project using Model First project creating a empty EDMX file and created a whole new DB. this DB was populated with data on production server for weeks. Now I just add more columns to the table model. I would like to create a migration and run it in production server to migrate to a new...
Daniel Santos
1

votes
1

answer
786

Views

Why am I getting “Unable to load the specified metadata resource” error?

I have an MVC5 web application which I usually develop using my laptop. I am trying to get the app running on my main machine at home for home-working days but have a problem connecting to the local dev database on SQL Server - when I start the app I get the following error: More info 30/11/16: Not...
Vinyl Warmth
1

votes
2

answer
427

Views

Entity Framework classes to diagram [closed]

I have a bunch of classes with navigation properties and foreign keys. How can I visualise the relationships between these classes.
mehwish
1

votes
1

answer
81

Views

Making Entity Framework Aware of Tables/Column Renames

While Renaming Tables or Columns, how to ensure the edmx's 'Update Model from Database' recognizes the new Table Structure? MyTable has only 2 columns. ID name Refactor --> Rename (Ctrl R + R) myTableID fullName Which of the following would be the 'right' corresponding edmx changes, so the applicat...
DL Narasimhan
1

votes
1

answer
0

Views

When is the StoreGeneratedPattern attribute added to a property in the ssdl? (Entity Framework)

When I create a new diagram and 'Update model from database', the StoreGeneratedPattern attribute gets added to some primary key properties, but not all of them. What criteria does the designer use to decide whether to add this or not?
adam0101
1

votes
1

answer
0

Views

Forcing a bridge/join table to become a many to many relationship in EF4

I have a simple database with 2 main tables with a many to many relationship through a 3rd bridge/join table. This 3rd table has an extra field besides the two keys required, so that Entity Framework transforms it into a full entity rather than a many to many relationship between the other 2 tables...
SirDemon
1

votes
2

answer
0

Views

“No such column Extent2.<fieldname>” Problems

I've inherited a large c# project and am running into issues updating the data model. I have made my updates in the wysiwyg edmx data modelling editor (vs2010) and the updates seem fine. But it's hard to tell as when I run the program, immediately when it tries to access the database, I get this err...
Jason Spitkoski
1

votes
1

answer
0

Views

unify two models (edmx) with visual studio 2010

Hello as actually as i know you can not make relations between tow models or have in one models entities from two databases, it's a posibility two join two models both of them with existig databases behind? or there is some experience with a method like: move entities from the designer of one of the...
jlsfernandez

View additional questions