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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T10:10:03+00:00 2026-06-04T10:10:03+00:00

When changes occur on some reservation I want everyone involved getting a mail about

  • 0

When changes occur on some reservation I want everyone involved getting a mail about the changes.

Actually I am not sure how to get this done. But I geuss my first question should be.
How should I check if changes have accord and how am I suppose to know which person people are involved in the changes?

I am using Entity Framework ( Lazy Loading ) in MVC 3.

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

    deltu,

    this can be resolved in a number of ways. the one that I use today is based on raising an event when the repository is saving changes. not sure what your configuration looks like, but here’s a snippet of what I do:

    public void SaveChanges()
    {
        //_auditDate = DateTime.Now; ignore this in your case
        OnSavingChanges();
        _context.SaveChanges();
        OnSavedChanges();
    }
    
    private void OnSavingChanges()
    {
        if (SavingChanges != null)
        {
            var eventArgs = new RepositorySavingChangesEventArgs()
            {
                AuditDate = _auditDate
            };
            SavingChanges(this, eventArgs);
        }
    }
    public event EventHandler<RepositorySavingChangesEventArgs> SavingChanges;
    
    private void OnSavedChanges()
    {
        if (SavedChanges != null)
        {
            var eventArgs = new RepositorySavedChangesEventArgs()
            {
                AuditDate = _auditDate
            };
            SavedChanges(this, eventArgs);
        }
    }
    public event EventHandler<RepositorySavedChangesEventArgs> SavedChanges;
    

    then simple make sure that your client code subscribes to the SavingChanges EventHandler. Job done. You literally only subscribe within the context of where you know the crucial changes are and then fire off an email service call inseide that event handler.

    hope this helps.

    [edit] in response to comment below, you would raise either of these events in either the service class, the base abstract class, or more simply, in your controller. here’s an example of the controller raising the event:

    public TimelinesController(IRepository repository)
    {
    _serviceTasks = new TimelineService(repository);
        repository.SavedChanges +=
            new EventHandler<RepositorySavedChangesEventArgs>(repository_SavedChanges);
    }
    
    private void repository_SavedChanges(object sender, RepositorySavedChangesEventArgs e)
    {
        var newDate = e.AuditDate;
        /* do something fancy with the audit date */
    }
    

    hope this points you in a more ‘pointed’ direction 🙂

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

Sidebar

Related Questions

I get the error changes not allowed when unmanaged debugging is enabled Actually I
This is what I want my site to do: 1. User fills in some
Sorry if the title is not very clear. I was not sure about the
I have a std_logic_vector and I need to know when some changes occur on
I have a WCF service that needs to notify it's clients when changes occur
I am looking for a good way to log changes that occur on a
I am performing data changes on multiple databases, and I want to implement a
I wish to run an event which will occur on some counter change, e.g.
Recently, I made some changes to an iOS app. Nothing special, but it was
I've been doing some reading about continuous integration recently and there is a scenario

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.