コード例 #1
0
 public async Task DeleteAsync(Guid id)
 {
     using (var connection = context.CreateConnection())
     {
         await connection.ExecuteAsync(OrderLineQuery.Delete(id));
     }
 }
コード例 #2
0
 public async Task <IEnumerable <OrderLine> > GetAllAsync()
 {
     using (var connection = context.CreateConnection())
     {
         return(await connection.QueryAsync <OrderLine>(OrderLineQuery.All()));
     }
 }
コード例 #3
0
 public async Task <IEnumerable <OrderLine> > GetByOrderIdAsync(Guid id)
 {
     using (var connection = context.CreateConnection())
     {
         return(await connection.QueryAsync <OrderLine>(OrderLineQuery.ByOrderId(id)));
     }
 }
コード例 #4
0
        public async Task <OrderLine> GetByIdAsync(Guid id)
        {
            using (var connection = context.CreateConnection())
            {
                var query = await connection.QueryAsync <OrderLine>(OrderLineQuery.ById(id));

                return(query.SingleOrDefault());
            }
        }
コード例 #5
0
        public async Task <OrderLine> UpdateAsync(OrderLine OrderLine)
        {
            using (var connection = context.CreateConnection())
            {
                await connection.ExecuteAsync(OrderLineQuery.Update(OrderLine));

                return(OrderLine);
            }
        }
コード例 #6
0
        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);
            }
        }
コード例 #7
0
        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);
            }
        }