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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T14:03:27+00:00 2026-06-06T14:03:27+00:00

Say I have a person table in a database. Whenever a new person is

  • 0

Say I have a person table in a database. Whenever a new person is added into the database, a pdf will be generated and emailed to someone.

Does this logic go into the model, so all the application does is pass in the data to insert the new person, and the model also handles the pdf and email?

Or does this logic go into the controller?

If this should go into the model, and I am using entity framework, how do I do this? Create a .cs class that wraps the .edmx model?

  • 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-06T14:03:27+00:00Added an answer on June 6, 2026 at 2:03 pm

    It is my understanding that you would not want to muck up the controller with that kind of logic. Things that belong in the controller would be defining models that are going to get passed to the view or turning validations on or off. There are several other view related things that the controller should control but that is just a couple. The general point that I am trying to make is that the controller is responsible for populating models by calling services or mocked repositories and then passing those models to the view.

    To do what you are explaining I would add a service layer that sits above the data access layer (dal – where your EDMX and repositories sit). Inside that service layer is where I would call the methods or services to generate the pdf and send emails.

    The repositories and data access layer should only be concerned with querying the database and retrieving records. That is regardless of what ORM or data access tool you use. the retrieved records are passed to the service layer where you can perform actions against the data (such as validations or sending out pdf’s) and then the presentation layer is returned whatever format of the records that it needs to display it in the view. The controller doesn’t perform any logical action against the retrieved data but instead just hands it off to the view.

    If you would like some more details about the architecture layout that I have described then I would be happy to give you more insight into it.

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

Sidebar

Related Questions

Ok let's say I have a database with a Person table. It has the
Say I have a Person table with 200000 records, there's a clustered index on
Let's say I have a MySQL database with 3 tables: table 1: Persons, with
Let's say I have a table Person and I have another 3 Doctor ,
Say I have this table: Person table -------------- PersonId Address table ------------ AddressId PersonAddressId
Let's say I have a Product table in a shopping site's database to keep
Let's say I have a Person table and a Song table and a Person_Song
Say I have a database with multiple entitles like person, company, conference for which
Hi say I have a table: Person: PersonId Name ManagerId So the ManagerId is
Say I have a Person table and a Courses table. In the Person table

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.