edmx

Visual Studio 2013 and Entity Framework 4

杀马特。学长 韩版系。学妹 提交于 2019-12-11 22:11:48
问题 I'm working on an older project that uses Entity Framework 4 in Visual Studio 2013. When going to "Update Model from Database" it only gives me EF 5 or EF 6 to choose from when updating the database. This installs EF 5 in my project and upgrades it from EF4 to EF5. I attempted converting the project to EF5, but entity framework has a bug where classes in different name spaces cannot have the same class name in the entity model. This would require a WHOLE LOT of changes. Reading about EF 6,

AutoFixture EF entity constraints

99封情书 提交于 2019-12-11 18:49:45
问题 Is it possbile to configure AutoFixture so that it adheres the entity constraints [from the EDMX file]? E.g. Consider a snippet from the CSDL section of my EDMX file: <EntityType Name="RndtAd"> ... <Property Name="AD" Type="Decimal" Precision="12" Scale="0" Nullable="false" /> <Property Name="USERNAME" Type="String" MaxLength="255" FixedLength="false" Unicode="true" /> <Property Name="VERSION" Type="Decimal" Precision="12" Scale="4" Nullable="false" /> <Property Name="EFFECTIVE_FROM" Type=

EF Database First refusing to map a table

99封情书 提交于 2019-12-11 17:45:33
问题 I'm generating a model (EDMX) from a SQL Server database, and each time I generate it, it omits one table. I've tried deleting/recreating the table in the database and deleting/recreating the model but it still happens. The table is a many-to-many linking table: Companies (CompanyID, Name) Sectors (SectorID, Name) Companies_Sectors (CompanyID, SectorID) <-- this table doesn't get mapped There are many identically structured tables that do get mapped so it's baffling me. I created this one

I can't update my edmx since the Entity Data Model Designer is unable to open it

大城市里の小女人 提交于 2019-12-11 15:07:26
问题 Hi everyone and thanks for taking the time to see my question. I'm running VS 2017 with Entity Framework 6 and asp.net MVC and have to add some field to one of my Entities. I added the corresponding fields in the database, but when I open the edmx file nothing shows apart the message "Entity Data Model Designer is unable to open this file." and it proposes me to open it in XML editor, but I have not the "Update model from Database" option when right clicking on the XML file. Is anyone knows

Populating a select box in a form using related ID in MVC3

妖精的绣舞 提交于 2019-12-11 13:53:10
问题 I have a very simple data structure with two models. The first containing UserName, UserQuestion and userLocationID and another with LocationName and LocationID, the locationID in the first table is related to the LocationName the second table. However I've not specified any relationship. I've set up the data structure using the code first method in used here . I would like to create a form which has two text inputs for a user to enter their name and question and a select box that is

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

倖福魔咒の 提交于 2019-12-11 10:35:35
问题 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: I found myself in the same problem. What it works for me is follow the explanation in this ticket: https://system.data.sqlite.org/index.html/tktview/2be4298631c01be99475 But basically, after deleting the following

Extending Entity Framework 6 - adding custom properties to entities in designer

点点圈 提交于 2019-12-11 08:44:10
问题 The problem: I want to be able to extend EF6 in a way that enables me to define Caching policy, Transactional policy, Multi-tenancy , etc on a single entity in an EF edmx file. I am willing doing this with designer. I've managed to make an extension like suggested in http://www.databinding.net/blog/post/2010/12/02/entity-framework-4-benutzerdefinierte-eigenschaften-mit-dem-adonet-entity-data-model-designer-ext.html but after installing the vsix the properties are not there. Restarted VS etc

EF EDM Builder Oracle Number(1, 0) -> Int16/Bool

情到浓时终转凉″ 提交于 2019-12-11 03:53:11
问题 I am using EF with an oracle database. One of our columns in the database has a data type of Number(1,0). This field stores data that translates to Int16 in C#. Entity Data Model (EDM) builder in visual studio maps this column as Bool default. This causing data type errors. What I want to do is configure the model generator to set number(1, 0) as a Int16 field all the time instead of bool. How would I do this. I also want to mention that when a fellow developer builds this model on his

Entity Framework 4.1 Code First EDMX issue

眉间皱痕 提交于 2019-12-11 03:09:56
问题 The way I handle large projects using EF CF is by doing the following: Create a data model (EDMX) Disable the Model-First code generation feature for that model by clearing the Custom Tool property Use Entity Framework POCO Generator extension to add the relevant template (t4) files to the project Customize the template files to follow certain coding conventions we follow This all looks good in concept but when we run the project, EF seems to think we are using the Model-First approach. This

With one EDMX file use multiple connection strings that relate to multiple databases

拟墨画扇 提交于 2019-12-11 00:04:37
问题 I've got a program that has one .edmx file and in the app.config has three connection strings. The schema that the .edmx represents is the same for 3 databases: Production Staging Development and I want to make a method that basically does this (warning! Pseudo-code incoming) foreach(var connectionString in connectionStrings) { using (MyCustomDBEntities context = new MyCustomDBEntities(connectionString)) { // Do cool things, like insert new records, update records, etc... } } Right now the