public IActionResult Edit(string id) { var userId = _userManager.GetUserId(User); var buy = _context.BulkBuys .Include(x => x.Owner) .FirstOrDefault(x => x.DisplayId == id && !x.IsDeleted && x.OwnerId == userId); if (buy == null) { return(NotFound()); } var model = EditVm.FromEntity(buy); return(View(model)); }