var realty = _allRealty.Realty.Where(i => i.Category == c).OrderBy(i => i.id);
var realtyobj = new RealtyListViewModel
{
allRealty = realty,
CategoryId = id
};
ViewBag.Title = "Недвижимость";
return View(realtyobj);
var reality = _allReality.Realty.Where(i => i.Category.Id == category).OrderBy(i => i.Id);
ViewBag.Id = id;
null reference ex.