This Question IS NOT A DUP of the question that was listed by Stephen. That question you listed is ultra technical and is not even clear what is being asked unless you are some sort of programming guru... I think that should be taken into consideration before you declare it as dup. Someone looking for help would for the problem I was looking for would not even know how to decipher what is being asked in that question my good sir.
yeah so I have a mvc application and I was trying to display a concatenated field of data... did a search and the internet showed an example where the user created a view model to do the concatenated field. You can see it for yourself if you want: http://www.c-sharpcorner.com/uploadfile/e4ff85/let-mvc-concatenate-for-you/
So the mvc app is in question is using database first and the wizard built the details form view automatically. And for the database table call it has this in the mvc controller as I have it liked to a MS sqlserver view:
The original link Was:
TEST_REQUEST tEST_REQUEST = db.TEST_REQUEST.Find(id);
This was changed to use the Sqlview after it was added to the edmx to the following:
VUE_TEST_DETAILS_FULL tEST_REQUEST = db.VUE_TEST_DETAILS_FULL.SingleOrDefault(r => r.RES_TEST_ID == id);
So I get the following error now when I change the mvc details form to user the new view model:
@model XXXXSystem.ViewModels.TEST_REQUEST_DETAILS_FULL_VM
before adding the view model this worked:
@model XXXXSystem.Models.VUE_TEST_DETAILS_FULL
But now to do this concatenation the internet instructed the user to build a view model it when I do it fails and gives this error.
Should I forget using a view model and just do my concatenation in the ms sqlserver view where it's much easier to comprehend?
Thanks All!
Error: The model item passed into the dictionary is of type 'XXXXXXXSystem.Models.VUE_TEST_DETAILS_FULL', but this dictionary requires a model item of type 'XXXXXXXXXSystem.ViewModels.TEST_REQUEST_DETAILS_FULL_VM'.