/// <summary> /// PersonWithIdentfiers /// </summary> /// <returns></returns> public ApiResponse <List <PersonWithIdentfiersResult> > GetPersonWithIdentfier(TestProjectDbContext context) { try { var result = _repository.GetPersonWithIdentfier(context).Select(x => new PersonWithIdentfiersResult { Id = x.Id, FirstName = x.FirstName, LastName = x.LastName, Identifiers = x.Identifiers.Select(a => new IdentifierResult { Id = a.Id, Type = a.Type, Value = a.Value }) }).ToList(); return(ApiResponse <List <PersonWithIdentfiersResult> > .SuccessResult(result)); } catch (Exception ex) when(ex is FailException || ex is ValidationException || ex is ArgumentException) { return(ApiResponse <List <PersonWithIdentfiersResult> > .ErrorResult(message : ex.Message, statusCode : HttpStatusCode.BadRequest)); } catch (Exception ex) when(ex is ErrorException) { //LoggingManager.Error(ex.ToString()); return(ApiResponse <List <PersonWithIdentfiersResult> > .ErrorResult(message : ex.Message)); } catch (Exception ex) { //LoggingManager.Error(ex.ToString()); return(ApiResponse <List <PersonWithIdentfiersResult> > .ErrorResult(message : ex.Message)); } }