Example #1
0
        private async Task <Notification> AddNotification(AddUserNotification request)
        {
            var notification = new Notification
            {
                Id          = request.Id ?? Guid.NewGuid(),
                Date        = DateTime.UtcNow,
                Description = request.Description,
                Level       = request.Level,
                Name        = request.Name,
                Url         = request.Url,
                UserId      = request.UserId,
                Category    = request.Category,
                RelatedId   = request.RelatedId
            };

            await _notificationsRepo.AddNotification(notification, CancellationToken.None).ConfigureAwait(false);

            return(notification);
        }
Example #2
0
        public object Post(AddUserNotification request)
        {
            var task = AddNotification(request);

            return(ToOptimizedResult(task.Result));
        }