- This application is about Online Selling Store for books (for now) and the main purpose is to be used for people such as
- Customers
- Companies
- This WEB application also provides tables which are easy to use and can help the user/admin to easily navigate the products, orders, users, categories etc. This is easily achievable by just simply searching trough the table or setting filters.
Use these instructions to get the project up and running.
You will need the following tools:
Follow these steps to get your development environment set up:
- Clone the repository
- At the root directory, restore required packages by running:
dotnet restore
- Next, build the solution by running:
dotnet build
- Next, within the OnlineSellingStoreWeb directory, launch the back end by running:
dotnet run
- Launch http://localhost:5281 in your browser to view the Web UI.
If you have Visual Studio after cloning Open solution with your IDE, OnlineSellingStoreWeb should be the start-up project. Directly run this project on Visual Studio with F5 or Ctrl+F5. You will see index page of project, you can navigate product and category pages and you can perform crud operations on your browser.
After cloning or downloading the sample you should be able to run it using an In Memory database immediately. The default configuration of Entity Framework Database is "OnlineSellingStoreDeploy21".
-Plus Section
If you wish to use the project with a persistent database, you will need to run its Entity Framework Core migrations before you will be able to run the app, and update the ConfigureDatabases method in Program.cs (see below).
public void ConfigureDatabases(IServiceCollection services)
{
// add real database dependecy
builder.Services.AddDbContext<ApplicationDbContext>(options =>
options.UseSqlServer(builder.Configuration.GetConnectionString("DefaultConnection")));
}
-
Ensure your connection strings in
appsettings.json
point to a local SQL Server instance. -
Open a command prompt in the Web folder and execute the following commands:
dotnet restore
dotnet ef database update -c ApplicationDbContext
Or you can direct call ef commands from Visual Studio Package Manager Console. Open Package Manager Console, set default project to OnlineSellingStore.Data and run below command;
update-database
These commands will create aspnetrun database. You can see from ApplicationDbContext.cs.
- Run the application. The first time you run the application, it will seed aspnetrun sql server database with a few data.
If you modify-change or add new some of entities to Core project, you should run ef migrate commands in order to update your database as the same way but below commands;
add-migration YourCustomEntityChanges
update-database
1. C#
2. ASP .NET Core
3. Visual Studio 2022
4. HTML
5. CSS
6. JavaScript
7. Bootstrap
8. Bootswatch