protected override string GetDescription(WorkEvent workEvent, ApplicationUser forUser)
        {
            var stateChangedModel = JsonConvert.DeserializeObject <StateChangedModel>(workEvent.Data);

            if (!workEvent.ObjectId.HasValue)
            {
                throw new PmsException("Error in event model");
            }
            var item = _workItemService.GetWithNoTracking(workEvent.ObjectId.Value);

            _isUserExecutor = workEvent.UserId == item.ExecutorId;
            var  user         = _userService.Get(workEvent.UserId);
            var  text         = GetStartText(user);
            bool needAddition = true;

            text += GetTextForStateChanging(stateChangedModel, item, ref needAddition);
            if (needAddition)
            {
                text += LexicalHelper.GetWorkItemTypeInCase(item.Type, "a") + " ";
            }
            text += item.GetWorkItemIdentityText() + ".";
            return(text);
        }
        protected override string GetDescription(WorkEvent workEvent, ApplicationUser forUser)
        {
            var appointedUser = _userService.Get(workEvent.Data);

            if (appointedUser == null)
            {
                throw new PmsException("Invalid event data. Must be Id.");
            }
            var appointedUserText = appointedUser.Id == forUser.Id
                ? (IsUserAuthor ? " себе " : " вам ")
                : " пользователю " + appointedUser.GetUserIdentityText();

            if (!workEvent.ObjectId.HasValue)
            {
                throw new PmsException("Error in event model");
            }
            var user = _userService.Get(workEvent.UserId);
            var item = _workItemService.GetWithNoTracking(workEvent.ObjectId.Value);
            var text = GetStartText(user);

            text += IsUserAuthor ? $" {NotificationResources.HaveAppointed} " : $" {NotificationResources.Appointed} ";
            text += appointedUserText + $"{LexicalHelper.GetWorkItemTypeInCase(item.Type, "a")} {item.GetWorkItemIdentityText()}.";
            return(text);
        }