Include only one property, not entire database row
<p>Model:</p>

<pre><code>public class Word
{
    public int ID { get; set; }
    public string Title { get; set; }
    public DateTime? WhenCreated { get; set; }
    public ApplicationUser Author { get; set; }

    [NotMapped]
    public string AuthorName
    {
        get
        {
            if (Author != null)
            {
                return Author.UserName;
            }
            else {
                return "";
            }
        }
    }

    public List&lt;Definition&gt; Definitions { get; set; }
}
</code></pre>

<p>Controller:</p>

<pre><code>[HttpGet]
    public IEnumerable&lt;Word&gt; Get()
    {
        return _db.Words.Include(x=&gt;x.Author).ToList();
    }
</code></pre>

<p>My Controller now returns entire <code>ApplicationUser</code> class which is one of properties of <code>Word</code>. I want to send only one property of <code>ApplicationUser</code>: <code>UserName</code>. How can I do that?</p>

<p>I've added <code>AuthorName</code>, which would return only data that I want from <code>ApplicationUser</code>. Unfortunately I still have to <code>.Include(x=&gt;x.Author)</code> to make this property work. Can I somehow omit including <code>Author</code> in process of data serialization (to hide it when sending data to user)?</p>

<p>I know I can use <code>.Select()</code> method, but it requires me to type all properties I will need. If I modify my Model in the future, I will need to update all those <code>.Select()</code> which will would be inconvenient and waste of time.</p>

<p>How would you solve that?</p>