public IActionResult Edit(int?id, int groupId, string groupName, int minAge, int maxAge) { if (id == null || id == 0) { return(BadRequest()); } var child = _repository.GetChildren((int)id); if (child == null) { return(NotFound()); } AddChildViewModel viewModel = new AddChildViewModel { Children = child, MinAge = minAge, MaxAge = maxAge }; ViewBag.Group = groupName; return(View(viewModel)); }
public async Task <Children> Get(string id) { return(await _childrenRepository.GetChildren(id) ?? new Children()); }