public SO_NotificationGeneralViewModel Add(SO_NotificationGeneralViewModel ItemVm)
        {
            var Item = Mapper.Map <SO_NotificationGeneralViewModel, SoNotificationGeneral>(ItemVm);

            _notificationGeneralService.Add(Item);
            return(ItemVm);
        }
Exemple #2
0
 public IActionResult SaveEntity(SO_NotificationGeneralViewModel VendorVm)
 {
     if (!ModelState.IsValid)
     {
         IEnumerable <ModelError> allErrors = ModelState.Values.SelectMany(v => v.Errors);
         return(new BadRequestObjectResult(allErrors));
     }
     else
     {
         if (VendorVm.KeyId == 0)
         {
             _notificationGeneralService.Add(VendorVm);
         }
         else
         {
             _notificationGeneralService.Update(VendorVm);
         }
         _notificationGeneralService.Save();
         return(new OkObjectResult(VendorVm));
     }
 }
 public void Update(SO_NotificationGeneralViewModel ItemVm)
 {
     throw new NotImplementedException();
 }