Hi, I would like to know what solutions there are to reduce an object. I have a model which is used as a return in the controller but I'm only interested in certain properties of that model. The main idea I came up with was to create an anonymous object with only those properties, but I would like to know what options I have.
namespace aplication {
class UserModel{
public string Car{ get; set; }
public string Dir { get; set; }
public string Name { get; set; }
public string Surname { get; set; }
public string Email { get; set; }
}
}
public ActionResult Login() {
UserModel user = new UserModel();
//nuevo objeto con las propiedades Name y email
return View(nuevoObjeto);
}