I have a site built using ASP.NET MVC3 that overlays as follows:
- ProjectName.Shared (model + service contracts)
- ProjectName.Infrastructure
- ProjectName.Data li>
- ProjectName.Data.Sql
- ProjectName.Managers (business layer)
- ProjectName.Services (WCF Services)
- ProjectName.UI.Main (ASP.NET MVC3 Application)
This is actually a structure that I recently came up with after some refactoring. Unfortunately, there is no complete separation between the user interface and my business layer, so this area may still use some kind of refactoring, which I cannot do right now, because I am in a tight deadline.
At the moment, my client has requested some new features, which include sending emails to users after some events. The website currently sends emails using the Postal library , which is still wonderful. This comes from the MVC web application, which is different from the case I have for new features ...
Problem:
I have a case where I need to provide a private method inside my business layer to send email to users. The reason I cannot do this inside the Action method is because there are many code paths that ultimately call this private method. Thus, this is not very specific to a single Action method.
Proposed Solution:
, EmailsController, HTTP-POST- -. , Action.
. , .