如何从控制器中的响应中排除Id字段?
这是我的模特:
public class Dog
{
public long Id { get; set; }
public string Breed { get; set; }
public string Image { get; set; }
}
控制器:
[HttpGet]
public IEnumerable<Dog> GetDog()
{
//return from dog in _context.DogResponse select dog;
return _context.Dog;
}