public ContactInfoEntity Execute() { var command = new NpgsqlCommand(Sql, _dataSource.DbConnection); command = _rowMapper.ToRow(command, _contactInfo); _contactInfo.Id = (ulong)command.ExecuteScalar(); _dataSource.CloseDbConnection(); return(_contactInfo); }
public ReceiverEntity Execute() { var command = new NpgsqlCommand(Sql, _dataSource.DbConnection); command = _rowMapper.ToRow(command, _receiver); _receiver.Id = (ulong)command.ExecuteScalar(); _dataSource.CloseDbConnection(); return(_receiver); }
public List <InvoiceItemEntity> Execute() { var command = new NpgsqlCommand(Sql, _dataSource.DbConnection); var resultSet = command.ExecuteReader(); var result = _rowMapper.FromResultSet(resultSet); _dataSource.CloseDbConnection(); return(result); }
public AddressEntity Execute() { var command = new NpgsqlCommand(Sql, _dataSource.DbConnection); command = _rowMapper.ToRow(command, _address); _address.Id = (ulong)command.ExecuteScalar(); _dataSource.CloseDbConnection(); return(_address); }
// TODO ArBy returning id public bool Execute() { var command = new NpgsqlCommand(Sql, _dataSource.DbConnection); command.Parameters.AddWithValue("Id", (long)_id); var result = command.ExecuteNonQuery() > 0; _dataSource.CloseDbConnection(); return(result); }
public InvoicePaymentEntity Execute() { var command = new NpgsqlCommand(Sql, _dataSource.DbConnection); command = _rowMapper.ToRow(command, _InvoicePayment); _InvoicePayment.Id = (ulong)command.ExecuteScalar(); _dataSource.CloseDbConnection(); return(_InvoicePayment); }
public BillingInfoEntity Execute() { var command = new NpgsqlCommand(Sql, _dataSource.DbConnection); command.Parameters.AddWithValue("Id", (long)_queryParamId); command.Prepare(); var resultSet = command.ExecuteReader(); var result = _rowMapper.FromResultSet(resultSet).FirstOrDefault(); _dataSource.CloseDbConnection(); return(result); }
public List <ulong> Execute() { var command = new NpgsqlCommand(Sql, _dataSource.DbConnection); command.Parameters.AddWithValue("id", (long)_invoiceId); var resultSet = command.ExecuteReader(); var ids = new List <ulong>(); while (resultSet.Read()) { ids.Add((ulong)resultSet.GetInt64(0)); } _dataSource.CloseDbConnection(); return(ids); }