Exemplo n.º 1
0
 public DataModel.Response.FindAllItemReponse <DataModel.Model.ExperienceModel> GetAlls()
 {
     try
     {
         IExperienceRepository experienceRepository = RepositoryClassFactory.GetInstance().GetExperienceRepository();
         IList <Experience>    experiences          = experienceRepository.FindAll();
         var _experiences = experiences.Select(n => MapperUtil.CreateMapper().Mapper.Map <Experience, ExperienceModel>(n)).ToList();
         return(new FindAllItemReponse <ExperienceModel>
         {
             Items = _experiences,
             ErrorCode = (int)ErrorCode.None,
             Message = string.Empty
         });
     }
     catch (Exception ex)
     {
         return(new FindAllItemReponse <ExperienceModel>
         {
             ErrorCode = (int)ErrorCode.Error,
             Message = ex.Message
         });
     }
 }