dbContext.ShippingOrders.Where(x => x.Number == new ShippingOrderNumber(1)).Select(x => x.Number).First() works. but something like db.ShippingOrders.AsNoTracking().OrderByDescending(x => x.Number).FirstOrDefault() or simply dbContext.ShippingOrders.First().Number returns null or blows up the change tracker because it thinks the entity's key is null. i have no idea what's going on at this point, i have two other entities with practically copy/pasted variants of this setup and they work fine.