-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Closed
Milestone
Description
I have an issue then I try to sort by field from subquery
here is code
model.Contacts = await _context.Apartments.Select(s => new ContactsVM
{
ApartmentId = s.ApartmentId,
**Address = _context.Blocks.SingleOrDefault(b => b.BlockId == s.BlockId).Street,**
Number = s.Number,
Floor = s.Floor,
Entrance = s.Entrance,
MainPhone = s.MainPhone,
SecondaryPhone = s.SecondaryPhone,
TertiaryPhone = s.TertiaryPhone,
QuaternaryPhone = s.QuaternaryPhone,
QuinaryPhone = s.QuinaryPhone,
SenaryPhone = s.SenaryPhone,
SeptenaryPhone = s.SeptenaryPhone,
OctonaryPhone = s.OctonaryPhone,
NonaryPhone = s.NonaryPhone,
DenaryPhone = s.DenaryPhone
})
**.OrderBy(o => o.Address)**
.Skip(offset)
.Take(DefaultPageSize)
.ToListAsync();and I get
ArgumentException: Property 'System.String Street' is not defined for type 'System.String'
dvdobrovolskiy