示例#1
0
 public async Task <int> InsertAsync(ProductAttributeCategoryMapping entity)
 {
     if (entity == null)
     {
         throw new ArgumentNullException("ProductAttributeCategoryMapping");
     }
     return(await _ProductAttributeCategoryMappingRepository.InsertAsync(entity));
 }
示例#2
0
        public async Task <int> DeleteAsync(ProductAttributeCategoryMapping entity)
        {
            if (entity == null)
            {
                throw new ArgumentNullException("ProductAttributeCategoryMapping");
            }

            return(await UpdateAsync(entity));
        }
        public async Task <IHttpActionResult> Delete(int id)
        {
            ProductAttributeCategoryMapping entity = await ProductAttributeCategoryMappingService.FindOneAsync(id);

            if (entity == null)
            {
                return(NotFound());
            }
            await ProductAttributeCategoryMappingService.DeleteAsync(entity);

            return(Ok(entity.ToModel()));
        }
示例#4
0
 public static ProductAttributeCategoryMapping ToEntity(this ProductAttributeCategoryMappingDTO dto, ProductAttributeCategoryMapping entity)
 {
     return(Mapper.Map(dto, entity));
 }
示例#5
0
 public static ProductAttributeCategoryMappingDTO ToModel(this ProductAttributeCategoryMapping entity)
 {
     return(Mapper.Map <ProductAttributeCategoryMapping, ProductAttributeCategoryMappingDTO>(entity));
 }