public async Task DeleteAsync(Guid id) { using (var connection = context.CreateConnection()) { await connection.ExecuteAsync(ProductSpecificationQuery.Delete(id)); } }
public async Task <IEnumerable <ProductSpecification> > GetByChildIdAsync(Guid id) { using (var connection = context.CreateConnection()) { var query = await connection.QueryAsync <BUSINESS_WMS_KIT_SPEC>(ProductSpecificationQuery.ByChildId(id)); return(query.Select(r => ToDTO(r)).ToList()); } }
public async Task <ProductSpecification> GetByIdAsync(Guid id) { using (var connection = context.CreateConnection()) { var query = await connection.QueryAsync <BUSINESS_WMS_KIT_SPEC>(ProductSpecificationQuery.ById(id)); return(query.Select(r => ToDTO(r)).SingleOrDefault()); } }
public async Task <ProductSpecification> UpdateAsync(ProductSpecification specification) { using (var connection = context.CreateConnection()) { await connection.ExecuteAsync(ProductSpecificationQuery.Update(ToModel(specification))); return(specification); } }
public async Task <ProductSpecification> CreateAsync(ProductSpecification specification) { if (specification.Id == Guid.Empty) { specification.Id = Guid.NewGuid(); } using (var connection = context.CreateConnection()) { await connection.ExecuteAsync(ProductSpecificationQuery.Insert(ToModel(specification))); return(specification); } }