entity-framework

How to use Default column value from DataBase in Entity Framework?

I have a Date column in table which has default value or binding as getutcdate(). I want to use this in entity framework.On generating EDM I was able to find "Default Value " property at column level but I think it is for hardcoded value. Please let me know how can I use default value specified in database. Thanks, Mak ...

What are the known limitations of ADO.NET entity framework designer?

We just found an issue like, when a foreign key relationship is broken, there is no way to re-establish the link in the designer. Any other such known limitations of Entity Framework designer? ...

Any reason to use "Entity SQL" if you can use LINQ?

Reading a book on Entity Framework and they say that LINQ is only available for C# and VB.NET. But for other languages you can use Entity SQL. If you are doing a project in C#, is there any reason to use Entity SQL anyway? Any experiences with this? ...

What is the way to make a select on a nullable foreign key field in Entity Framework?

Hi, I have a category table which has a foreign key to it self by a nullable parentId field. In Entity-Framework when a relation is created, the entity is generated without any relation fields. I mean, in my example when I created a parentId-Id relation in Category table, the generated Category Entity will have an int typed Id property ...

WCF Contracts from Entity Framework?

I've been coming up with a lot of dead ends on this question. Supposedly, .NET 3.5 SP1 has Support for ADO.NET Entity Framework entities in WCF contracts. But when I look for solid info on it I'm not getting a lot of answers. I found this one snippet on an MSDN thread. Does anyone have any experience with this? What happened to the [...

Entity Framework mapping

Has anyone a good sample for a "real" mapping scenario with Entity Framework. Not one of that simple Table <-> Entity one ;-) ...

Execute a stored procedure in Entity Framework from within an ADO.Net DataService

I am using ADO.Net DataServices to expose an Entity Data Model to Silverlight. The model has a stored procedure that returns void. I want to call this procedure from the Silverlight client. My understanding is that I should add a [WebInvoke] method to the DataService class and use DbCommand to call the stored procedure. Here is my co...

Entity Framework: Update multiple rows in set with data from other set

I simply want to achieve this line of SQL: UPDATE table1 SET table1.col = table2.col FROM table2 INNER JOIN table1 ON table2.id = table1.id How can that be done using entity framwork with minimal number of roundtrips? All I can think of is using foreach to loop through my table2 and update it's related entry in table1. But that d...

Will .NET 4.0 enhance Entity Framework many-to-many coding?

I'm working on a project using the entity framework code from 3.5 SP1, but although everything works great for the most part, many-to-many tables seem to need alot of workaround coding. Does anyone know if things will be easier in the next .net release? ...

How can I see the Entity Framework's pending changes?

I'm creating an application with the ADO.NET Entity Framework. I can step through my code line-by-line while debugging and watch SQL Server Profiler for every query executed, but I can't figure out where all those SQL commands are coming from! Sometimes when I execute SaveChanges(), the Entity Framework performs unexpected, weird INSER...

Should I learn Linq to SQL even though its being rolled into Entity Framework?

I am looking to learn Linq to query MS SQL databases, but am unsure of which path to take. I read recently that Linq to SQL is being rolled into Entity Framework, and development has maybe stagnated. Is it worth learning Linq to SQL still? Or should I be focusing on Entity Framework or another Object Relational Model like Ideablade's De...

Are there any statistics on ORM usage / popularity?

I'm looking for some statistics on the usage/popularity/availability/etc of object relational mapping frameworks (ORMs). An example might be how the number of downloads of a specific ORM has changed over time. Does anyone know of any such statistics? Edit: A little clarification: The reason I want the statistics is to be able to back ...

Entity Framework - Only updates the first char of the data table columns fields

I've just recently been using the EF just because I thought it was simplier and faster to have a DAL that way...but it's a pain in the ....s After solving severam problems I can't sucessfully updade dada from my tables in a sql database. I have a aspx form that edits some fieds in the entity object (System.Data.Objects.DataClasses.Enti...

setting width of datagrid generated by Dynamic data (Entity framework, in .net)

Hi I am generating editable data grids from tables using dynamic data, however, i am unable to set the width of the tables/grids. Can someone please point me to an article/ or suggest how i can do this? Thanks in advance. Regards. Kulu. ...

Entity framework getting around unsupported methods

ADO.NET EF does not support things like Math.Pow and Math.Log so I was wondering how I can get around this. I need to be able to use an ORDER BY on a calculated value using ADO.NET EF. ...

Most complete ORM with LINQ support?

I'm looking for an ORM that offers complete or near-complete LINQ support. LINQ to SQL - Supports about everything inside of LINQ (.Contains, Math.Log, etc) - Cannot eager load relationship properties without creating a new datacontext ADO.NET Entity Framework - Terrible LINQ support (lots of missing features). - Great mapping features...

Comparing dates in Entity SQL

What is the correct eSQL syntax to compare dates? The equivalent LINQ-to-Entities expression would look something like this: var lastYearsShipments = from p in MyDataServiceContext.Products where p.ShipDate.Value.Year == DateTime.Now.Year - 1 select p; ...

Mocking an Entity Framework model?

Is it possible to mock an EF model so that I can test code which uses the model classes without getting rid of LINQ to Entities code strewn throughout my project? Or will it be necessary to set up a test database for the model to hit instead? ...

Advice Please: SQL Server Identity vs Unique Identifier keys when using Entity Framework

I'm in the process of designing a fairly complex system. One of our primary concerns is supporting SQL Server peer-to-peer replication. The idea is to support several geographically separated nodes. A secondary concern has been using a modern ORM in the middle tier. Our first choice has always been Entity Framework, mainly because th...

Inheritance problems with Entity Framework (table per type)

For part of the project I'm currently working on, I have a set of four tables for syndicatable actions. One table is the abstract base for the other three, and each table is represented in my EF model like so: There are two problems that I'm currently facing with this, however. The first problem is that Actor (a reference to a User) a...