示例#1
0
 public async Task <object> ExecuteScalarAsync(ISqlCommandDefinition command)
 {
     using (SqlCommand sqlCommand = command.GetCommand())
     {
         sqlCommand.Connection = Connection;
         return(await sqlCommand.ExecuteScalarAsync());
     }
 }
示例#2
0
 public object ExecuteScalar(ISqlCommandDefinition command)
 {
     using (SqlCommand sqlCommand = command.GetCommand())
     {
         sqlCommand.Connection = Connection;
         return(sqlCommand.ExecuteScalar());
     }
 }
示例#3
0
 public int ExecuteNonQuery(ISqlCommandDefinition command)
 {
     using (SqlCommand sqlCommand = command.GetCommand())
     {
         sqlCommand.Connection = Connection;
         return(sqlCommand.ExecuteNonQuery());
     }
 }
示例#4
0
 public async Task <int> ExecuteNonQueryAsync(ISqlCommandDefinition command)
 {
     using (SqlCommand sqlCommand = command.GetCommand())
     {
         sqlCommand.Connection = Connection;
         OpenConnection();
         return(await sqlCommand.ExecuteNonQueryAsync());
     }
 }