protected virtual void Save(IIntranetActivity activity, Action <IIntranetActivity> afterSaveAction) { var entity = _activityRepository.Get(activity.Id); entity.JsonData = activity.ToJson(); _activityLocationService.Set(activity.Id, activity.Location); _activityRepository.Update(entity); _intranetMediaService.Update(activity.Id, activity.MediaIds.JoinToString()); AssignLinkPreview(activity); afterSaveAction?.Invoke(activity); UpdateActivityCache(activity.Id); }
public Enum GetActivityType(Guid activityId) { var typeId = _activityRepository.Get(activityId)?.Type; if (typeId.HasValue) { return(_activityTypeProvider[typeId.Value]); } return(IntranetActivityTypeEnum.ContentPage); }
public Enum GetActivityType(Guid activityId) { var typeId = _activityRepository.Get(activityId)?.Type; if (typeId.HasValue) { return(_activityTypeProvider[typeId.Value]); } var pagePromotionActivity = _pagePromotionService.Get(activityId); if (pagePromotionActivity != null) { return(pagePromotionActivity.Type); } return(IntranetActivityTypeEnum.ContentPage); }