Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- return View(customerModel);
- "The model item passed into the dictionary
- is of type 'CustomerPortal_MVC.Models.CustomerModel',
- but this dictionary requires a model item of type 'CustomerPortal_MVC.Customer'."
- public ActionResult Details()
- {
- using (var context = new CustomerPortalEntities())
- {
- var customers = context.Search_Customer_By_Name("NONA", "WHITE", null);
- CustomerModel customerModel = new CustomerModel();
- foreach (var item in customers)
- {
- customerModel.Account_Number = item.Account_Number;
- customerModel.First_Name = item.First_Name;
- customerModel.Last_Name = item.Last_Name;
- customerModel.Payment_in = item.Payment_in;
- }
- public class CustomerModel
- {
- public int Customer_ID { get; set; }
- public string Account_Number { get; set; }
- public string First_Name { get; set; }
- public string Last_Name { get; set; }
- public string Payment_in { get; set; }
- }
- return View(customerModel);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement