self-tracking-entities

Entity Framework filter nav property with Self Tracking Entities

I'm using Self Tracking Entities and have a scenario where I have an entity that represents a table that we'll call table A. A is a parent to another table B which is also represented as an entity. On my WinForm I have 3 different binding sources that each represent different types of records from table B but all are children of table A....

Are nullable foreign keys allowed in Entity Framework 4?

I have a problem updating a foreign key in an Entity Framework entity. I am using self tracking entities and have an entity with some relations where the foreign key is also present as a property (one of the new features of EF4). The key (an integer) is marked as Nullable and Concurrency Mode fixed. Specifically I have an Alarm entity w...

How to work with secondary keys in self tracking entities?

I am trying to establish a good practice for working with secondary keys when using self tracking entities and entity framework 4, but there seems to be a lot of pitfalls. Lets say I have an Alarm entity, that can have ConfirmingUser navigational property to a User. The User has an Id as primary key and a "Login" as secondary key. At so...

How do I get Entity Framework to only update the Properties modified in the SQL generated?

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...

Is there a way to default the namespace in RC version of STE's with an EDMX?

I have a project utilizing EF4 and Self Tracking Entities (STE). In the pre-release version of STE's you could add the "Namespace" value to each EDMX different from the default Namespace of the current project. (Open EDMX, right click: Properties, Set the "Namespace" attribute.) When you set this in the pre-release version and use the...

EF4 DAL design and the ObjectContext: Argument with co-worker

Hello all. I work with a senior developer who is a guru .NET architect. We have had many constructive arguments over the last 6+ months and generally I concede defeat in most of our discussions. I have learned stacks from working with him. There is one design problem we are currently in disagreement with, however, and I would like some ...

Problems binding Self-Tracking Entity's Navigation Property WPF

I have a WPF application consuming data using Entity Framework 4 and Self-Tracking Entities. In which I have a window with 2 controls in it, one that shows the "Details" portion of an object using a ContentControl and templates from a merged resource dictionary. Another with a ListBox of Groups the object in question belongs to and a Com...

Self-tracking entities Silverlight proxy generation

Hi guys! I’m developing a Silverlight 4 application using STE with EF4. I created a Silverlight project with all the Entity classes generated with my STE T4 template and build properly on VS. But when I add a WCF proxy with Visual Studio and check the “Reuse types in reference assemblies” (having a referece to my Client.Model assembly w...

Trouble updating self-tracking entities

Hi I'm using self-tracking entities in a WCF client-server application. My WCF service returns various entities, and these can be updated using corresponding Update methods. This worked well for a while, but now I'm having problems. To keep the focus, I'l limit this discussion to a specific case, simplified to the bare essentials. One...

Deserializing self-tracking entity with nested TrackableCollection

How can I deserialize JSON string into entity of type like this (self-tracking properties removed to be simple): public class User: { int Id { get; set; } string Name { get; set; } public TrackableCollection<Role> Roles { get; set; } // <! } Role is also simple class with two properties. TrackableCollection is descendant ...

EF4: Difference between POCO , Self Tracking Entities , POCO Proxies

Hi, Can someone point me the difference between POCO , Self Tracking Entities , POCO Proxies? Actually, I am working Entity Framework 4.0 and POCO(Repository Pattern) and whenever I do some changes in the POCO and call ObjectContext.Savechanges then it reflects to the DB. My question is, How does the Context persist the change to t...

Insert Data into mulitple table using FK's using Entity framework

Hi I have tables Movie - ID, Name, Description, DirectorID-Fk, MusicID-Fk Director - ID, Name Music - ID, MusicName Now I am trying to insert a new record to movie but I dont know whether Director is already existing in the DB and same with the Music). From UI i am taking all movie information, DirectorName and MusicName. Now wh...