public Task Send(IList <Message> messages) { if (messages == null || messages.Count == 0) { return(Task.FromResult <object>(null)); } var parameter = _dbProviderFactory.CreateParameter(); parameter.ParameterName = "Payload"; parameter.DbType = DbType.Binary; parameter.Value = SqlPayload.ToBytes(messages); var operation = new DbOperation(_connectionString, _insertDml, _logger, parameter); return(operation.ExecuteNonQueryAsync()); }