void UpdateRegisteredSchema(GridSchemaContainer schemaContainer, IGridSchemaRegistratorContainer fluentServiceRegistrator) { var isNotRegistered = fluentServiceRegistrator.Container.All(o => ((GridSchemaContainer)o).UniqueId != schemaContainer.UniqueId); if (isNotRegistered) { return; } fluentServiceRegistrator.Container.Find(o => ((GridSchemaContainer)o).UniqueId == schemaContainer.UniqueId).GridSchema = _expression; }
public GridSchemaRegistratorVisitor(GridSchemaContainer schemaContainer, Func <IGridSettingDataBuilderWrapper> expression) { expression.Guard("Expresion must not be null."); schemaContainer.Guard("IGridSchemaContainer must not be null"); _schemaContainer = schemaContainer; _expression = expression; ActionsToInvoke = new List <Action <GridSchemaContainer, IGridSchemaRegistratorContainer> > { UpdateRegisteredSchema, RegisterNewSchema }; }
void RegisterNewSchema(GridSchemaContainer schemaContainer, IGridSchemaRegistratorContainer fluentServiceRegistrator) { var isRegistered = fluentServiceRegistrator.Container.Any(o => ((GridSchemaContainer)o).UniqueId == schemaContainer.UniqueId); if (isRegistered) { return; } fluentServiceRegistrator.Container.Add(new GridSchemaContainer { GridName = schemaContainer.GridName, ModelName = schemaContainer.ModelName, ModelNamespace = schemaContainer.ModelNamespace, PrimaryKeyName = schemaContainer.PrimaryKeyName, Order = schemaContainer.Order, ModelPropetyNameToBind = schemaContainer.ModelPropetyNameToBind, GridSchema = _expression }); }
public FluentGridSchemaRegistrator() { Container = new List <IGridSchemaContainer>(); GridSchemaContainer = new GridSchemaContainer(); }