public async Task <IActionResult> Create(List <Availability> model, string id) { var user = await userManager.FindByIdAsync(id); if (user.Id != id) { return(Forbid()); } if (user == null) { return(NotFound()); } foreach (var m in model) { m.UserID = id; await availabilityRepository.Create(m); } return(RedirectToAction("index", "availability", new { id = id })); }