I current have two models that are independent from each other but want to combine them in one view based on the month they were created.
class Distance{
public int Id{get;set;}
public float DistanceRan { get; set;}
public DateTime DateTime {get; set;}
}
and
class Weight{
public int Id{get;set;}
public float CurrentWeight{ get; set;}
public DateTime DateTime {get; set;}
}
I want to be able to create a view with the dates of the month: 1-12, that when clicked on would then take you to a page that would have each record of Weight/Distance that corresponds to that month.
I would assume I create a model such as:
class WeightDistance{
public int Id{get;set;}
public List<Distance> Distance{ get; set;}
public List<Weight> Weight{get; set;}
}
The logic behind getting each month isn't an issue, the problem is combining them both into a view. How would I go about creating a way to display these together? Would I create myself a controller to pull the data?
I have created a project before that had an Announcement Model and Comment Model, where it had a ModelView that would display all the comments in the details section of the announcement but the link was:
/Announcement/3/Details
Whereas this monthly view I want it to be:
/Month/2/...
Does that require a controller? Sorry I'm quite new and am finding it hard to find specific resources.