I am trying to get informations from my User table with User's ID but my controller returns all of navigation properties that connected with foreign keys to other tables.
Code is simply webapi method:
[ResponseType(typeof(User))]
public IHttpActionResult GetUser(int id)
{
User user = db.User.Find(id);
if (user == null)
{
return NotFound();
}
return Ok(user);
}
It doesn't return only User, it returns all navigation properties connected with this User.
How can I return only User?
This post explains selected properties. I want all of properties, but controller returns me all of connected tables datas with foreign keys too.