Пример #1
0
 public async Task DeleteAsync(Guid id)
 {
     using (var connection = context.CreateConnection())
     {
         await connection.ExecuteAsync(ProductSpecificationQuery.Delete(id));
     }
 }
Пример #2
0
        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());
            }
        }
Пример #3
0
        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());
            }
        }
Пример #4
0
        public async Task <ProductSpecification> UpdateAsync(ProductSpecification specification)
        {
            using (var connection = context.CreateConnection())
            {
                await connection.ExecuteAsync(ProductSpecificationQuery.Update(ToModel(specification)));

                return(specification);
            }
        }
Пример #5
0
        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);
            }
        }