ASP.NET Core - CRUD Using Blazor And Entity Framework Core

Introduction

 
Microsoft has recently announced the release of a new .NET web framework – Blazor. In this article, we are going to create a web application using Blazor with the help of Entity Framework Core. We will be creating a sample Employee Record Management System and perform CRUD operations on it.
 
Prerequisites
  • Install .NET Core 2.1 Preview 2 SDK from here
  • Install preview of Visual Studio 2017 v15.7 from here
  • Install ASP.NET Core Blazor Language Services extension from here
  • SQL Server 2012 or above
Blazor framework is not supported by versions below Visual Studio 2017 v15.7.
 
Before proceeding further, I suggest you read my previous article on getting started with Blazor.
 
Source Code
 
Get the source code from Github.
 
Creating Table
 
We will be using a DB table to store all the records of employees.
 
Open SQL Server and use the following script to create tblEmployee table.
  1. Create table tblEmployee(        
  2.     EmployeeId int IDENTITY(1,1) NOT NULL,        
  3.     Name varchar(20) NOT NULL,        
  4.     City varchar(20) NOT NULL,        
  5.     Department varchar(20) NOT NULL,        
  6.     Gender varchar(6) NOT NULL        
  7. )  
Now, let’s move on to create our web application.
 
Create Blazor Web Application
 
Open Visual Studio and select File >> New >> Project.
 
After selecting the project, a "New Project" dialog will open. Select .NET Core inside the Visual C# menu from the left panel.
 
Then, select “ASP.NET Core Web Application” from available project types. Put the name of the project as BlazorCrud and press OK.
 
 
 
After clicking on OK, a new dialog will open asking you to select the project template. You can observe two drop-down menus at the top left of the template window. Select “.NET Core” and “ASP.NET Core 2.0” from these dropdowns. Then, select the “Blazor (ASP .NET Core hosted)” template and press OK.
 
 
 
Now, our Blazor solution will be created. You can observe the folder structure in Solution Explorer as shown in the below image.
 
 
 
You can observe that we have 3 project files created inside this solution. 
  1. BlazorCrud.Client – It has the client-side code and contains the pages that will be rendered on the browser.
  2. BlazorCrud.Server – It has the server-side codes such as DB related operations and web API.
  3. BlazorCrud.Shared – It contains the shared code that can be accessed by both client and server. 
Execute the program, it will open the browser and you will see a page similar to the one shown below.
 
 
Here you can see a navigation menu on the left side, which contains the navigation to the pages in our application. By default, we have “Counter” and “Fetch Data” pages provided in our application. These default pages will not affect our application but for the sake of this tutorial, we will delete fetchdata and counter pages from BlazorCrud.Client/Pages folder.
 
Adding the Model to the Application
 
Right-click on BlazorCrud.Shared project and then select Add >> New Folder and name the folder as Models. We will be adding our model class in this folder only.
 
Right-click on Models folder and select Add >> Class. Name your class Employee.cs. This class will contain our Employee model properties. Now our BlazorCrud.Shared project has the following structure.
 
 
 
Open Employee.cs and put the following code in it.
  1. using System;  
  2. using System.Collections.Generic;  
  3. using System.ComponentModel.DataAnnotations;  
  4. using System.Text;  
  5.   
  6. namespace BlazorCrud.Shared.Models  
  7. {  
  8.     public class Employee  
  9.     {  
  10.         public int EmployeeId { getset; }  
  11.         [Required]  
  12.         public string Name { getset; }  
  13.         [Required]  
  14.         public string Gender { getset; }  
  15.         [Required]  
  16.         public string Department { getset; }  
  17.         [Required]  
  18.         public string City { getset; }  
  19.     }  
  20. }  
And hence our model has been created. Now we will create our data access layer.
 
Creating Data Access Layer for the Application
 
Right click on BlazorCrud.Server project and then select Add >> New Folder and name the folder as DataAccess. We will be adding our classes to handle database related operations inside this folder only.
 
Right click on DataAccess folder and select Add >> Class. Name your class EmployeeContext.cs. This is our Entity Framework DB context class to interact with database. Open EmployeeContext.cs and put the following code into it.
  1. using BlazorCrud.Shared.Models;  
  2. using Microsoft.EntityFrameworkCore;  
  3. using System;  
  4. using System.Collections.Generic;  
  5. using System.Linq;  
  6. using System.Threading.Tasks;  
  7.   
  8. namespace BlazorCrud.Server.DataAccess  
  9. {  
  10.     public class EmployeeContext : DbContext  
  11.     {  
  12.         public virtual DbSet<Employee> tblEmployee { getset; }  
  13.   
  14.         protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)  
  15.         {  
  16.             if (!optionsBuilder.IsConfigured)  
  17.             {  
  18.                 optionsBuilder.UseSqlServer(@"Put Your Connection string here");  
  19.             }  
  20.         }  
  21.     }  
  22. }  
Do not forget to put your own connection string.
 
Add one more class to DataAccess folder and name it as EmployeeDataAccessLayer.cs. This class will handle our CRUD related DB operations. Open EmployeeDataAccessLayer.cs and put the following code into it.
  1. using BlazorCrud.Shared.Models;  
  2. using Microsoft.EntityFrameworkCore;  
  3. using System;  
  4. using System.Collections.Generic;  
  5. using System.Linq;  
  6. using System.Threading.Tasks;  
  7.   
  8. namespace BlazorCrud.Server.DataAccess  
  9. {  
  10.     public class EmployeeDataAccessLayer  
  11.     {  
  12.         EmployeeContext db = new EmployeeContext();  
  13.   
  14.         //To Get all employees details   
  15.         public IEnumerable<Employee> GetAllEmployees()  
  16.         {  
  17.             try  
  18.             {  
  19.                 return db.tblEmployee.ToList();  
  20.             }  
  21.             catch  
  22.             {  
  23.                 throw;  
  24.             }  
  25.         }  
  26.   
  27.         //To Add new employee record     
  28.         public void AddEmployee(Employee employee)  
  29.         {  
  30.             try  
  31.             {  
  32.                 db.tblEmployee.Add(employee);  
  33.                 db.SaveChanges();  
  34.             }  
  35.             catch  
  36.             {  
  37.                 throw;  
  38.             }  
  39.         }  
  40.   
  41.         //To Update the records of a particluar employee    
  42.         public void UpdateEmployee(Employee employee)  
  43.         {  
  44.             try  
  45.             {  
  46.                 db.Entry(employee).State = EntityState.Modified;  
  47.                 db.SaveChanges();  
  48.             }  
  49.             catch  
  50.             {  
  51.                 throw;  
  52.             }  
  53.         }  
  54.   
  55.         //Get the details of a particular employee    
  56.         public Employee GetEmployeeData(int id)  
  57.         {  
  58.             try  
  59.             {  
  60.                 Employee employee = db.tblEmployee.Find(id);  
  61.                 return employee;  
  62.             }  
  63.             catch  
  64.             {  
  65.                 throw;  
  66.             }  
  67.         }  
  68.   
  69.         //To Delete the record of a particular employee    
  70.         public void DeleteEmployee(int id)  
  71.         {  
  72.             try  
  73.             {  
  74.                 Employee emp = db.tblEmployee.Find(id);  
  75.                 db.tblEmployee.Remove(emp);  
  76.                 db.SaveChanges();  
  77.             }  
  78.             catch  
  79.             {  
  80.                 throw;  
  81.             }  
  82.         }  
  83.     }  
  84. }  
And hence our data access layer is complete. Now, we will proceed to create our web API Controller.
 
Adding the web API Controller to the Application
 
Right click on BlazorCrud.Server/Controllers folder and select Add >> New Item. An “Add New Item” dialog box will open. Select ASP.NET from the left panel, then select “API Controller Class” from templates panel and put the name as EmployeeController.cs. Press OK.
 
 
 
This will create our API EmployeeController class.
 
We will call the methods of EmployeeDataAccessLayer class to fetch data and pass on the data to the client side.
 
Open EmployeeController.cs file and put the following code into it.
  1. using System;  
  2. using System.Collections.Generic;  
  3. using System.Linq;  
  4. using System.Threading.Tasks;  
  5. using BlazorCrud.Server.DataAccess;  
  6. using BlazorCrud.Shared.Models;  
  7. using Microsoft.AspNetCore.Mvc;  
  8.   
  9. namespace BlazorCrud.Server.Controllers  
  10. {  
  11.     public class EmployeeController : Controller  
  12.     {  
  13.         EmployeeDataAccessLayer objemployee = new EmployeeDataAccessLayer();  
  14.   
  15.         [HttpGet]  
  16.         [Route("api/Employee/Index")]  
  17.         public IEnumerable<Employee> Index()  
  18.         {  
  19.             return objemployee.GetAllEmployees();  
  20.         }  
  21.   
  22.         [HttpPost]  
  23.         [Route("api/Employee/Create")]  
  24.         public void Create([FromBody] Employee employee)  
  25.         {  
  26.             if (ModelState.IsValid)  
  27.                 objemployee.AddEmployee(employee);  
  28.         }  
  29.   
  30.         [HttpGet]  
  31.         [Route("api/Employee/Details/{id}")]  
  32.         public Employee Details(int id)  
  33.         {  
  34.   
  35.             return objemployee.GetEmployeeData(id);  
  36.         }  
  37.   
  38.         [HttpPut]  
  39.         [Route("api/Employee/Edit")]  
  40.         public void Edit([FromBody]Employee employee)  
  41.         {  
  42.             if (ModelState.IsValid)  
  43.                 objemployee.UpdateEmployee(employee);  
  44.         }  
  45.   
  46.         [HttpDelete]  
  47.         [Route("api/Employee/Delete/{id}")]  
  48.         public void Delete(int id)  
  49.         {  
  50.             objemployee.DeleteEmployee(id);  
  51.         }  
  52.     }  
  53. }  
At this point of time our BlazorCrud.Server project has the following structure.
 
 
 
We are done with our backend logic. So, we will now proceed to code our client side.
 
Adding Razor View to the Application
 
Right click on BlazorCrud.Client/Pages folder and then select Add >> New Item. An “Add New Item” dialog box will open, select Web from the left panel, then select “Razor View” from templates panel and name it FetchEmployee.cshtml.
 
 
 
This will add a FetchEmployee.cshtml page to our BlazorCrud.Client/Pages folder. Similarly add 3 more pages AddEmployee.cshtml, EditEmployee.cshtml and DeleteEmployee.cshtml.
 
Now our BlazorCrud.Client project has the following structure.
 
 
 
Let’s add codes to these pages
 
FetchEmployee.cshtml
 
This page will be displaying all the employee records present in the database. Additionally, we will also provide action methods Edit and Delete on each record.
 
Open FetchEmployee.cshtml and put the following code in it.
  1. @using BlazorCrud.Shared.Models  
  2. @page "/fetchemployee"  
  3. @inject HttpClient Http  
  4.   
  5. <h1>Employee Data</h1>  
  6. <p>This component demonstrates fetching Employee data from the server.</p>  
  7. <p>  
  8.     <a href="/addemployee">Create New</a>  
  9. </p>  
  10. @if (empList == null)  
  11. {  
  12.     <p><em>Loading...</em></p>  
  13. }  
  14. else  
  15. {  
  16.     <table class='table'>  
  17.         <thead>  
  18.             <tr>  
  19.                 <th>ID</th>  
  20.                 <th>Name</th>  
  21.                 <th>Gender</th>  
  22.                 <th>Department</th>  
  23.                 <th>City</th>  
  24.             </tr>  
  25.         </thead>  
  26.         <tbody>  
  27.             @foreach (var emp in empList)  
  28.             {  
  29.                 <tr>  
  30.                     <td>@emp.EmployeeId</td>  
  31.                     <td>@emp.Name</td>  
  32.                     <td>@emp.Gender</td>  
  33.                     <td>@emp.Department</td>  
  34.                     <td>@emp.City</td>  
  35.                     <td>  
  36.                         <a href='/editemployee/@emp.EmployeeId'>Edit</a>  |  
  37.                         <a href='/delete/@emp.EmployeeId'>Delete</a>  
  38.                     </td>  
  39.                 </tr>  
  40.             }  
  41.         </tbody>  
  42.     </table>  
  43. }  
  44.   
  45. @functions {  
  46. Employee[] empList;  
  47. protected override async Task OnInitAsync()  
  48. {  
  49.     empList = await Http.GetJsonAsync<Employee[]>  
  50.     ("/api/Employee/Index");  
  51. }  
  52. }  
Let’s understand this code. On the top, we have included BlazorEFApp.Shared.Models namespace so that we can use our Employee model class in this page.
We are defining the route of this page using @page directive. So, in this application, if we append “/fetchemployee” to base URL then we will be redirected to this page. We are also injecting HttpClient service to enable web API call.
 
Then we have defined the HTML part to display all the employees record in a tabular manner. We have also added two action links for Edit and Delete which will navigate to EditEmployee.cshtml and DeleteEmployee.cshtml pages respectively.
 
At the bottom of the page, we have a @functions section which contains our business logic. We have created an array variable empList of type Employee and populating it inside OnInitAsync method by calling our web API. This will bind to our HTML table on the page load.
 
AddEmployee.cshtml
 
This page is used to create a new employee record.
 
Open AddEmployee.cshtml and put the following code into it.
  1. @using BlazorCrud.Shared.Models  
  2. @page "/addemployee"  
  3. @inject HttpClient Http  
  4. @inject Microsoft.AspNetCore.Blazor.Services.IUriHelper UriHelper  
  5.   
  6. <h1>Create</h1>  
  7. <h3>Employee</h3>  
  8. <hr />  
  9. <div class="row">  
  10.     <div class="col-md-4">  
  11.         <form>  
  12.             <div class="form-group">  
  13.                 <label for="Name" class="control-label">Name</label>  
  14.                 <input for="Name" class="form-control" bind="@emp.Name" />  
  15.             </div>  
  16.             <div class="form-group">  
  17.                 <label asp-for="Gender" class="control-label">Gender</label>  
  18.                 <select asp-for="Gender" class="form-control" bind="@emp.Gender">  
  19.                     <option value="">-- Select Gender --</option>  
  20.                     <option value="Male">Male</option>  
  21.                     <option value="Female">Female</option>  
  22.                 </select>  
  23.             </div>  
  24.             <div class="form-group">  
  25.                 <label asp-for="Department" class="control-label">Department</label>  
  26.                 <input asp-for="Department" class="form-control" bind="@emp.Department" />  
  27.             </div>  
  28.             <div class="form-group">  
  29.                 <label asp-for="City" class="control-label">City</label>  
  30.                 <input asp-for="City" class="form-control" bind="@emp.City" />  
  31.             </div>  
  32.             <div class="form-group">  
  33.                 <button type="submit" class="btn btn-default" onclick="@(async () => await CreateEmployee())">Save</button>  
  34.                 <button class="btn" onclick="@cancel">Cancel</button>  
  35.             </div>  
  36.         </form>  
  37.     </div>  
  38. </div>  
  39.   
  40. @functions {  
  41. Employee emp = new Employee();  
  42. protected async Task CreateEmployee()  
  43. {  
  44.     await Http.SendJsonAsync(HttpMethod.Post, "/api/Employee/Create", emp);  
  45.     UriHelper.NavigateTo("/fetchemployee");  
  46. }  
  47. void cancel()  
  48. {  
  49.     UriHelper.NavigateTo("/fetchemployee");  
  50. }  
  51. }  
In this page the route is “/addemployee”.
 
We are also injecting "Microsoft.AspNetCore.Blazor.Services.IUriHelper" service to enable URL redirection. The HTML part will generate a form to get inputs from the user. The attribute “bind” is used to bind the value entered in the textbox to the properties of Employee object.
 
In the @functions section we have defined two methods. The method CreateEmployee will be invoked on clicking “Submit” button and send a POST request to our API along with the Employee object emp.
 
The Cancel method will be invoked on clicking cancel button and redirect the user back to FetchEmployee page.
EditEmployee.cshtml
 
This page is used to edit the details of an employee.
 
Open EditEmployee.cshtml and put the following code into it.
  1. @using BlazorCrud.Shared.Models  
  2. @page "/editemployee/{empID}"  
  3. @inject HttpClient Http  
  4. @inject Microsoft.AspNetCore.Blazor.Services.IUriHelper UriHelper  
  5.   
  6. <h2>Edit</h2>  
  7. <h4>Employees</h4>  
  8. <hr />  
  9. <div class="row">  
  10.     <div class="col-md-4">  
  11.         <form>  
  12.             <div class="form-group">  
  13.                 <label for="Name" class="control-label">Name</label>  
  14.                 <input for="Name" class="form-control" bind="@emp.Name" />  
  15.             </div>  
  16.             <div class="form-group">  
  17.                 <label asp-for="Gender" class="control-label">Gender</label>  
  18.                 <select asp-for="Gender" class="form-control" bind="@emp.Gender">  
  19.                     <option value="">-- Select Gender --</option>  
  20.                     <option value="Male">Male</option>  
  21.                     <option value="Female">Female</option>  
  22.                 </select>  
  23.             </div>  
  24.             <div class="form-group">  
  25.                 <label asp-for="Department" class="control-label">Department</label>  
  26.                 <input asp-for="Department" class="form-control" bind="@emp.Department" />  
  27.             </div>  
  28.             <div class=" form-group">  
  29.                 <label asp-for="City" class="control-label">City</label>  
  30.                 <input asp-for="City" class="form-control" bind="@emp.City" />  
  31.             </div>  
  32.             <div class="form-group">  
  33.                 <input type="submit" value="Save" onclick="@(async () => await UpdateEmployee())" class="btn btn-default" />  
  34.                 <input type="submit" value="Cancel" onclick="@cancel" class="btn" />  
  35.             </div>  
  36.         </form>  
  37.     </div>  
  38. </div>  
  39.   
  40. @functions {  
  41. [Parameter]  
  42. string empID { get; set; }  
  43. Employee emp = new Employee();  
  44. protected override async Task OnInitAsync()  
  45. {  
  46.     emp = await Http.GetJsonAsync<Employee>("/api/Employee/Details/" + Convert.ToInt32(empID));  
  47. }  
  48. protected async Task UpdateEmployee()  
  49. {  
  50.     await Http.SendJsonAsync(HttpMethod.Put, "api/Employee/Edit", emp);  
  51.     UriHelper.NavigateTo("/fetchemployee");  
  52. }  
  53. void cancel()  
  54. {  
  55.     UriHelper.NavigateTo("/fetchemployee");  
  56. }  
  57. }  
In this page we have defined the route as “/editemployee/{empID}”. empID is an URL parameter of type string declared in @functions section. We will use the [Parameter] attribute to mark the variable as a parameter. To navigate to this page, we need to pass the employee id in the URL which will be captured in empID variable. If we do not mark the variable with the [Parameter] attribute, we will get an error “Object of type ‘BlazorCrud.Client.Pages.EditEmployee’ has a property matching the name ’empID’, but it does not have [ParameterAttribute] applied.”. This will not allow empID to bind to the employee id value passed in the parameter. 
 
The HTML part is similar to that of AddEmployee.cshtml page. The attribute “bind” is used for two-way binding; i.e., binding the textbox values to employee object properties and vice versa.
 
Inside the @functions section we are fetching the employee records in OnInitAsync method based on the employeeID passed in the parameter. This will bind to the fields in the form on page load itself.
 
UpdateEmployee method will send a PUT request to our API along with the Employee object emp. The Cancel method will be invoked on clicking cancel button and redirect the user back to FetchEmployee page. 
 
DeleteEmployee.cshtml
 
This page will be used to delete an employee record.
 
Open DeleteEmployee.cshtml and put the following code into it:
  1. @using BlazorCrud.Shared.Models    
  2. @page "/delete/{empID}"    
  3. @inject HttpClient Http    
  4. @inject Microsoft.AspNetCore.Blazor.Services.IUriHelper UriHelper    
  5.   
  6. <h2>Delete</h2>    
  7. <h3>Are you sure you want to delete employee with id : @empID</h3>    
  8. <br />    
  9. <div class="col-md-4">    
  10.     <table class="table">    
  11.         <tr>    
  12.             <td>Name</td>    
  13.             <td>@emp.Name</td>    
  14.         </tr>    
  15.         <tr>    
  16.             <td>Gender</td>    
  17.             <td>@emp.Gender</td>    
  18.         </tr>    
  19.         <tr>    
  20.             <td>Department</td>    
  21.             <td>@emp.Department</td>    
  22.         </tr>    
  23.         <tr>    
  24.             <td>City</td>    
  25.             <td>@emp.City</td>    
  26.         </tr>    
  27.     </table>    
  28.     <div class="form-group">    
  29.         <input type="submit" value="Delete" onclick="@(async () => await Delete())" class="btn btn-default" />    
  30.         <input type="submit" value="Cancel" onclick="@cancel" class="btn" />    
  31.     </div>    
  32. </div>    
  33.   
  34. @functions {    
  35. [Parameter]    
  36. string empID { get; set; }    
  37. Employee emp = new Employee();    
  38. protected override async Task OnInitAsync()    
  39. {    
  40.     emp = await Http.GetJsonAsync<Employee>    
  41.     ("/api/Employee/Details/" + Convert.ToInt32(empID));    
  42. }    
  43. protected async Task Delete()    
  44. {    
  45.     await Http.DeleteAsync("api/Employee/Delete/" + Convert.ToInt32(empID));    
  46.     UriHelper.NavigateTo("/fetchemployee");    
  47. }    
  48. void cancel()    
  49. {    
  50.     UriHelper.NavigateTo("/fetchemployee");    
  51. }    
  52. }    
The route for this page is also parametrized since we are fetching the record of the employee on page load.
 
The HTML part will display the employee data and ask the user for a confirmation to delete the employee record.
 
Inside the @functions section we are fetching the employee records in OnInitAsync method based on the employeeID passed in the parameter. This will display the employee records as the page loads.
 
The Delete method will be invoked on clicking “Delete” button, which will send a delete request to our API along with the employee ID of the employee to be deleted. On successful deletion the user will be navigated back to FetchEmployee page.
 
One last thing is to define navigation menu for our application. Open BlazorCrud.Client/Shared/ NavMenu.cshtml file and put the following code in it.
  1. <div class="top-row pl-4 navbar navbar-dark">  
  2.     <a class="navbar-brand" href="/">BlazorCrud</a>  
  3.     <button class="navbar-toggler" onclick=@ToggleNavMenu>  
  4.         <span class="navbar-toggler-icon"></span>  
  5.     </button>  
  6. </div>  
  7. <div class=@(collapseNavMenu ? "collapse" : null) onclick=@ToggleNavMenu>  
  8.     <ul class="nav flex-column">  
  9.         <li class="nav-item px-3">  
  10.             <NavLink class="nav-link" href="/" Match=NavLinkMatch.All>  
  11.                 <span class="oi oi-home" aria-hidden="true"></span> Home  
  12.             </NavLink>  
  13.         </li>  
  14.         <li class="nav-item px-3">  
  15.             <NavLink class="nav-link" href="/fetchemployee">  
  16.                 <span class="oi oi-list-rich" aria-hidden="true"></span> Fetch employee  
  17.             </NavLink>  
  18.         </li>  
  19.     </ul>  
  20. </div>  
  21. @functions {  
  22. bool collapseNavMenu = true;  
  23. void ToggleNavMenu()  
  24. {  
  25.     collapseNavMenu = !collapseNavMenu;  
  26. }  
  27. }  
And that’s it. We have created our first ASP.NET Core application using Blazor and Entity Framework Core.'
 
Execution Demo
 
Launch the application.
 
A web page will open as shown in the image below. The navigation menu on the left showing navigation link for Home and Fetch Employee pages.
 
 
Click on Fetch employee in the navigation menu. It will redirect to FetchEmployee view and display all the employee data on the page. Notice the URL has “/fetchemployee” appended to it as we have defined it using @page directive 
 
 
Since we have not added any data, hence it is empty.
 
Click on CreateNew to navigate to AddEmployee view. Notice the URL has “/addemployee” appended to it as we have defined it using @page directive. Add a new Employee record as shown in the image below:
 
 
After inserting data in all the fields, click on "Save" button. The new employee record will be created and you will be redirected to the FetchEmployee view, displaying records of all the employees. Here, we can also see action methods Edit and Delete corresponding to each record.
 
 
If we want to edit an existing employee record, then click on Edit action link. It will open Edit view as shown below. Here we can change the employee data. Notice that we have passed employee id in the URL parameter.
 
 
Here we have changed the City of employee Swati from New Delhi to Chennai. Click on "Save" to return to the FetchEmployee view to see the updated changes as highlighted in the image below:
 
Now, we will perform Delete operation on the employee named Rahul. Click on Delete action link which will open Delete view asking for a confirmation to delete. Notice that we have passed employee id in the URL parameter.
 
 
Once we click on Delete button, it will delete the employee record and we will be redirected to the FetchEmployee view. Here, we can see that the employee with name Rahul has been removed from our record.
 
 
Deploying the application
 
To learn how to deploy a Blazor application using IIS, refer to Deploying A Blazor Application On IIS
 

Conclusion

 
We have created an ASP.NET Core application using the new web framework – Blazor and Entity Framework Core with the help of Visual Studio 2017 and SQL Server 2012. We have also performed the CRUD operations on our application.
 
You can also fork this application on Github. Try this new framework and let me know what you think of it in the comments section below.
 
You can refer to my other articles here
 
See Also


Similar Articles