I have an MVC2 app where I am starting to use the STE's. I am looking for some clarification on how updates should work.
Background:
If I have a Blog entity with related category entities and Related post/comment entities. In MVC I am rendering a view with the main Blog entity and the categories but not the related posts. When I pos...
I am using EF4 Self Tracking Entities (VS2010 Beta 2 CTP 2 plus new T4 generator). But when I try to update entity information it does not update to database as expected.
I setup 2 service calls. one for GetResource(int id) which return a resource object. the second call is SaveResource(Resource res); here is the code.
public Resou...
Hello
Last year I developed a data access service for our project using Entity Framework (.NET3.5 of course) and using Julie Lerhman's book as a guide developed state tracking POCO objects. We use WCF and also have Silverlight 3 clients. We are moving to .NET 4.0 and I want to switch to using code generation to eliminate wasted develope...
Self tracking entities. Awesome.
Except when you do something like
return Db.Users;
none of the self-tracking entities are tracking (until, possibly, they are deserialized).
Fine. So we have to recognize that there is a possibility that an entity returning to us does not have tracking enabled.
Now what???
Things I have tried
F...
Hi,
I am putting together a WCF Data Service for PatientEntities using Entity Framework.
My solution needs to address these requirements:
Property DateOfBirth of entity Patient is stored in SQL Server as string. It would be ideal if the entity class did not also use the "string" type but rather a DateTime type. (I would expect this t...
Hi, I am creating a project using Entity Frameworks 4 and self tracking entities. I want to be able to either get the data from a sql server 2008 database or from sql server compact database (with the switch being in the config file). I am using the repository pattern and I will have the self tracking entities sitting in a separate ass...
I am using self tracking entities and have moved the entity classes to another assembly by using 'Add as link' to point to the TT file as mentioned here. Now though, when I update the model (for instance change a property name) the template is not automatically run and so the entity class does not get updated.
I can of course manually ...
Hello,
It appears to me that a strange phenomenon is occurring with inherited entities (TPT) in EF4.
I have three entities.
1. Asset
2. Property
3. Activity
Property is a derived-type of Asset.
Property has many activities (many-to-many)
When modeling this in my EDMX, everything seems fine until I try to insert a new Property into th...
In our multi-tier business application we have ObservableCollections of Self-Tracking Entities that are returned from service calls.
The idea is we want to be able to get entities, add, update and remove them from the collection client side, and then send these changes to the server side, where they will be persisted to the database.
S...
I've been using the entity framework in combination with the self tracking entity code generation templates for my latest silverlight to WCF application. It's the first time I've used the entity framework in a real project and my hope was that I would save myself a lot of time and effort by being able to automatically update the whole da...
I am currently using the Self Tracking entities of the .NET Entity Framework, however I would like to speed up my execution of queries.
The first thing everyone seems to suggest is generate the views for the model at compile time.
Using the ssdl files etc, I was able to create a 'MyModel.Views.cs', which is compiled in my project. Howe...
Hey, can anybody confirm the following scenario will work:
I am developing a 3-tier application in .NET 4.0: Winforms Client, aspx server and SQL 2008 database.
The server communicates with the SQL 2008 database by means of Entity Framework 4.0, and returns the entities in forms of STE's (in a separate assembly) to the client applicati...
In an optimistic concurrency scenario fo a web-app, I am considering to give each table the timestamp column (sqlserver), comparable to a guid. Linq to entities will then generate sql update queries like WHERE id = @p0 AND timestamp = @p1 when one decorates the timestamp column with a certain attribute in Entity Framework. When the numb...
When the context is generated i see there are some extension methods : AcceptChanges, MarkAsAdded, MarkAsDeleted, MarkAsModified.
When should i use these methods since they are available only on the service?
...
I've set up a little n-tier web application using MVP (Model View Presenter) in the front-end, a WCF service on the backend, which communicates with the BLL an behind that the DAL, which communicates with the EF4.0.
This is all working quite nicely, I've created several Get and Add methods which all work.
Now I wanted to create several ...
Hi,
I've been stuck with this problem for over a week now. Hopefully some one can point me in the right direction.
I start with a brief description of my schema.
Asset 1--->1 Address *-->1 Area *-->1 Region *-->1 Country
Package 1-->* Asset
Using Self Tracking Entity (STE) + WCF.
Steps:
Call data store for a list of assets.
Call ...
I'm trying to set up an MVC2 app with Entity Framework Self-Tracking-Entities. My view is a strongly-typed view of the entity type generated by the STE T4 template. Here's my GET:
public ActionResult Edit(int id)
{
var ri = new App1Service.App1Client().GetMyObj(id);
var changeTracking = ri.ChangeTracker.ChangeT...
Hi everyone,
I am trying to achieve the following using Entity framework 4.0 and self-tracking entities:
1) The client application request a book form the server by providing an ISBN number
2) The server performs a query on its database to see if the book is already present
3a) If the book is in the database, it returns it.
3b) If t...
I wish to return a graph for a "Business" entity. The Buiness entity has a collection of "Contacts".
So I basically want this:
ctx.Business.Include("Contacts").Where(b => b.BusinessID == id).Single();
The problem is I don't want ALL the contacts for the business. Just those that have a ContactTypeID = x. How can I accomplish this? I ...
In the constructor of each of my POCO's I have this:
this.StartTracking();
To ensure that tracking is turned on for every instance of one of my POCO's. I have an Entity A which contains a TrackableCollection of Entity B. When I load my instance of Entity A like such:
using(MyContext ctx = new MyContext())
{
entityA = ctx.EntityA....