Mitchelln11
Active member
- Joined
- Apr 10, 2020
- Messages
- 39
- Programming Experience
- Beginner
This might be too broad of a topic, but how are you supposed to set up a file structure when using .NET Core MVC.
When creating a new project, you are given the following:
Now, I've created a few projects, and gotten thing to work, only I feel like a professional will look at my folder structure and just be disgusted.
What I've gotten out of the whole MVC setup is:
Models: A place to set up records and fields, probably meant for a database
Controllers: Where all of the work happens
Views: The front end of an application that users actually see.
On projects, I've just been putting methods in my controllers wherever they are relevant
ie:
>>Controllers
>>>EmployeeController
>>>>Method to calculate hours worked against hourly rate
Sure, something will work, but is this just beginner programming? (Which I am)
Is that "Method to calculate hours worked against hourly rate" supposed to be in its own folder of Methods?
I've seen people create their own libraries for separate methods. Wouldn't that mean that the whole MVC setup doesn't follow clean architecture? Would that be why the newer .NET Core web app no longer comes with Controllers, Models, or Views (now Pages)?
What if there's a method that isn't specific to a single Model?
I feel lost as to structuring my web applications.
Does anybody have any good resources for architecture, or file structure?
Just asking as a curious beginner in programming.
Anything would help. Thanks.
When creating a new project, you are given the following:
C#:
>>Dependencies
>>Properties
>>wwwroot
>>Areas
>>Controllers
>>Data
>>Models
>>Services
>>Views
>>appsettings.json
>>Program.cs
>>Startup.cs
Now, I've created a few projects, and gotten thing to work, only I feel like a professional will look at my folder structure and just be disgusted.
What I've gotten out of the whole MVC setup is:
Models: A place to set up records and fields, probably meant for a database
Controllers: Where all of the work happens
Views: The front end of an application that users actually see.
On projects, I've just been putting methods in my controllers wherever they are relevant
ie:
>>Controllers
>>>EmployeeController
>>>>Method to calculate hours worked against hourly rate
Sure, something will work, but is this just beginner programming? (Which I am)
Is that "Method to calculate hours worked against hourly rate" supposed to be in its own folder of Methods?
I've seen people create their own libraries for separate methods. Wouldn't that mean that the whole MVC setup doesn't follow clean architecture? Would that be why the newer .NET Core web app no longer comes with Controllers, Models, or Views (now Pages)?
What if there's a method that isn't specific to a single Model?
I feel lost as to structuring my web applications.
Does anybody have any good resources for architecture, or file structure?
Just asking as a curious beginner in programming.
Anything would help. Thanks.