concept dapper in category .net

This is an excerpt from Manning's book .NET Core in Action.
In the previous chapter, you created a data-access layer for your supply chain management application. You’ll continue with that example and convert your existing code to use Dapper. I suggest copying the code to a new folder called DapperTest.
Dapper can also map an object’s properties to the parameters in an INSERT SQL statement. Try creating an order with both System.Data and Dapper. You’ll simplify it to just adding the row to the Order table and leave out the SendEmailCommand and transactions for this example. The following listing shows both approaches.
Listing 6.4. Creating a row in the Order table with System.Data and Dapper
public void CreateOrder(Order order) { var command = connection.CreateCommand(); command.CommandText = @"INSERT INTO [Order] (SupplierId, PartTypeId, PartCount, PlacedDate) VALUES (@supplierId, @partTypeId, @partCount, @placedDate); SELECT last_insert_rowid();"; #1 AddParameter(command, "@supplierId", #2 order.SupplierId); AddParameter(command, "@partTypeId", order.PartTypeId); AddParameter(command, "@partCount", order.PartCount); AddParameter(command, "@placedDate", order.PlacedDate); long orderId = (long)command.ExecuteScalar(); #3 order.Id = (int)orderId; #4 } public void CreateOrderDapper(Order order) #5 { order.Id = #6 connection.Query<int>( @"INSERT INTO [Order] (SupplierId, PartTypeId, PartCount, PlacedDate) VALUES (@SupplierId, #7 @PartTypeId, @PartCount, @PlacedDate); SELECT last_insert_rowid();", order).First(); #8 }Both methods use the same SQL statement, with the exception of the slight alteration to the parameter names, because Dapper uses a case-sensitive comparison on the property names of the Order object. Both methods assign the integer return value to the Id property. But where the System.Data approach needs eight C# statements (counting the semicolons), the Dapper approach only needs one.