Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3697180
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T04:49:44+00:00 2026-05-19T04:49:44+00:00

I’ve set up a little n-tier web application using MVP (Model View Presenter) in

  • 0

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 Update methods. Since I’m using the Self-Tracking Entities (STE) of the EF4.0, I thought everything would work out quite fine and implementation would be rather easy.

This doesn’t seem to be the case.
When changing my items in the web front-end, they keep having the status Unchanged when moving back to the WCF-service. Because the entity is unchanged, nothing gets updated in the database.
Through this question on SO: EF 4 Self Tracking Entities does not work as expected
I came accross the article telling something more in detail about implementing the STE’s with in an n-tier application. (http://msdn.microsoft.com/en-us/magazine/ee335715.aspx)
I quote:

Make certain to reuse the Self-Tracking Entity template’s
generated entity code on your
client.
If you use proxy code
generated by Add Service Reference in
Visual Studio or some other tool,
things look right for the most part,
but you will discover that the
entities don’t actually keep track of
their changes on the client.

Well, I’ve managed to create a client to the service using this code:

var svc = new ChannelFactory<INorthwindSTEService>(
    "INorthwindSTEService")
    .CreateChannel();

This appears to work quite alright.
The thing is, how do I get the serialized entities on the client?
In the code example I’m seeing the writer uses this code:

var products = new List<Product>(svc.GetProducts());
var customer = svc.GetCustomer("ALFKI");

But I fail to see where those objects/entities/??? are defined (I’m talking about a Customer and a Product)

I’ve tested it using the entities which were created using the Add Service Reference, but that doesn’t seem to work. The returned entities still have the status Unchanged.

I’d rather not reference the EF entities in my front-end, because I’d like to keep them separated and only have serialized objects on my front-end. Though, if it is really necessary, I might just have to do that.

Oh, using the MarkAsModified() method on the entity object does work nicely though, but that’s more of a hack as the entity should check his status by itself.

Any advice on how to proceed?
My guess is using the MarkAsModiefied() method or referencing the entity models project in my web application could be viable work-around, but if there’s something better, I’d like to try that first.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T04:49:44+00:00Added an answer on May 19, 2026 at 4:49 am

    You need to move the self tracking entities out of the entity frameowrk project

    if you look in the .tt file you will see that there is a path to to .edmx file that you ahve to fill in.

    This will aloow you to have them in a project seperate to the entity framework.

    you can then reference this project from your front end and have access to the tracking entities as you expect.

    As for performing the update … well im looking myself ;p
    (I don’t really want to sieve them out into their different states myself)

    you say this
    ‘Make certain to reuse the Self-Tracking Entity template’s generated entity code on your client’

    and then you say that you do not want to do this lower down.

    That is your problem.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

That's pretty much it. I'm using Nokogiri to scrape a web page what has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
We are using XSLT to translate a RIXML file to XML. Our RIXML contains
Seemingly simple, but I cannot find anything relevant on the web. What is the
I have an MVC Razor view @{ ViewBag.Title = Index; var c = (char)146;

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.