private void UpdateIndexer(IndexerResource indexerResource) { var indexer = _indexerService.Get(indexerResource.Id); indexer.InjectFrom(indexerResource); indexer.Settings = SchemaDeserializer.DeserializeSchema(indexer.Settings, indexerResource.Fields); ValidateIndexer(indexer); _indexerService.Update(indexer); }
private Notification ConvertToNotification(NotificationResource notificationResource) { var notification = _notificationService.Schema() .SingleOrDefault(i => i.Implementation.Equals(notificationResource.Implementation, StringComparison.InvariantCultureIgnoreCase)); if (notification == null) { throw new BadRequestException("Invalid Notification Implementation"); } notification.InjectFrom(notificationResource); notification.Settings = SchemaDeserializer.DeserializeSchema(notification.Settings, notificationResource.Fields); return(notification); }
private Indexer GetIndexer(IndexerResource indexerResource) { var indexer = _indexerService.Schema() .SingleOrDefault(i => i.Implementation.Equals(indexerResource.Implementation, StringComparison.InvariantCultureIgnoreCase)); if (indexer == null) { throw new BadRequestException("Invalid Indexer Implementation"); } indexer.InjectFrom(indexerResource); indexer.Settings = SchemaDeserializer.DeserializeSchema(indexer.Settings, indexerResource.Fields); ValidateIndexer(indexer); return(indexer); }