public async Task <Protocols.Response.Notification> Update(string id, Protocols.Request.NotificationUpdate notificationUpdate)
        {
            var update = notificationUpdate.Data.ToModel();

            var updated = await _mongoDbNotification.UpdateAsync(id, update);

            return(new Protocols.Response.Notification
            {
                ResultCode = ResultCode.Success,
                Data = (updated ?? update).ToProtocol()
            });
        }
Exemple #2
0
        public async Task <Protocols.Response.Notification> Update(Protocols.Request.NotificationUpdate notificationUpdate)
        {
            var update = notificationUpdate.Data.ToModel();

            var filter  = GetFilterDefinition(update.SourceId, update.CrawlingType, update.Type);
            var updated = await _mongoDbNotification.UpsertAsync(filter, update);

            return(new Protocols.Response.Notification
            {
                ResultCode = ResultCode.Success,
                Data = (updated ?? update).ToProtocol()
            });
        }
 public async Task <Protocols.Response.Notification> Update(string id, [FromBody] Protocols.Request.NotificationUpdate notificaion)
 {
     return(await _notificationService.Update(id, notificaion));
 }