C# Entity-Framework: How can I combine a .Find and .Include on a Model Object?

You can use Include() first, then retrieve a single object from the resulting query:

Item item = db.Items
              .Include(i => i.Category)
              .Include(i => i.Brand)
              .FirstOrDefault(x => x.ItemId == id);

Leave a Comment