edmx

.NET Data Model is shown as XML and not as Diagram

萝らか妹 提交于 2019-12-06 03:10:48
问题 That is. I format my computer and install the entire enviroment again, but I can't see the data model diagram. I mean, I open the data model (edmx file) and I see all the DB tables and DB information in an XML file. Not the diagram. I installed vs2010 sp1, net framework 4, micro net framework 4.1, entity framework 4.1 I don't know what I am missing. Can you help me? Without that I cannot update the model. Is seems easy but I don't know how to solve it. 回答1: If you open the EDMX file in the

EF4: Get the linked column names from NavigationProperty of an EDMX

久未见 提交于 2019-12-05 19:11:50
问题 I am generating POCOs (lets say they are subclasses of MyEntityObject ) by using a T4 template from an EDMX file. I have 3 entities, e.g.: MyTable1 (PrimaryKey: MyTable1ID) MyTable2 (PrimaryKey: MyTable2ID) MyTable3 (PrimaryKey: MyTable3ID) These entities have the following relations: MyTable1.MyTable1ID <=> MyTable2.MyTable1ID (MyTable1ID is the foreign key to MyTable1) MyTable2.MyTable2ID <=> MyTable3.MyTable2ID (MyTable2ID is the foreign key to MyTable2) Or in another view: MyTable1 <=

Entity Framework with MYSql, return no column in complex entity return type

大兔子大兔子 提交于 2019-12-05 18:47:22
I'm using MySQL in combination with an edmx file. I'm facing a problem when adding a function to stored procedure. When I select "complex type" and press the "get column information" button I receive the following message: "The selected stored procedure returns no columns." When I create the same procedure in SQL Server and then added the function to a new edmx file, its creating the complex type perfectly. Thanks, Nauman 来源: https://stackoverflow.com/questions/9940749/entity-framework-with-mysql-return-no-column-in-complex-entity-return-type

does Visual Studio 2015 include .edmx support?

▼魔方 西西 提交于 2019-12-05 16:43:48
问题 Does Visual Studio 2015 include .edmx support? I have a project that includes an .edmx data model and double-clicking it in VS2015 just opens the XML editor. There's no DbContext generator option in the file->new dialog. 回答1: During setup of VS2015, go to the advanced options and select Web or Database Development tools. Now the Installers install the EF tools (Designer + templates). If you have VS already installed, to the Programs & features in control panel and modify the currently

POCO Class in EF not working as Expected

给你一囗甜甜゛ 提交于 2019-12-05 07:24:47
I have created a DataBase in SQL and created an EDMX in Visual Studio 2012. It automatically created POCO (TT) classes. Everything looks fine. Now I change the column name of a table. I update the EDMX. Opening the EDMX in XML and everything looks fine. Question 1 After I ran Custom tool in TT, I see that a new property got created additionally, e.g.: SQL table name : Student Column name : sName In my POCO Class public int sName{ get; set; } got automatically created. Now I change the column name in SQL to Column name : studentName My POCO class public int sName{ get; set; } public int

Can Entity Framework 4.1 designer “update model from database” for selected entities only?

倾然丶 夕夏残阳落幕 提交于 2019-12-05 05:46:39
The situation: Sometimes a database schema is not what you would consider an ideal representation of the system's information and you may not be able to change it. We have been using Entity Framework to create a nicer conceptual model to code against in situations like this. This means updating the model from the database and then changing it ourselves, either through the designer or through the .edmx file directly using a text editor. The problem: When you update the model from the database, all your carefully made changes are thrown out the window. This can make adding new entities a real

MappingException Edm.String not compatible with SqlServer.varbinary

走远了吗. 提交于 2019-12-05 05:31:31
I am having a difficult time resolving a silly mapping problem. Basically what is going on is that I have a field in a sql db table that is a varbinary for the purposes of security (encryption and decryption). All that stuff is all well and good but it seems as though the edmx sees the field in that table as a string which I thought it should see it as given that the data is just a binary string. This is the error message I get. Schema specified is not valid. Errors: ReadModel.Model.msl(836,12): error 2019: Member Mapping specified is not valid. The type 'Edm.String [Nullable=True,DefaultValue

EF6 code first: How to load DbCompiledModel from EDMX file on startup?

天涯浪子 提交于 2019-12-05 02:59:47
I want to reduce startup time in EF6 by caching the DbCompiledModel to disk. It's easy to write the EDMX file for a DbContext: EdmxWriter.WriteEdmx(myDbContext, XmlWriter.Create(@"C:\temp\blah.xml")) And it's easy to pass a DbCompiledModel to the DbContext: var db = new DbContext(connectionString, myDbCompiledModel) However there doesn't seem to be any way to read the EDMX file from disk into a DbCompiledModel! How can I do this? NOTE that I have successfully implemented the solution using the EdmxReader tool in this branched version of EF6: https://github.com/davidroth/entityframework/tree

The complex type 'MyData.AssetReading' refers to the entity type 'MyData.Asset' through the property 'Asset'

余生颓废 提交于 2019-12-04 22:01:05
Looking at setting up Web API odata and trying to expose the data out of our edmx to it. The problem is that every time i add an entity to the OdataConventionBuilder I get a big nasty error message on load saying: The complex type 'MyData.AssetReading' refers to the entity type 'MyData.Asset' through the property 'Asset' It seems for relations defined in the edmx is bombing the webapi odata out about a complex type. Any ideas on how to get around this as the edmx is huge and a rejig of it is pretty much out of the question. Is there a property that I need to set on the Builder.EntitySet or the

How do I adapt the Entity Framework POCO T4 template to create classes in a separate project?

旧时模样 提交于 2019-12-04 15:51:32
I like to to keep my code first - or T4 generated - POCOs in a project separated from the DbContext. This helps me ensure my entity classes aren't coupled to any one data access service. When I create a new DB first EDMX model, the wizard generates a T4 template to generate all the POCOs in the same project as the DbContext. How can I modify this template to add classes to a separate project? On closer inspection, it would probably be much easier to move the DbContext to a new project, but the T4 for this has no call to fileManager.StartNewFile so i don't know where to begin telling it to