Esempio n. 1
0
 private CategoryEntity TranslateCategoryContractDataToCategoryEntity(
     Category category)
 {
     return new CategoryEntity
                {
                    CategoryID = category.ID,
                    CategoryName = category.Name,
                    Description = category.Description
                };
 }
Esempio n. 2
0
 /// <summary>
 /// Updates the specified category
 /// </summary>
 /// <param name="category">The category to update</param>
 public void UpdateCategory(Category category)
 {
     try
     {
         CategoryEntity categoryEntity = TranslateCategoryContractDataToCategoryEntity(category);
         _categoryLogic.UpdateCategory(categoryEntity);
     }
     catch (NoNullAllowedException ex)
     {
         throw new FaultException<CategoryFault>(new CategoryFault(ex.Message), FaultSource);
     }
     catch (DataException ex)
     {
         throw new FaultException<CategoryFault>(new CategoryFault(ex.Message), FaultSource);
     }
 }