public async Task <EventNotification> GetEvent(NotificationTypesEnum typesEnum, int dataId) { return(await Context.EventNotifications .Include(notification => notification.NotificationType) .FirstOrDefaultAsync( notification => notification.DataId == dataId && notification.NotificationTypeId == (int)typesEnum)); }
/// <summary> /// Parse the NotificationFlagsT structure. /// </summary> /// <param name="s">An stream containing NotificationFlagsT structure.</param> public override void Parse(Stream s) { base.Parse(s); ushort flag = ReadUshort(); this.NotificationDataAvailability = (NotificationDataAvailabilityEnum)(flag & 0xf000); this.NotificationType = (NotificationTypesEnum)(flag & 0x0fff); }
public async Task <object> Route(NotificationTypesEnum typesEnum, int dataId) { switch (typesEnum) { case NotificationTypesEnum.Evaluation: return(await _evaluationRepo.GetAnEvaluationWithItsVisitAsync(dataId)); default: return(null); } }
/// <summary> /// Parse the RopRegisterNotificationRequest structure. /// </summary> /// <param name="s">An stream containing RopRegisterNotificationRequest structure.</param> public override void Parse(Stream s) { base.Parse(s); this.RopId = (RopIdType)ReadByte(); this.LogonId = ReadByte(); this.InputHandleIndex = ReadByte(); this.OutputHandleIndex = ReadByte(); this.NotificationTypes = (NotificationTypesEnum)ReadUshort(); if (this.NotificationTypes == NotificationTypesEnum.Extended) { this.Reserved = ReadByte(); } this.WantWholeStore = ReadBoolean(); if (!this.WantWholeStore) { this.FolderId = new FolderID(); this.FolderId.Parse(s); this.MessageId = new MessageID(); this.MessageId.Parse(s); } }
public async Task <NotificationType> Get(NotificationTypesEnum type) { return(await Context.NotificationTypes.FindAsync(type)); }