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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T13:41:25+00:00 2026-05-23T13:41:25+00:00

I have a web project which the folders are constructed within the areas .

  • 0

I have a web project which the folders are constructed within the areas. There, I have two main folders: Admin and Home. In Home section I will put everything concerning the end user whereas the admin will be my back office. Within the Admin folder, I divided Models and Views into sub-folders. Like the following example:

Areas
  - Admin
     - Controllers
        - CategoryController.cs
        - UserController.cs
     - Models 
        - Category
          - Edit.cs
          - Create.cs
          - Index.cs
        - User
          - Edit.cs
          - Create.cs
          - Index.cs
     - Views
        - Category
          - Edit.cshtml
          - Create.cshtml
          - Index.cshtml
        - User
          - Edit.cshtml
          - Create.cshtml
          - Index.cshtml
  - Home 
     ...

I guess it’s fine so far. Since I am using Linq to Sql and I have a table named Category within it, the namespace and table name create some problem for me. Say in Category/Edit.cs:

namespace MyProject.Areas.Admin.Models.Category
{
    public class Edit
    {
        public IQuaryable<Category> // this throws an intellisense error since it
                                    // understands "Category" as the folder/namespace
                                    // instead of the table name in linq to sql class

Well, I know that the solution is easy: to change the table name to something else. But for the sake of the readablity of the code, I want to have a clear table name and to have a clear URL I want the folder name remain as category. So please can someone tell me how to differentiate the namespace from the table class?

EDIT

Though I like the answer, I redesigned my folder structure and class names. While I left the L2S class names as they were, I am naming the models as ModelCategory and trying to avoid subfoldering in Models folder with names of L2S classes. Furthermore, I merged Edit.cs - Create.cs - Index.cs in ModelCategory since they, more or less, use the same model. Therefore, I removed the Category sub-folder within the Models and the problem dissappeared.

  • 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-23T13:41:26+00:00Added an answer on May 23, 2026 at 1:41 pm

    In addition to Yuck’s suggestions, you can also add a using statement with an alias to make the code less verbose, e.g:

    using L2S = MyProject.SomeLinqToSqlNamespace;
    

    And you can now refer to the category entity simply as L2S.Category

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

Sidebar

Related Questions

I have an ASP.NET web application project which references another project called ModusCore (or
I have built a web setup project in VS2008 which installs my ASP.NET/Silverlight app
I have an ASP.NET project which has already some custom fields in it's web.config
I'm working on a web project, which have to process so many client requests.
I have a large project in Vb.net which drives a web browser control around.
In our web application we have a directory which resides outside of the project.
I have a web project that I developed where one of the main functions
I currently have a primary Java Web App Project which houses some Servlets, JSPs
Currently I have set up a Web Deployment Project which compiles code into the
I have a project which is a Web Site, not Web Application and have

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.