public int CreateCategory(CategorySoap categorySoap) { try { return(CategoryService.CreateCategory(new CategoryDto { CategoryName = categorySoap.CategoryName })); } catch (ApplicationException ex) { throw new FaultException(ex.Message); } }
public int DeleteCategory(CategorySoap categorySoap) { try { return(CategoryService.DeleteCategory(new CategoryDto { Id = categorySoap.Id })); } catch (ApplicationException ex) { throw new FaultException(ex.Message); } }
public CategoryViewModel GetCategoryById(int categoryId) { try { CategorySoap categorySoap = CategoryServiceClient.GetCategoryById(categoryId); return(new CategoryViewModel { Id = categorySoap.Id, CategoryName = categorySoap.CategoryName }); } catch (FaultException ex) { throw new ApplicationException(ex.Message); } }