I feel my question is close to this one, but I want a more general discussion on where code like this should sit. Asp.Net MVC SelectList Refactoring Question?
I currently create my selectlists directly on my entity model, like so.
public SelectList taskDeadlineTime
{
get { return new SelectList(TimeDictionary, "Value", "Key", this.getDeadlineTime()); }
}
This feels a bit wrong, as if I am performing view work, inside my model.
However it does mean that I can just get the property, and my selectlist is there.
Now, should I put this logic in my controller (more code to write) or view (feels wrong, and messy) or just be doing it in a different way.
The reason I am looking this now, is because I am working with comparing two copies of the same object entity, and having select lists as part of the getter directly means it doesn't work. I know I could modify this comparison to handle this, but it just feels wrong to do something visual in the model (unless the preparation of the select list is the correct thing to have in the model)