public async Task <IActionResult> Create([Bind("Id,PartnerTypeId,Name,StartDate,EndDate")] PartnerModel partner) { if (ModelState.IsValid) { partner = _partnerFactory.CreatePartner(partner); return(RedirectToAction(nameof(Index))); } ViewData["PartnerTypeId"] = new SelectList(_partnerTypeFactory.GetAllPartnerTypes(), "Id", "Name", partner.PartnerTypeId); return(View(partner)); }