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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T10:19:09+00:00 2026-06-18T10:19:09+00:00

Currently on my application I am doing logging on any value the user changes,

  • 0

Currently on my application I am doing logging on any value the user changes, which works fine. I have a class object MyObject and Logs object and on each property I am raising an event as such:

private string _occupation;
[FieldAlias("_occupation")]
public string Occupation
{
    get { return _occupation; }
    set
    {
        if (this.Occupation != value)
        {
            string oldValue = Occupation;
            _occupation = value;
            NotifyPropertyChanged("Occupation", oldValue, value);
        }
    }
}

The MyObject class also implements INotifyPropertyChanged and I have following event:

public event PropertyChangedEventHandler PropertyChanged;

private void NotifyPropertyChanged<T>(string propertyName, T oldValue, T newValue)
{
    if (PropertyChanged != null)
    {
        PropertyChanged(this, new Helper.PropertyChangedExtendedEventArgs<T>(propertyName, oldValue, newValue));
    }

    this.Logs.Add(new Logs
    {
        CreatedDate = DateTime.Now,
        CreatedBy = this.ModifiedBy,
        PropertyName = propertyName,
        NewValue = (newValue != null) ? newValue.ToString() : "",
        OldValue = (oldValue != null) ? oldValue.ToString() : ""

    });
}

Everything works fine except for he CreatedBy field above. As it is coming from MyObject's ModifiedBy property, the update doesn’t happen immediately because at the time the field will contain previous user’s name(hope it makes sense).

How can I reflect the changes as it happens, I cannot raise the event on ModifiedBy property as it is going to create a new row in Logs table, so is there any other options?

  • 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-18T10:19:10+00:00Added an answer on June 18, 2026 at 10:19 am

    Ended up using the current user from cache this way it will update it properly.

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

Sidebar

Related Questions

In my application I currently have the ability to create a user which then
I am currently logging an AJAX application with messages which include the times of
I'm currently doing an application where I'm trying to detect touch-positions of the user.
I am currently doing a C# WPF application that generates a table that does
I am currently doing an android application that contains customize alert dialog. It contains
I'm currently doing the following as part of my iPhone application NSArray *paths =
I want to preserve a property between postbacks in an ASP.Net application. Currently doing
I want to delete a folder which contains the currently running application. How can
I have a Client/Server application written Delphi. Essentially all the application is doing is
I've have quite small asp.net MVC 2 application to maintain/extend. Currently it uses hand

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.