This is a website I created for a company that manufactures miniature scale models.
It was developed in Visual Studio 2022 using the following technologies:
- ASP.NET Core
- MVC / Web API
- Entity Framework
- AngularJS
- Bootstrap
You can view the finished website here.
Here are some screenshots of the website:
You must first define the connection string for the database. In the Solution explorer expand the DustysCorner.DAL project and open the StoreContext.cs file. In the OnCofiguring method you will find the connection string which should look like this:
@"Data Source=YOUR_SERVER_NAME;Initial Catalog=DustysCorner;Persist Security Info=True;User ID=YOUR_USERNAME;Password=YOUR_PASSWORD"
Replace the data source, user id and password with your own database account credentials.
The database will be created and seeded automatically using the StoreDataInitializer class in development mode when you run the DustysCorner.Service project.
If you need to make changes to the database structure you can create a new migration script using the command from the Tools->NuGet Package Manage->Package Manager Console:
dotnet ef migrations add <migration name> -c DustysCorner.DAL.StoreContext
You will need to download the ASP.NET v6.0 framework to run the project. The installer can be found here
I would recommend that you search for Visual Studio 2022 in the Start Menu then run it as Administrator to avoid any errors starting the IIS Express server:
- Right click on the Visual Studio 2022 main application shortcut choose Properties
- Click the Shortcut tab
- Click the Advanced... button
- Check the Run as administrator checkbox
You may need to edit the web projects Debug settings.
- Right click on the web project you need to edit the settings for
- Select Properties
- Select the Debug -> General tab and Open debug launch profiles UI
- Check the App URL is using a free port
- Change the Hosting Model to In Process
- Uncheck Use SSL
To run the website project in development mode you must first right click on the Solution Name in the Solution Explorer. In the Startup Project page you should select Multiple Startup Projects and change the Action for DustyCorner.MVC and DustysCorner.Service to Start. You can now click the run button and both projects will start.
This is a project I created to help me learn AngularJS. I realise the API methods should normally be requested from the Angular controllers instead of initializing with JSON using ng-init on the views. I did this simply to demonstrate using the ASP.NET MVC framework and is not a recommended approach. Since creating this project I have learnt Angular 2+ which is a much better framework. Feel free to modify as you need.