Suppose I have an Employee object with the following properties:...string Name { get; }
float Hours { get; }
float Wage { get; }
...I want to add a property, Salary, which equals Hours * Wage. In an ordinary business object, I would simply code that up in...
I'm experimenting with the Entity Framework and I want to connect to an Access 2007 database....The following code is inspired by ...http://msdn.microsoft.com/en-us/library/system.data.entityclient.entityconnection.connectionstring.aspx...I suspect that I...
EDIT:...During this post I started
searching on video tutorials on
ASP.NET MVC, EF and LINQ and found
some very useful links which I shared
here. As I believe videos are more
interactive and easier to learn from.
Hope, they'll help....Guys, pl...
How can I do a select in linq to entities to select rows with keys from a list? Something like this:...var orderKeys = new int[] { 1, 12, 306, 284, 50047};
var orders = (from order in context.Orders
where (order.Key in orderKeys)
...
i am using ASP.NET MVC & ADO.NET Entity Framework in a project. I want to add validation logic to my entities via partial classes. It works similar like shown in the ...NerdDinner.com ASP.NET MVC Application... which is using LINQ2SQL. The main difference...
I wrote a method to allow for an Expression to be passed in for the orderby clause, but I ran into this problem....Unable to cast the type
'System.DateTime' to type
'System.IComparable'. LINQ to Entities
only supports casting Entity Data
Model pri...
I'm using Entity Framework....In my database are stored persons and country of their origins. When I'm loading a person object I wan't to know what is the place each person originates. Is there a way to cache list of countries so that there wouldn't be un...
I am trying to do a simple JSON return but I am having issues I have the following below....public JsonResult GetEventData()
{
var data = Event.Find(x => x.ID != 0);
return Json(data);
}
...I get a HTTP 500 with the exception as shown in the title...
I've just started using Entity Framework rather than my normal NHiberante to see how EF works and so far I'm having lots of problems but one in particular is detaching an object and keeping the related child objects....
I bought the O'Reilly Entity Framew...
My table structure is this...Orders
------
Id int identity
OrderDate smalldatetime
OrderStatusid tinyint
Products
--------
Id int identity
Name varchar(50)
OrderDetails
------------
Id int identity
OrderId int (fkey)
ProductId int (fkey)
Amount decimal...
I've got an EF hierarchy that (dramatically simplified) looks something like this:...class Room { EntityCollection<Session> Sessions; }
class Session { EntityCollection<Whiteboard> Whiteboards; EntityReference Room; }
class Whiteboard { EntityCollection<W...
I'm stumped by this easy data problem....I'm using the Entity framework and have a database of products. My results page returns a paginated list of these products. Right now my results are ordered by the number of sales of each product, so my code look...
I'm using entities Framework in my project and it has been a nightmare!...I have a SQL DB were I have a table called Form....Form has an ID that is a PK and Identity (it's automatically increased)....This time I'm doing this:...Dim form as int32
Dim dbfor...
I need to add a custom property to an Entity Framework class, however when I do I get the "The property name XXX specified for type XXX is not valid." error. Is there some attribute I can give the property so it is ignored and not mapped to anything?...E...
I'm looking for an equivalent of the ...DataContext.GetTable<TEntity>... in Entity Framework.
I've found the ...ObjectContext.CreateQuery<T>... method but it is different from ...DataContext.GetTable<TEntity>... since it needs a querystring to work....Is ...
Can someone tell me how can I get MS Entity Framework working with PostgreSQL. ...Also: How does Entity Framewok work with Mono? Could you please suggest other similar ORM tools which would run on Mono and what is your opinion about them?
i am getting "The object cannot be deleted because it was not found in the ObjectStateManager". while Deleting object....here is codes ;...//first i am filling listview control.
private void Form1_Load(object sender, EventArgs e)
{
FirebirdEn...
I needed to add a new NVARCHAR column to a table in my DB. So I added the column, and then fired up Visual Studio to update the EDMX-file for the Entity Framework....I ran update model from database on everything, which only resulted in "data reader is in...
I am using Linq-To-Entities to do a query which is returning only 947 rows but taking 18 seconds to run. I have done a "ToTraceString" to get the underlying sql out and ran the same thing directly on the database and get the same timing. ...I have used th...
I've created a view in my database which I would like to include in my entity model. However, when I try to update the entity model through VS 2008, a warning message informs me that the TABLE OR VIEW I'm trying to add doesn't have a primary key. ...It se...