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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T07:34:41+00:00 2026-06-10T07:34:41+00:00

Problem : user operates over some entity in a domain. The last one changes

  • 0

Problem: user operates over some entity in a domain. The last one changes its status so that user recieves e-mail notifications (using smtp server) repeatedly until the given time.
So I need to fire an event somehow.

What are the alternative ways to do that? I know there’re no events in ASP.NET MVC framework.

Thanks!

  • 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-10T07:34:42+00:00Added an answer on June 10, 2026 at 7:34 am

    You can use my Inversion Of Control container which has built in support for in-process domain events:

    Subscribing

    Subscribing is easy. Simply let any class implement IHandlerOf:

    [Component]
    public class ReplyEmailNotification : IHandlerOf<ReplyPosted>
    {
        ISmtpClient _client;
        IUserQueries _userQueries;
    
        public ReplyEmailNotification(ISmtpClient client, IUserQueries userQueries)
        {
            _client = client;
            _userQueries = userQueries;
        }
    
        public void Invoke(ReplyPosted e)
        {
            var user = _userQueries.Get(e.PosterId);
            _client.Send(new MailMessage(user.Email, "bla bla"));
        }
    } 
    

    Dispatching

    Domain events are dispatched using the DomainEvent class. The actual domain event can be any class, there are no restrictions. I do however recommend that you treat them as DTO’s.

    public class UserCreated
    {
        public UserCreated(string id, string displayName)
        {
        }
    }
    
    public class UserService
    {
        public void Create(string displayName)
        {
            //create user
            // [...]
    
            // fire the event.
            DomainEvent.Publish(new UserCreated(user.Id, user.DisplayName));
        }
    }
    

    The code is from my article: http://www.codeproject.com/Articles/440665/Having-fun-with-Griffin-Container

    ASP.NET MVC3 installation:

    1. Use package manager console: install-package griffin.container.mvc3
    2. Follow these instructions: http://griffinframework.net/docs/container/mvc3/
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here's a scenario that describes the problem: User A has a browser with HTML5
I'm encountering a problem with a Doctrine 2 entity association. I have a User
Problem: user made some selection in the multi-selection listbox, then pressed a checkbox, and
I'm trying to handle the problem where a user can try to open, with
This is inspired by/taken from this thread: http://www.allegro.cc/forums/thread/603383 The Problem Assume the user gives
Problem Background: I have a 35K+ user members and growing fast. I am planning
Problem description : - Step 1: Take input FILE_NAME from user at main thread.
The problem is: my application shows a WebView for a user, and after when
I have a problem with the MySQL root user in My MySQL setup, and
I have a problem with obtaining the current user location. Code at first works

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.