public IActionResult Advertising(long deviceId) { DeviceAdvertisingsView advertisementView = new DeviceAdvertisingsView(); advertisementView.Device = _deviceService.GetDevices().SingleOrDefault(d => d.Id == deviceId); IEnumerable <Advertisement> advertisings = _advertisingService.GetAdvertisements(deviceId); advertisementView.Advertisements = advertisings; return(View(advertisementView)); }
public override void OnActionExecuted(ActionExecutedContext context) { base.OnActionExecuted(context); ViewBag.DeviceAmount = _deviceService.GetDevices().Count(); ViewBag.UserAmount = _userService.GetUsers().Count(); ViewBag.FileAmount = _advertisingService.GetAdvertisements(0).Count(); }