I'm new to the Entities framework.
One week earlier I've hit the common problem of the currentcontext that throws exception if used in a non-unique manner, but that was fixed.
Today I have a new problem, a really new one because I do not even know why this is happening since I do think that I have the same code.
Here is the error that ...
Hi,
I have:
"Task" Entity that holds a foreignkey to a "Project" Entity.
In the MVC model I have a ProjectDetails view where i have a ActionLink for creating a new Task
I need to set the ProjectReference for the new Task object.
The projectReference is passed by a url parameter (CreateTask?projectId=4)
In the projectDetails view I ha...
I know how to mark a group of fields as primary key in ADO.NET entities but i haven't found a way to declare unique constraints or check constraints.
Is this feature missing on the designer or on the framework?
Thanx.
...
I have an application where I create database's dynamically in a SQL Server using Server Management Objects through my application.
I want to use the Entity Framework to access this database when it has been created, is this possible? As I can not generate Entity classes from a database in VS. I do have the structure of the database ...
I am just learning to use the Entity framework and I wondered how I can bind to a select few columns with my WPF Toolkit datagrid?
Can someone give me an example?
I've tried to set the DataContext to the Person Entity for example and then set the Itemsource binding path to a single column of the table, but it does not work.
...
Let's say I have a Users table and a UserDetails table related with identifying relationship ( UserId is a PK of Users and PFK of UserDetails).
What I've noticed is that when I'm querying Users entity, EF generates SQL with a clause:
Users left outer join UserDetails
which doesn't really make sense, since only Users columns are selec...
I'm developing an application in C# that will use and store geographic locations using the data type "Geography" in SQL Server 2008. I was planning to use the Entity Framework but soon discovered it lacks support for spatial data. Does anyone have experience with or know of other OR mappers with spatial support?
The system will have few...
There is a web-application that works with Business Logic Layer (BLL). The BLL gets data from the Data Access Layer (DAL). The DAL gets data from DB through and does custom mapping.
At the moment it is required to add into the web application some functionality that will be Silverlight-based. It is planned to use .NET RIA Services for t...
So, when you bind a collection of Entity objects to a grid component, the grid displays those fields in the sequential order they are found in the SQL Table they came from. This shows that the ordinal position of the fields are associated with their corresponding entity properties... somehow or other.
So here is the question: How can ...
I have a SQL View (SQL Server 2008) that contains 4 columns and works just fine in SSMS. I added the SQL View via Database Update to my Entity Framework model. No complaints, but I noticed that EF decided to make 2 of the 4 columns EntityKeys.
The problem I'm having is that when I run the query in my app code, I get the right number...
Hi,
I've implemented unit testing along the lines of this article with a fake object context and IObjectSet with POCO in EF4.
http://blogs.msdn.com/adonet/archive/2009/12/17/test-driven-development-walkthrough-with-the-entity-framework-4-0.aspx
But I'm unsure how to implement a couple of methods on my fake object context for testing. ...
ok i use this route
routes.MapRoute(
"Catalog/Data",
"Catalog/{*data}",
new { controller = "Catalog", action = "Category", data = "" }
);
the Url looks something like http://localhost/Catalog/Computer/Harddrives/internal
Data beening the Computer/Harddrives/internal part
i split it apa...
See this scenario:
1-I have a single ObjectContext instance shared between multiple business logic layer classes to avoid identity and tracking problems when using multiple object contexts.
2-An object of a class tries to create and insert an entity but an exception takes places (because of a foreign key constraint, unique key constrai...
Earlier I created an AddClient page that (when posted) passed a client object and I used db.AddToClient(obj) in my repository to persist it. Easy stuff.
Now, I have a details page whose save submits a post to an action "UpdateClient". Before that action is hit, my custom model binder creates my Client object and it's conveniently hand...
I have an entity set that contains two DateTime properties. I want to order the set by the minimum value of the two properties. How can I do this with a lambda expression.
...
I have a 2 Entity : Person (Id, CategoryId) and Category(Id).
Now when I try to insert a new Person with only the Id and CategoryId it throws an exception about the Person having a relationship with Category.
The following code doesn't work:
Person newPerson = new Person();
newPerson.Id = 1;
newPerson.CategoryId = 1;
context.AddToPer...
Hello,
I'm have an issue with this entity query that I am hoping to get some help with.
Overall what I am trying to do is query for entries in the GoalNotes table as well as include the Employee reference for each note. The GoalNotes table has a foreign key relating it to the Employee table.
I am then trying to query the GoalNotes tab...
Hey!
I have this LINQ-query:
bool? a, b, c;
from i in _ctx.SomeEntitySet
where
(a == null ? true : i.IsA == a) &&
(b == null ? true : i.IsB == b) &&
(c == null ? true : i.IsC == c)
select i;
I only want to take the condition IsX == x in...
I'm stuck trying to map this sql:
select dt.Id, dateadd(dd,datediff(dd,0,dt.CreatedAt),0) as Ct, DId, Amount
from dt, ad
where dt.ADId = ad.ADId and ad.Id = '13B29A01-8BF0-4EC9-80CA-089BA341E93D'
order by dateadd(dd,datediff(dd,0,dt.CreatedAt),0) desc, DId asc
Into an Entity Framework-compatible lambda query expression. I'd appreciate...
I have a web app that sends ADO Entity data model classes over a WCF service to Silverlight.
Imagine this simplified structure for the database
[Item]
Id
Name
[ItemDetail] Id ItemId value
While the Item is in my SilverlightApp I add an ItemDetail to the Item, this is ADO so it's something like:
var fv = new ItemDetail();
...