.net - c# mvc area folder structure and class name -


i have web project folders constructed within areas. there, have 2 main folders: admin , home. in home section put concerning end user whereas admin office. within admin folder, divided models , views sub-folders. 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 far. since using linq sql , have table named category within it, namespace , table name create problem me. in category/edit.cs:

namespace myproject.areas.admin.models.category {     public class edit     {         public iquaryable<category> // throws intellisense error since                                     // understands "category" folder/namespace                                     // instead of table name in linq sql class 

well, know solution easy: change table name else. sake of readablity of code, want have clear table name , have clear url want folder name remain category. please can tell me how differentiate namespace table class?

edit

though answer, redesigned folder structure , class names. while left l2s class names were, naming models modelcategory , trying avoid subfoldering in models folder names of l2s classes. furthermore, merged edit.cs - create.cs - index.cs in modelcategory since they, more or less, use same model. therefore, removed category sub-folder within models , problem dissappeared.

in addition yuck's suggestions, can add using statement alias make code less verbose, e.g:

using l2s = myproject.somelinqtosqlnamespace; 

and can refer category entity l2s.category


Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -