Hi,
Currently I am struggling with a Entity Framework issue. I have a wcf service that sits on top of the ef framework, and allows queries to the framework. At some point the user is able to request a file from the framework. The files are referenced by solution entries, so when you request a file from a solution, the reference is lo...
Hello.
i got some problems using EF with AutoMapper. =/
for example :
i got 2 related entities ( Customers and Orders )
and theyr DTO classes :
class CustomerDTO
{
public string CustomerID {get;set;}
public string CustomerName {get;set;}
public IList< OrderDTO > Orders {get;set;}
}
class OrderDTO
{
public string OrderID ...
I'm using the ASP.NET MVC and the ADO.NET Entity Framework together.
I want my Views and Controllers strongly-typed.
But how am I supposed to handle entity associations?
Here's a simple example:
A Person has one Department. A Department has zero or more People.
My controller passes an instance of a Person object and a collection ...
I have a project that implemented Linq To SQL, and I was pretty happy with it. For quite awhile the biggest problem was just that the designer was buggy.
Unfortunately, my project now requires multiple table inheritance, and Linq to SQL does not support it. I decided to switch to Entity Framework when I learned that it does support mul...
How can I use strongly-typed Controllers with EntityObjects?
My failures...
First I tried this:
[AcceptVerbs(HttpVerbs.Post)]
public ActionResult Edit(Guid id, Department Model)
{
db.SaveChanges();
return RedirectToAction("Index");
}
This failed to actually save any changes to the database. So, I tried to attach the model t...
I need to set an EntityObject's EntityKey. I know its type and its id value. I don't want to query the database unnecessarily.
This works...
//
// POST: /Department/Edit/5
[AcceptVerbs(HttpVerbs.Post)]
public ActionResult Edit(Guid id, Department Model)
{
Model.EntityKey = (from Department d in db.Department
...
What problems will I have if I change my Entity Framework queries from this:
var contracts = from contract in Context.Contracts select contract;
to this:
var contracts = from contract in Context.Contracts select new MyContract{ Key = contract.key, Advertiser = new MyAdvertiser{ Key = contract.Advertiser.Key } };
i.e. Changing from ...
Using ASP MVC and Entity Framework. In the view, you have a page declaration that specifies the model for this view will be a collection implementing IEnumerable. Let's say that collection holds Car objects, that are only from Ford (Ford being the Category).
<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" I...
This code fails to actually save any changes:
//
// POST: /SomeType/Edit/5
[AcceptVerbs(HttpVerbs.Post)]
public ActionResult Edit(Guid id, SomeType Model)
{
db.AttachTo(Model.GetType().Name, Model);
db.ApplyPropertyChanges(Model.EntityKey.EntitySetName, Model);
db.SaveChanges();
return RedirectToAction("Index");
}
ASP...
Reading about the lack of persistence ignorance in Entity Framework I often stumble upon POCO Adapter. The question is, does anyone use it in production, how does it go and what are the pitfalls?
I consider two alternatives for the application design: use POCOs with that adapter in business logic and make the presentation layer use them...
I have the following tables in the database (just a demo, of course):
Positions
PositionId
Limits
LimitId
PositionId
I want to left join them into a single entity (always have position, not always have a limit attached to it):
Position
PositionId
LimitId
I've seen articles regarding one-to-one mapping and "Table per type inherit...
Which approach is better: 1) to use a third-party ORM system or 2) manually write DAL and BLL code to work with the database?
1) In one of our projects, we decided using the DevExpress XPO ORM system, and we ran across lots of slight problems that wasted a lot of our time. Amd still from time to time we encounter problems and exceptions...
I have an existing model for my project. I would like to switch to Entity Framework but I don't want to replace my model with the model generated from EF.
Additionally, my model is very different from my database schema so any chances to use the model generated from EF and do all the required refactoring seems too hard.
Does exist any ...
I need to cast a property to its actual type dynamically. How do I/Can I do this using reflection?
To explain the real scenario that I am working on a bit. I am trying to call the "First" extension method on an Entity Framework property. The specific property to be called on the Framework context object is passed as a string to the meth...
Has anyone compared the speed of performance between LINQ to SQL against the Entity Framework?
I have heard that LINQ to SQL is 4 times faster than the Entity Framework, but I've never seen any bench marks or sample application proving this.
...
I've got two un-related (no FK's defined) tables. The first table contains some tasks for which a user may not have access. I need to find all those tasks - in this case, the joined table would contain nulls. How do I get them?
Here's the setup:
TimeData table
- userID
- taskID
- hours
ApprovedTasks table (the one that should co...
As the title of the question states... I've got a database that is using a supercedes model to store information... meaning that each time a customer is edited, instead of updating the row, the software simply slams a new record into the database, and then updates the old records to have a pointer to this new record.
I was trying to dra...
I am trying to search an XML field within a table, This is not supported with EF.
Without using pure Ado.net is possible to have native SQL support with EF?
...
I have an ASP.NET application that uses a layered architecture e.g. presentation layer, business logic layer, data access layer.
I don't want to the business layer to have to know anything about how the data access layer is implemented and I'm not looking to bind the Entity's directly to a data control using the EntityDataSource or anyt...
In my ASP.NET application I want to implement by data acess layer using the Entity framweok so I can use it as an ORM tool. But I dont want the rest of the application to care that I'm using this or be polluted by anything entity frameowrk specific.
I cant seem to find anyone who is using the entity framework exclusively in their Data a...