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

  • Home
  • SEARCH
  • 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 4242050
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T03:23:26+00:00 2026-05-21T03:23:26+00:00

We have an n-tier app that includes a DB , on top of it

  • 0

We have an n-tier app that includes a DB , on top of it EF4 , then WCF services and finally a silverlight 4 client.

We are thinking what is the best way to update a single entity property. We have a Customer entity which has about 15 properties. Now, in the client the user has changed the customer Name property and want to save this change to the DB. So two methods come in mind :

1) Just send the entire Customer entity over the WCF servie and update the DB. This is very simple, because in Update method in the server, all we need to do is attach the incoming entity to the context, change it’s objectState to modified, and hit SaveChanges().

2) Asumming all our entites have a single int key, we can expose a method in the WCF service that looks something like this:

public void UpdtaeEntityProperty(Type i_EntityType, int i_EntityId, string i_PropertyName, string i_NewValue); 

In the first method, we are sending a lot of information over the wire which is not needed.
The second method sends just what is needed, plus it fits all the entites. Another advantage is that when the user is in the process of updating several fields in the UI, we have more control on throwing exceptions just as he enters the values.

In all EF4 examples\videos\books , the process of updating a value of a property always involves sending a complete object. You never see an aproach that updates a single value. It’s as if we are missing some kind of data binder in the client : A componnet that will bind a certain text field to the DB, even it’s over a WCF service.

1) Is such a solution is being in desgin for next realses of EF4/WCF ?

2) Is our solution of the UpdateEntityProperty method is a good practice ?

  • 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-21T03:23:27+00:00Added an answer on May 21, 2026 at 3:23 am

    You never see an approach that updates
    a single value. It’s as if we are
    missing some kind of data binder in
    the client : A component that will
    bind a certain text field to the DB,
    even it’s over a WCF service.

    I think most examples you have seen handle the general case of updating detached entities which are passed around. That doesn’t mean you have to do this, it all depends on your particular scenario, since it’s a trade off generality vs. performance/custom solution.

    If your entities are big and performance is important to you, by all means just send the ID and the updated value to the server – this solution will perform better, but is not very generic and depends on the properties of your entity type – but that might be ok for your project.

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

Sidebar

Related Questions

I have this scenario in my 3-tier app with a Service Layer that serves
I have a three tier web app that produces three separate dlls: Web.UI.dll Web.Application.dll
WCF/C# N-Tier app. We have implemented Paging in our business Layer using this snippet
I have a live iOS app that uses Amazon Web Services (AWS). I have
In an N-Tier app you're supposed to have a business logic layer and a
We have an n-tier web application that pulls data from SQL Server. Our Data
I have a 3-tier .NET service app, which follows the standard approach: Frontend ->
I have inherited a conventional three tier web app with ASP.net 2.0 for the
so i have a multi-tier web app in asp.net mvc i use the asp.net
I am writing a business app in Flex that uses web services to communicate

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.