public IActionResult Create(CreatePaymentDetailsViewModel model) { if (ModelState.IsValid) { PaymentDetails details = new PaymentDetails { PaymentId = model.PaymentId, AmountPaid = model.AmountPaid, Date = model.Date }; _payment.AddPaymentDetail(details); return(View("Index")); } return(View(model)); }