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 9002605
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T00:35:35+00:00 2026-06-16T00:35:35+00:00

Can edits be made server side? I have a table where the values are

  • 0

Can edits be made server side?

I have a table where the values are made up programmatically, the values change all the time and so I would like an ‘update’ to re-calculate the values for the table and commit the changes. I do not need to have ANY data passed back to the client side.

I have tried the ObjectContext.SaveChanges() method in my DomainServiceClass after changes the relevent records, but it doesn’t chnage the database values.

What have I missed? Is it possible?

SERVER SIDE, DomainServiceClass method:

public IQueryable<POINT> UpdateDB()
{
     var Points =  ObjectContext.POINTS.Include("Readings").Include("Items").Include("LatestStatus");
     List<POINT> itemsChanged = new List<POINT>();

        foreach (Point point in Points)
        {
            int status = CalculateStatus(point)
            if (point.LatestStatus.FirstOrDefault().Status != status)
                point.LatestStatus.FirstOrDefault().Status = new status
        }

        ObjectContext.SaveChanges();


        /*try
        {
            // Try to save changes, which may cause a conflict. 
            int num = ObjectContext.SaveChanges();
            Console.WriteLine("No conflicts. " +
                num.ToString() + " updates saved.");
        }
        catch (OptimisticConcurrencyException)
        {
            // Resolve the concurrency conflict by refreshing the  
            // object context before re-saving changes. 
            ObjectContext.Refresh(RefreshMode.ClientWins, inspectionPoints);

            // Save changes.
            ObjectContext.SaveChanges();
            Console.WriteLine("OptimisticConcurrencyException "
            + "handled and changes saved");
        }*/

        return itemsChanged.AsQueryable();
}
  • 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-06-16T00:35:35+00:00Added an answer on June 16, 2026 at 12:35 am

    As the change you are trying to make is not a traditional CRUD operation you need to mark your method with the invoke attribute. Also updates onto your POINT objects need to use the ObjectContext otherwise you’re just changing your in memory collection.

    [Invoke]
    public IQueryable<POINT> UpdateDB()
    {
      var Points =  ObjectContext.POINTS.Include("Readings").Include("Items").Include("LatestStatus");
      var itemsChanged = new List<POINT>();
    
      foreach (Point point in Points)
      {
        int status = CalculateStatus(point);
        if (point.LatestStatus.FirstOrDefault().Status != status) // Where does this status come from?
        {
          ObjectContext.POINTS.FirstOrDefault( p => p.ID == point.ID).LatestStatus.FirstOrDefault().Status = new status //  Pseudo code?
          //point.LatestStatus.FirstOrDefault().Status = new status
        }
      }
    
      ObjectContext.SaveChanges();
    }
    

    You could then call this method:

    var ctx = new YourDomainContext();
    
    ctx.UpdateDB( (op) =>
    {
      if (op.HasError)
        // Handle errors.
      else
      {
        // Do stuff.
      }
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I made a game engine that I can use on the server side as
On a WAMP server, I have a server-side include in a file, a.shtml, composed
The principle of sessions is to save data on server side that can be
i have a java chat server & client, that works fine. I made a
I have made an AJAX function with jQuery. The function works properly, and server
I've made a website on which users can upload a video file. All is
I'm doing in-line edits on a grid, but can't seem to get any events
I have a page where the user can edit various content using buttons and
I have a controller method called Edit in which the user can edit data
Are there any pre-made scripts that I can use for PHP / MySQL to

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.