public override void Build(FileModel model, IHostService host) { if (model.Type != DocumentType.Article) { return; } if (!host.HasMetadataValidation) { return; } host.ValidateInputMetadata( model.OriginalFileAndType.File, ((Dictionary<string, object>)model.Content).ToImmutableDictionary().Remove(ConceptualKey)); }
public override void Build(FileModel model, IHostService host) { if (!host.HasMetadataValidation) { return; } switch (model.Type) { case DocumentType.Article: break; case DocumentType.Overwrite: foreach (var item in (List<OverwriteDocumentModel>)model.Content) { host.ValidateInputMetadata(model.OriginalFileAndType.File, item.ConvertTo<ItemViewModel>().Metadata.ToImmutableDictionary()); } break; default: throw new NotSupportedException(); } }