public override IEnumerable<TemplateViewModel> PartFieldEditorUpdate(ContentPartFieldDefinitionBuilder builder, IUpdateModel updateModel) { var model = new FieldIndexing(); updateModel.TryUpdateModel(model, "FieldIndexing", null, null); builder.WithSetting("FieldIndexing.Included", model.Included ? true.ToString() : null); CreateIndexingTasks(); yield return DefinitionTemplate(model); }
public override IEnumerable <TemplateViewModel> PartFieldEditorUpdate(ContentPartFieldDefinitionBuilder builder, IUpdateModel updateModel) { var model = new FieldIndexing(); updateModel.TryUpdateModel(model, "FieldIndexing", null, null); builder.WithSetting("FieldIndexing.Included", model.Included ? true.ToString() : null); CreateIndexingTasks(); yield return(DefinitionTemplate(model)); }
public override IEnumerable<TemplateViewModel> PartFieldEditorUpdate(ContentPartFieldDefinitionBuilder builder, IUpdateModel updateModel) { var previous = builder.Current.Settings.GetModel<FieldIndexing>(); var model = new FieldIndexing(); updateModel.TryUpdateModel(model, "FieldIndexing", null, null); builder.WithSetting("FieldIndexing.Included", model.Included ? true.ToString() : null); // create indexing tasks only if settings have changed if (model.Included != previous.Included) { // if a field setting has changed, all existing content items need to be re-indexed CreateIndexingTasks(); } yield return DefinitionTemplate(model); }
public override IEnumerable <TemplateViewModel> PartFieldEditorUpdate(ContentPartFieldDefinitionBuilder builder, IUpdateModel updateModel) { var previous = builder.Current.Settings.GetModel <FieldIndexing>(); var model = new FieldIndexing(); updateModel.TryUpdateModel(model, "FieldIndexing", null, null); builder.WithSetting("FieldIndexing.Included", model.Included ? true.ToString() : null); // create indexing tasks only if settings have changed if (model.Included != previous.Included) { // if a field setting has changed, all existing content items need to be re-indexed CreateIndexingTasks(); } yield return(DefinitionTemplate(model)); }