Reputation: 3920
For a .Net MVC application, is it bad practice to have a View Model with methods in it that fill the View Model such as this -
public class MyViewModelClass
{
public string MyProperty1 { get; set; }
public string MyProperty2 { get; set; }
public string GetProperties()
{
this.MyProperty1 = DataRetriever.GetProperty1();
this.MyProperty2 = DataRetriever.GetProperty2();
}
}
Can this cause problems in MVC such as with posting from the view?
Upvotes: 1
Views: 114