public void Update(SurveyResponder entity) { try { var memento = entity.GetMemento(); foreach (SurveyResponse response in memento.Responses) { AddResponse(response); } _context.SaveChanges(); } catch (FeedbackAndSurveyServiceException) { throw; } catch (DbUpdateException e) { throw new ValidationException(e.Message); } catch (Exception e) { throw new DataStorageException(e.Message); } }
public IEnumerable <SurveyPermission> GetPermissions(string jmbg) { SurveyResponder responder = _repository.Get(jmbg); return(responder.GetMemento().Permissions); }