In Part III, we started creating a very basic MVC application to host our store. We also created a simple table to store products and methods to perform CRUD transactions and validate data. Now we we introduce building product categories that can be related to products in a “many-to-many” relationship. This means that multiple products can be assigned to a category and a product can be assigned to multiple categories. Creating the Tables The category table is very simple and consists of a name and ......
To keep things simple, I am going to retain the default security framework created by Visual Studio when I created the application. However, I am going to change the database name to something more meaningful. So in web.config, I am changing the connection string to this: <add name="DefaultConnection" connectionString="Data Source=(LocalDb)\v11.0;Initial Catalog=StreetlightStoreSam... Security=SSPI;AttachDBFilen... providerName="System.Data.S... ......
In Part I, I introduced the concept of the Streetlight Store and the architecture. In this segment, we will walk through the creation of a data contract for products, interfaces for managing transactions, and a database-first Entity Framework implementation of the interfaces. The initial plan was to distribute the store as a single library with the intent of using a SQL server database with a fixed schema. However, just as flexibility is important in the front end, it is also important in the back ......