locked
ASP .Net Core 2.2 Razor Directory Structure, Best Practices RRS feed

  • Question

  • User-1580299748 posted

    All,

    I am using <g class="gr_ gr_20 gr-alert gr_gramm gr_inline_cards gr_run_anim Style multiReplace" id="20" data-gr-id="20">ASP .</g>Net Core (Version 2.2), non-MVC.

    The default directory structure is as follows:

    • /<g class="gr_ gr_95 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling" id="95" data-gr-id="95">wwwroot</g>
    • /Areas/Identity
    • /Areas/Identity/Pages
    • /Areas/Identity/Pages/Account
    • /Areas/Identity/Pages/Account/Manage
    • /Data
    • /Data/Migrations
    • /Pages (the default Index.cshtml file resides here)
    • /Pages/Shared

    Like many web applications, my project will have different types of users

    1. Administrators (content creators)
    2. Users (people who logon and comment, star, like, etc)
    3. General Users (people not logged on)

    As an example... let's say I create a blog entry (as an Admin)

    People will comment on that post (as Users)

    With this in mind, I need two distinct directory structures.

    One for Admins/Content Creators, and one for Users

    I am guessing I will need a /Pages/Blog folder for Users to browse the content.

    I will also need a folder for Blog CRUD operations.  

    Where would this folder reside?

    In the /Areas folder, meaning /Areas/Blog?

    Looking for best practices, and separation of concerns between different types of users.

    Any guidance appreciated.  

    Thank you in advance for your time.

    Thursday, January 31, 2019 1:04 AM

All replies

  • User475983607 posted

    I general have a folder structure that matches the menu.

    Looking for best practices, and separation of concerns between different types of users.

    SoC has nothing to do with your URL structure.

    Thursday, January 31, 2019 1:43 AM