Questions tagged [edmx]

0

votes
0

answer
7

Views

Updating edmx from VS 2017 showing error (Oracle database)

I am trying to update my edmx file using VS 2017 but each time I click on Update model from database option it is showing me the below error . In my system ODTwithODAC1120320_32bit is installed. I could update the edmx from VS 2010 successfully. Now I have installed ODAC for VS 2017 from link bu...
Arunprasanth K V
1

votes
1

answer
823

Views

Extending Entity Framework Model to include new class

Noob question I'm using Entity Framework in my project, it generates the entities in the designer, like: public partial class CLMEntities : ObjectContext I have another class in the project that I want CLMEntities to inherit from for more functionality: public class MoreFunctionality ...of course I...
avnic
1

votes
2

answer
552

Views

How to keep the “Provider Connection String” separate from the EF (EDMX) metadata information?

I would like to be able to handle the actual Connection String and the EF metadata connection string separately in the config (app.config, web.config) - the goal is to make the actual data-source more apparent. I have complete control over creating the EF Context (yay IoC!), but don't want to hard-c...
user2864740
1

votes
2

answer
5.5k

Views

Cannot implicitly convert type 'System.Data.Entity.Core.Objects.ObjectResult<>' to 'System.Collections.Generic.List<>'

I am trying to update an EDMX Stored Procedure and I am getting this error: Cannot implicitly convert type System.Data.Entity.Core.Objects.ObjectResult to System.Collections.Generic.List I am using Visual Studio 2013.
Vishal Kiri
2

votes
2

answer
454

Views

Problems with LINQ WhereClause

Many thanks to leppie: Currently I got Expression whereClause= null; List mailMergeItems = null; int personType = mailMergeSettings.PersonType.ToInteger(); if (personType > 0) { whereClause = this.MailMergeWhereClause(whereClause, f => f.MemberTypeId == personType); } if (mailMergeSettings.PersonI...
Theun Arbeider
1

votes
1

answer
3.6k

Views

Using [NotMapped] to pass additional info to the view, when following Database first approach

I am working on an asp.net mvc-5 web application, and i am using entity framework 5.0. I have mapped my SQL server database tables which created an .edmx file. now i want to extend the model classes to have additional non-database attributes, so i created a partial class for my model class and i pro...
john Gu
2

votes
1

answer
1.1k

Views

How to switch between SQL and SQL CE in Entity Framework 4? Or how to programmatically change the “Schema Namespace” inside an edmx file

Working with a model first approach on Entity Framework 4, I'd like to switch the database from real SQL (Data.SQLClient) to SQL CE (Data.ServerCe) back and forth. I know how to do it manually: Change the provider from System.Data.SqlServerCe.3.5 to System.Data.SqlClient change the connection string...
Cilvic
5

votes
2

answer
3k

Views

How to convert complex type to actionresult

I am new to MVC, and trying to call a stored proc from the controller. In the model I have edmx which has all stored procs as functions Cannot implicitly convert type System.Collections.Generic.IEnumerable to System.Web.Mvc.ActionResult An explicit conversion exists. I created an object for the enti...
Vignesh Subramanian
2

votes
1

answer
365

Views

Changing Schema Names of all tables in EDMX

I recently moved all the tables in SQL Server to a new schema, lets say XYZ. Now I want to update my edmx, to refer to tables that are under new schema XYZ. How do I do that? All it allows me currently is to add all the tables from the XYZ schema to the edmx.
2

votes
0

answer
418

Views

Cannot insert explicit value for identity column in table 'MyTable' when IDENTITY_INSERT is set to OFF

I added a new table called JobFieldMapping in my database, and set a field as a primary key, and the IDENTITY (1,1). I update the .edmx file. So, all should be work well, but on the savechanges() I got the error: Cannot insert explicit value for identity column in table 'JobFieldMapping' when IDENTI...
DevT
17

votes
5

answer
23.3k

Views

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 see those tables under add tab, but only under the "r...
Or A
17

votes
1

answer
13.7k

Views

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 ...things needed for the entity connections. Example w...
Mirek
18

votes
1

answer
8.4k

Views

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 be clobbered the next time I update the database a...
Rap
18

votes
4

answer
4.5k

Views

Entity Framework edmx click on diagram very slow

Background first: I have a database-first EF6 model in Visual Studio 2015 (latest nuget 6.1.3 pointing to a local SQL Server 2014 SP1 Express database) on a Windows 10 Pro laptop. After I upgraded from Windows 8.1 and Visual Studio 2013. I also upgraded the model from EF5 about 6 months ago as well,...
Tree
2

votes
1

answer
1.4k

Views

Switching in Entity Framework 4 between SQLCompact and SQLExpress storages

Here's the use case In SQLExpress I have created a table Posts with columns ID and Name edmx is created based on that table I create the SQLCompact database with the same structure (table name Posts, columns ID and Name) If I update the app.config to point to the SqlCompact DB (presuming I do that...
Nikola Malovic
3

votes
1

answer
440

Views

Entity Framework EDMX file size disproportional big (many megabytes)

This morning I used the Entity Framework designer to update my model from the database to select a single table. Out of nothing thousands of lines of XML were added to storage model of the EDMX file which had grown from 244 KB to over 14 MB. However, little has changed in my database since the last...
Steven
20

votes
3

answer
3.6k

Views

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 descriptions and use them to add comments to my generated clas...
Jack
2

votes
1

answer
1.3k

Views

How to map Stored Procedures with EF4?

Is it possible to map stored procédures whit EF 4 using T4 templates ? I have searched and I conclude that it is not possible yet. It exist some methods like Edm.SourceComplexTypes(), Edm.SourceAssociations(), Edm.SourceEntities() but nothing about stored procedures ... Someone have any answer ? Th...
gtoulouse
4

votes
1

answer
709

Views

entity framework model to database with indexed properties

I'm using EF 5.0 and diagram modeler (*.edmx) to create schema and generating database from model, and I was wondering if there is any way to create index on some property (only) via this modeler. Many thanks for answer or advice. //edit I'm working on it, if I success, I'll share a little "how to"...
eCorke
5

votes
1

answer
12.3k

Views

Entity framework - create the csdl, ssdl and msl files

I work with EF 4 (not with Self-tracking entities currently). I've added some columns (non of them is a key and all of the are nullable) to one of my entities, and got the Number of members in conceptual type does not match with number of members on object side type exception. I've followed the acce...
Noich
2

votes
1

answer
2.6k

Views

Generating Entity Classes using edmgen

I have a edmx file created using the entity entity framework model. Whenever I make some changes in the edmx(Like removing a column from the entity), I would like to generate the entity classes(Designer.cs). I know I can do this by right clicking the edmx file and Run custom tool I wanted to do this...
KhanS
5

votes
3

answer
3.8k

Views

Do I add the same table in multiple entity framework bounded context

I have a fairly big database, about 80 tables or so. So I've decided to separate the tables into bounded context instead of having all 80 tables in 1 big edmx file. So I have bounded contexts like Sales, Customers, etc. I have my main customer table within my Customers edmx file. However, I also ne...
Null Reference
6

votes
2

answer
3.7k

Views

Best Practice - Mixing Table-Entities with View-Entities in EntityFramework?

I have a legacy database that I'd like to interact with Entity Framework. The database is highly normalised for storing information about flights. In order to make it easier to work with some of the data, a number of SQL Views have been written to flatten data and to pivot certain multi-table joins...
Eoin Campbell
2

votes
1

answer
4.3k

Views

Profile Image in AspNet Identity

In my application I want to show user profile image in layout page (_LoginPartial). In AspNet Identity membership their is a AspNerUser table . I want to customize this AspNerUser table to maintain image field. then show that image in Layout page (_LoginPartial) view. How can I do this ? Really app...
Chathz
2

votes
2

answer
583

Views

EDMX update model from database Timeout

I have a MSSQL DB with about 3300tables (don't ask why, that's Nav...). When I try to "Update Model from Database..." on my EDMX I am getting a timeout exception 99 times out of 100. So my question is, is there anyway to change the timeout? I have tried to set "Connect Timeout" in the connection str...
2

votes
3

answer
5.3k

Views

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

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 conf...
danmanallen
4

votes
5

answer
321

Views

The number of members in the conceptual type does not match - yet it does

I've suddenly started getting the following error in a .NET 4 MVC project. The number of members in the conceptual type 'OrnaviModel.Task' does not match with the number of members on the object side type 'Ornavi.Core.Objects.Task'. Make sure the number of members are the same. The project uses an...
Gavin Coates
11

votes
3

answer
7.2k

Views

Entity Framework 4 (using EDMX), how to add a field into to model that DB does not have the field actually

I need to add a field into model that Database does not have the field actually. Because, firstly I tried to add the field into Entity class only. public partial class Weborder { (Auto Generated) public int orderno {get; set;} . . . (Add Manually) public string newField1 {get; set;} //this is new fi...
Expert wanna be
11

votes
3

answer
21.4k

Views

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 with some instructions on how to properly implement...
TMan
4

votes
2

answer
3k

Views

Entity Framework: LINQ Include() does not work after DB update, why?

I am new to Entity Framework and LINQ and have run into a rather odd scenario. I have been using the following query to return account information: var account = ((from acct in _entities.Account join m in _entities.Item on acct.Id equals m.Account.Id where acct.Id == accountId && m.ItemNumber.EndsWi...
MurfDawg
2

votes
2

answer
2.9k

Views

Is it possible to generate an EF data model (edmx) from code first POCO classes?

I like the Code First approach, but often I would prefer a visual model. The edmx model is a lot friendlier and neater for modelling a 'data model' than VS class diagrams, so it would be nice to generate an edmx from the code first POCOs and start round trip engineering, seeing as it is possible t...
ProfK
5

votes
1

answer
5.2k

Views

Modifying the edmx template file

I'm using EF 6.02 with Visual Studio 2013. What I need to do is to be able to modify the Model.Context.tt file (generated when creating or modifying the EDMX file) to place certain attributes and namespaces in the generated POCO classes so I don't have to manually place the attributes in there again...
sagesky36
4

votes
2

answer
4k

Views

Need to generate EDMX files and compile them

My question might be little bit different or basic for advanced users here. I have a web application which is customizable by administrators. This means, the admin can add new table schema or edit table columns, add new table columns etc. These changes are mapped to our logical objects (much simil...
Bepenfriends
6

votes
2

answer
25.7k

Views

How to execute raw sql query with in entity framework?

I'm using asp.net mvc 3 with entity framework 5. I have my .edmx file & able to interact with my database using linq or SP, but I want to run some raw sql statement. I'm trying something like this: Using(var ctx=new HREntities()) { ctx.Database.ExecuteSqlCommand("insert into Employees values {0}, {1...
Badhon Jain
2

votes
2

answer
1.8k

Views

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

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 sam...
ProfK
1

votes
3

answer
693

Views

Cannot convert type 'System.Collections.Generic.List<website.Class1>' to 'System.Collections.Generic.List<library.Class1>'

I'm using MVC on .net 4.5. I have separated models from website into a class library, and have tt class file of .edmx replicated to my website so i can access model classes. Though when I return some data from library like this, List a = objLibraryRef.GetFileLists1(); i get this error. Cannot conve...
Pravin Deshmukh
4

votes
2

answer
3.9k

Views

How to get the maximum length of a string from an EDMX model in code?

I've created an EDMX object from a database I'm programming against. I need to get input from a user and save it to a row in the database table. The problem is that I need to limit the length of input strings to the width of the corresponding VARCHAR column in the database. When I browse the model,...
Daniel Allen Langdon
4

votes
1

answer
750

Views

Running transformation failed due to unknown namespace with keyword “using”

I would like to use the "Using" element in my *.csdl in order to import a other namespace, and use POCO to transform the objects. I use a CSDL looks like this: (http://msdn.microsoft.com/en-us/library/bb738545.aspx) However when I use a template (POCO) in order to transform my CSDL, the run tool thr...
Sam
4

votes
1

answer
1.7k

Views

Entity framework metadata exception - No csdl, ssdl, msl in dll resources

I have DAL (model first entity framework 4.1) and Service which is using it in separate projects. Everything was working fine, but after some minor changes (for example I generated model from database) it stoppedd working. I am now getting metadata exception. After many hours of research I download...
2

votes
1

answer
1.1k

Views

Visual Studio UPDATE-EDMX feature: How it works

When you use the update-edmx feature of visual studio. Your EDMX schema is merged against a database. What Rules Apply to changes merging? UPDATE: looks like new db fields are added to your edmx, modified fields are merged in someway and deleted ones are left in your schema.
SDReyes

View additional questions

Смотреть фильмы онлайн бабушка легкого поведения 2 фильм бесплатно