I am using the .NetCore Entity Framework for the first time and want to know if the it is possible to generate a custom model.
When setting up the app, EF created all the models from the database. That is fine and expected.
However, I now created a new controller that returns data that is the result of a complicated linq query.
All my other controllers return a model like this:
return View(characterList);
where characterList is an actual model of a database table.
But how would I create a brand new custom model that does not represent any table in the database?
Thanks!
characterListis being used as the view-model for the view that matches the controller action. There really isn't anything special about the kind of class that you can use there. You can create a brand new class to act as your view-model with whatever properties on it that you need to display your page correctly.