Writing the SqlCommandParameterModel class
In this section, we'll write our SqlCommandParameterModel
class. This class is simply a SQL parameter definition model.
Open the SqlCommandParameterModel
class, make the class public, and add the System.Data
namespace.
Now, add the following three parameters:
public string ParameterName { get; set; }
public DbType DataType { get; set; }
public dynamic Value { get; set; }
This class models a standard parameter that consists of the name of the parameter, its database type, and its value.
With that, we have created the core functionality that we need in place for our data access classes. In the following sections, we will be writing data access classes to access data using Entity Framework, Dapper, and ADO.NET.
The reason behind choosing SQL Server for the database server is that it is one of the most common database servers and is used in many business scenarios the world over. In professional environments where...