Currently my view has the need to receive a List containing information from two different models.
Something like this
public class ViewModel
{
[JsonProperty("")]
public List<Unknown> viewModelList;
}
This Unknown type would have information from two different models, like so.
public class FirstModel
{
int w;
int x;
}
public class SecondModel
{
int y;
int z;
}
public class Unknown //Model or ViewModel?
{
[JsonProperty("")]
int w; //From FirstModel
[JsonProperty("")]
int x; //From SecondModel
}
My question is, this Unknown type would have to be a Model? My idea of a Model is that they represent Business entities or Database entities, and ViewModel are abstractions of those models. In this case, Unknown is nothing, but an abstraction of both FirstModel and SecondModel, so I think it characterizes more as a ViewModel, than a Model, but then if I treat it as a ViewModel, I'm unable to make a List out of it, because otherwise my code would be as follows
public class ViewModel
{
[JsonProperty("")]
public List<UnknownViewModel> viewModelList;
}
It would be a ViewModel inside a ViewModel, and I don't know if this is common or good practice.
There's absolutely no functional difference in what you call it. What matters is how you use the types.
A model is simply a type that contains data (or state). And a view-model, as its name suggests, is the model used as the backing for a view (or presentation). That's all.
Here, in your example, you're using Unknown as a model -- one that's being used as the element type of a collection property of a type that will presumably be used as a view-model.