public async Task DeleteAsync(Guid id) { using (var connection = context.CreateConnection()) { await connection.ExecuteAsync(OrderLineQuery.Delete(id)); } }
public async Task <IEnumerable <OrderLine> > GetAllAsync() { using (var connection = context.CreateConnection()) { return(await connection.QueryAsync <OrderLine>(OrderLineQuery.All())); } }
public async Task <IEnumerable <OrderLine> > GetByOrderIdAsync(Guid id) { using (var connection = context.CreateConnection()) { return(await connection.QueryAsync <OrderLine>(OrderLineQuery.ByOrderId(id))); } }
public async Task <OrderLine> GetByIdAsync(Guid id) { using (var connection = context.CreateConnection()) { var query = await connection.QueryAsync <OrderLine>(OrderLineQuery.ById(id)); return(query.SingleOrDefault()); } }
public async Task <OrderLine> UpdateAsync(OrderLine OrderLine) { using (var connection = context.CreateConnection()) { await connection.ExecuteAsync(OrderLineQuery.Update(OrderLine)); return(OrderLine); } }
public OrderLine Create(OrderLine OrderLine) { if (OrderLine.Id == Guid.Empty) { OrderLine.Id = Guid.NewGuid(); } using (var connection = context.CreateConnection()) { connection.Execute(OrderLineQuery.Insert(OrderLine)); return(OrderLine); } }
public async Task <OrderLine> CreateAsync(OrderLine OrderLine) { if (OrderLine.Id == Guid.Empty) { OrderLine.Id = Guid.NewGuid(); } using (var connection = context.CreateConnection()) { await connection.ExecuteAsync(OrderLineQuery.Insert(OrderLine)); return(OrderLine); } }