I have a many-to-many relationship between Accounts and PaymentSystems. I want to list all PaymentSystems not yet assigned to an account. To achieve that, I'm trying to use the following LINQ to Entities queries:
PaymentGatewayEntities pge = new PaymentGatewayEntities();
Account account = pge.Accounts.Single(item => item.id == accountId...
There are so many terms and it is getting hard to learn the thing you are after because of the noise.
Is Linq to Entities just the practice of using Linq queries against the entities generated by the ADO.NET Entity Framework? Or, is it a separate technology?
If it isn't a separate technology, why does it have another confusing name as ...
Hi there,
I develop an application using WPF with MVVM pattern and Prism. The views are added to the ModuleCatalog and the viewmodels are registered to a unity container. For that I'm using a Bootstrapper which is responsible creating the shell, configuring the unity container and the module catalog.
The question is now, how injecting m...
Hi all,
I was wondering if there was a generic way to log changes/additions/deletions for each object using EF 4.0.
I know you can override the int SaveChanges(SaveOptions options) method but i'm not sure what i should put in there.
Thanks
...
I'm using Entity Framework 4 with MVC and need to ensure any referenced entities I want to use in my view have been loaded before the controller method returns, otherwise the view spits out the dreaded:
The ObjectContext instance has been disposed and can no longer be used for operations that require a connection.
When selecting s...
I have an Edit page in my application that contains a DropDownList.
This DDL is bound to an EntityDataSource that only shows the active "ProjectManagers".
In the case where the user is editing a record that is assigned to an "inactive" ProjectManger, an ArgumentOutOfRange Exception is (rightfully) thrown by the DDL (because that Item w...
I try to update my objectt task in database, but in parameter I have object which has clean history (I don't get it from database). And my question is :
Is it the best way to update object:
public static void SaveEditedTask(Task task)
{
using (var context=new Entities())
{
var taskToModi...
Hi all,
This is probably a complete noobie error.
My deepload is loading my related entitied fine and T Entity is correctly populated, but when I go back to the original call it hasnt kept the updates?
Now I'm sure EntityObjects are reference types (stupid question, but im doubting myself here)
So I shouldnt need to pass it back.
he...
The context of the question is ASP.NET MVC2 / EF4. I have a number of lookup tables in the database which have previously been programmatically referenced, each from a number of other tables... So there might be a country table with country-id shortcode, desc, and half a dozen tables that have a countryid in them. Repeat for 5 or 6 other...
I have a rather large table of mineral/vitamin definitions (44 columns) and every column name but one is correct. I have a column called [Tryptophan/60] in the SQL database table and I need to represent this in my EF DTO Object MineralDefinition:
public class MineralDefinition
{
public int DefinitionId {get;set;}
public string T...
I would like some help adding in a POCO .tt Entity Framework template Attributes to support WCF serialization and if its possible how to add namespace usings to each entity.
Thank you.
...
Hi,
I am trying to configure Entity Framework 4 in the Web.config file using this ConnectionString
...
metadata=
res://*/CmsEntityDataModel.csdl|
res://*/CmsEntityDataModel.ssdl|
res://*/CmsEntityDataModel.msl;
....
I would like remove the "*" and add the actual path for my dll file.
How to find the path fo...
I keep searching the web for examples of the new fluent API syntax in Microsoft's Entity Framework technology previews ... I come up with bits and pieces here and there.
Is there any reliable place to go to find ALL the possibilities? And maybe something that explains them a bit ("HasRequired", "WithMany", etc.)?
FYI, I am specifically...
Hi,
I'm facing several problems trying to apply DDD with EF4 (in ASP MVC2 context). Your advaice would be greatly appreciated.
First of all, I started to use POCO because the dependacy on ObjectContext was not very comfortable in many situations.
Going to POCO solved some problems but the experience is not what I was used to with NHib...
I want to implement the below mentioned problem in Entity Framework.
I have 2 tables( below are their simplified versions)
items table
itemId,itemName
tags table
tagId,tagName
my logic is, an item can have more than one tag and a tag can have more than one item related to it, so I have added many to many relation (please correct...
I am using Entity Framework with the Self-Tracking Entity T4 templates, which by default will generate a SQL Query setting all the properties on the Entity in an UPDATE statement. I only want an UPDATE statement that contains the properties modified.
I modified the T4 Template as specified in the book: Entity Framework Recipes: A Probl...
I am having some refactor troubles, maybe someone knows why...
In one solution I have a WCF service. In another solution I have a RIA application. Since the SQL database between these two is identical, I wanted to create a separate project, in which to host the edmx file as well as a domain service. If I create the edmx file in the W...
I created my own context which inherits from DbContext. Let's assume I have 1 post in my [Posts] table in the database. Consider this scenario:
I ask DbContext for this only post for the first time. And DbContext returns it as expected.
I change one column in [Posts] table manually.
I refresh my site = I ask DbContext for this post aga...
I have an Entity Object called Navigation stored in a Database called Navigations. When I save the Entity calling
context.SaveChanges();
I get the error
Invalid object name 'Navigation'.
I have removed the model and added it back in but with no change.
Does anyone have any ideas?
...
Ok, I give up...
What I want is to share the EF4's DbContext instance per request. I configured StructureMap like this:
For<MyContext>().Use(new MyContext("LocalhostConnString"));
But when I refresh my site, or even open it in another browser, I get the same exact instance of MyContext. Why is this shared across requests?
Am I missi...