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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T11:11:04+00:00 2026-05-29T11:11:04+00:00

I am developing a web application in ASP.NET MVC3 with C# and Razor. I

  • 0

I am developing a web application in ASP.NET MVC3 with C# and Razor.

I need to create an utility class where I put functions to convert string into dates(years, months, days, etc…).

In ASP.NET Web Forms I used to place this kind of classes inside the App_Code folder. In MVC there is not such folder and I don’t think utility classes belong neither to Models nor to Helpers(a folder I created to put my extensions on HTML Helpers).

I read that is a good practice to place the utility classes in a different assembly. I guess a different project should do the job but what kind of project shall I create? A plain Class Library project seem the most logical choice to me.

However in my case I just need to put one single class with several methods so, if we ignore re-usability, isn’t it more logic to put the utility class somewhere in my MVC3 Web application?

  • 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-05-29T11:11:05+00:00Added an answer on May 29, 2026 at 11:11 am

    You should not have utility classes. Convert them to extension methods which is somewhat better. View models are even better.

    I usually create a folder called “HtmlHelpers” or “Infrastructure” for plumbing.

    A “Common” folder is like the trashcan imho. You put all the junk in it.

    Update

    I would place it in an extension method for DateTime (placed in a class called DateTimeExtensions which is placed in a namespace called Infrastructure).

    And I would use it internally in the view model or when generating the view model (in the controller).

    As for which project, it doesn’t really matter. What’s important is that you got small classes with specific tasks (or responsibilities).

    Some argue that you should have several class libraries with distinct responsibilities. I don’t do that. I create one UI project and one project for the business logic. However, I make sure that the classes implement one or more interfaces to be able to refactor the application later on. KISS should also apply to project structure and not just the code in them.

    In other words: I would put my helpers in the Core (business logic project) in a namespace called Infrastructure.

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

Sidebar

Related Questions

I am developing a web application in ASP.NET MVC3 with C# and Razor. I
I am developing a web application in ASP.NET MVC3 with C# and Razor. The
I am Developing a web Application in ASP.NET 3.5. I have to create UI
I'm developing an web application using asp.net mvc, and i need to do a
I'm developing a web application, using ASP.net and C# need to provide a functionality
I am developing an ASP.NET MVC 3 web application using Razor and C#. I
I am developing a web application in ASP.NET (C#) and need to give a
I'm developing a web application using ASP .NET MVC 1.0 and jQuery (including the
I'm currently developing a web application in ASP.Net with SQL Server and I would
I am developing an ASP.NET web application that incorporates google maps. I have an

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.