public async Task <bool> CreateProductType(ProductTypeServiceModel productTypeServiceModel)
        {
            ProductType productType = productTypeServiceModel.To <ProductType>();

            this.context.ProductTypes.Add(productType);
            int result = await this.context.SaveChangesAsync();

            return(result > 0);
        }
Exemple #2
0
        public async Task <bool> CreateProductType(ProductTypeServiceModel productTypeServiceModel)
        {
            ProductType productType = productTypeServiceModel.To <ProductType>();

            #region old mapping
            //    new ProductType
            //{
            //    Name = productTypeServiceModel.Name
            //};
            #endregion

            context.ProductTypes.Add(productType);
            int result = await context.SaveChangesAsync();

            return(result > 0);
        }