I am using EntityFramework. I have an "Application" object (which has a field certificateReasonID) which can have one or zero CertificateReasons - so there is a ralationship to the "CertificateReason" table, and visiually on the edmx diagram we do not see the certificateReasonTypeID field.
When I update an Application - it INSERTS a new...
In .NET 3.5sp1,
I have a table in Sql Server that is defined somehow like this:
CREATE TABLE Employee(
EmployeeId [int] IDENTITY(1,1) NOT NULL,
UserName varchar(128) NOT NULL,
[Name] nvarchar(200) NOT NULL,
Address xml NULL,
...)
I am mapping this table to the ADO.NET Entity Framework. My problem is that the xml column is map...
For the sake of argument assume that I have a webform that allows a user to edit order details. User can perform the following functions:
Change shipping/payment details (all simple text/dropdowns)
Add/Remove/Edit products in the order - this is done with a grid
Add/Remove attachments
Products and attachments are stored in separate ...
First question to SO, I hope I'm doing this right. ;)
Regarding System.Data.Entity.Design.EntityStoreSchemaFilterEntry :
I'm looking for some detailed documentation on this class. The MSDN docs have nothing but an indication of what properties exist and their data types. I want to create a well-defined list of filters for
EntityStoreS...
I have a detached set of client objects that I'd like to update (I know they already exist in the db by primary key). Now I want to update them to the database. Knowing I need to query them first, I do so and now have to basically take the properties from the deattached objects and apply them to the attached objects. I finally call sa...
I have a web application that uses the Entity Framework - we make use of the TransactionScope class to provide ambient transactions.
Is there any way to tell EF to use a standard T-SQL transaction in preference to DTC transaction? Quite often we make a number of queries to different tables inside one EntityContext and one TransactionSc...
In what instances does Entity Framework automatically load child rows and other related rows as you use them? It seems like sometimes this is done automatically on property accessor, and sometimes you must do it explicitly.
For example, if I have a table called Car, and a table called Wheel, and there are 4 wheels rows for each car row,...
I have a Recommendation object and a FeedbackLevel object and the FeedbackLevel object is a navigation property inside a Recommendation object
Recommendation
int EntityKey;
FeedbackLevel Level;
Inserting a new one works just fine with AddObject(). Here's what I'm trying with the update, which doesn't work.
recommendation.Level = m...
Hi ,
After reading about Enitity Framework , i have some questions:
1] What is the best way to transfer Entities between tiers ?
a] do i must create lighter DTOs for this or i can Effectively serialize the Entitiy and transfer it ?
b] if i must create light DTOs,for Efficency, and after i saw the nice usage of Automapper ...
Hello everyone,
Do you know a way for using mysql in vs2010 with ef4?
Thanks in advance.
...
I have two entities, Parent and Child, in Entity Framework.
The parent has a collection of Child entities.
In my query, I want to return only the Parent entities (the fully typed EF types) and also the Count() of the Child entities (this could be set to a property on the Parent), but I only want to do this in one call to the database, ...
I'm about to branch a project that uses EF. I know that there will be a modicum of changes in the trunk, as well as many changes in the branch. I will need to merge in changes from the trunk into the branch from time to time.
I'm not concerned about the straight up C# code that usese EF objects (Linq to Entities) I'm concerned about t...
Hello,
I'm passing 3 sets of data through to a view in a viewmodel and have a problem relating one of them to the other two in my foreach coding:
My DB tables are:
"ServiceGroups" is parent to "Services"
"Services" is related through a joining table (using a 2 composite Primary Key) to the aspnet_users table (I call "Users")
I pulled ...
Hello
I'm having problems with getting my custom dataannotations to work, I'm trying to add a validation-attribute that validates that the UsergroupName for a Customer (CustomerID) is unique.
[MetadataType(typeof(UsergroupMetaData))]
public partial class Usergroup { }
public class UsergroupMetaData
{
[Required()]
public object...
I have three related entities, best described by this diagram:
When I load a user, using the following code, the User object is loaded, i.e. not null, but the Role and Department properties on the User object are null, despite User database record having valid FK values for these associations.
using (var productionEntities = new Pro...
I have run into this problem:
Custom Methods & Extension Methods cannot be translated into a store expression
Basically I have some complicated LINQ queries, so wanted to break them down into subqueries which are implemented as methods that return IQueryables. My hope was then these IQueryables could be composed together in a LINQ stat...
Hello everyone,
I have made a generic save function for EF:
public void Save(T entity)
{
using (C context = new C())
{
string entitySetName = context.FindEntitySetByEntity<T>();
T entityInDDBB = GetEntityByKey(entity, entitySetName, context);
//if we didn't find the entity in da...
I tried this:
http://channel9.msdn.com/posts/RobBagby/deCast-Entity-Framework-Modeling-Implementing-Entity-Splitting/Default.aspx?wa=wsignin1.0
...with the Northwind sample database from Codeplex, using the Employee and Contact tables. I wanted to create a EmployeeContact entity that basically pulls in the FirstName and LastName column...
This is the scenario. I have the following three classes, they are defined in Entity Framework, i only define them here for the example:
public class Foo
{
public string Color { get; set; }
}
public class Bar : Foo
{
public string Height { get; set; }
}
public class Pipe : Foo
{
public string Width { get; set; }
}
So, I have m...
In EF is there a way to specify a relationship between two tables when there is no relationship defined in the database and one of the related columns is a specific string/hard-coded value?
Lets say I have a Document object and it can have various stages of approval and a category. My table might look like
DocumentID, DocumentName,...