I just need little help about mvc view model. i saw that everyone using mvc view model like this. But that way we are writing more code.
public class Artist
{
public int ArtistId { get; set; }
public string NameSurname { get; set; }
public int Age { get; set; }
}
public class ArtistViewModel
{
public int ArtistId { get; set; }
public string NameSurname { get; set; }
public int Age { get; set; }
public string Whatever { get; set; }
public int Iwant { get; set; }
}
Copy of main class. its work. OK. Cant we do like this
public class ArtistViewModel : Artist
{
public string Whatever { get; set; }
public int Iwant { get; set; }
}
OR
public class ArtistViewModel
{
public Artist Artist { get; set; }
public string Whatever { get; set; }
public int Iwant { get; set; }
}