public IActionResult Get(int id) { try { var child = _childrenService.Get(id); var childrenModels = child.ToApiModel(); return(Ok(childrenModels)); } catch (System.Exception ex) { ModelState.AddModelError("GetChildren", ex.Message); return(BadRequest(ModelState)); } }
public IActionResult Settings() { var user_id = _userManager.GetUserId(HttpContext.User); var profile = _profileService.GetProfileByUserId(user_id); ViewBag.children = _childrenService.Get().Where(e => e.profile_id == profile.id); var profile_bank = _profileBankService.GetProfileBank(profile.id); if (profile_bank == null) { profile_bank = new mp_profile_bank(); } ViewBag.bank = profile_bank; var profile_hmo = _profileHMOService.GetProfileHMO(profile.id); if (profile_hmo == null) { profile_hmo = new mp_profile_hmo(); } ViewBag.profile_hmo = profile_hmo; return(View()); }