Adding and Updating Customers Using Entity Framework with MVC 5

Adding and Updating Customers Using Entity Framework with MVC 5

This example includes both adding a new customer and updating an existing customer using MVC 5 and Entity Framework. It provides a sample code that includes the MVC Controller and View.

Linq To Sql (Delete)

Linq To Sql (Delete)

This example demonstrates data deletion with LINQ to SQL using ASP.NET MVC 5. It deletes a specific customer from a model class named Customer from the database. This operation is performed within a Controller action.

Linq To Sql (Update)

Linq To Sql (Update)

This example demonstrates how to update data using LINQ to SQL with ASP.NET MVC 5. Specific fields of a model class named Customer are updated and the changes are saved to the database. This operation is performed within a Controller action.

Linq To Sql (Insert)

Linq To Sql (Insert)

This example demonstrates inserting data with LINQ to SQL using ASP.NET MVC 5. It adds a new customer to a database table named Customer. The operation is performed in an MVC Controller and the results are displayed with a ViewBag.

SQL Queries

SQL Queries

SQL (Structured Query Language) is a programming language used to interact with a database management system. SQL queries are used to perform database operations. Basic SQL queries are summarised below:

Joining SQL Tables with LINQ in an MVC Application

Joining SQL Tables with LINQ in an MVC Application

In order to join SQL tables using LINQ, you must first have modelled your database with Entity Framework or another ORM (Object-Relational Mapping). In this example I will use Entity Framework