public ISpecialColumnFragmentsCollection <TItem> AddColumnValueRenderFunction <TColumn>(Expression <Func <TItem, TColumn> > columnExpression, RenderFragment <TItem> renderFragment) { var entityType = gridConfigurationProvider.FindGridEntityConfigurationByType(typeof(TItem)); if (entityType is NullEntityType) { var entityTypeBuilder = internalModelBuilder .Entity(typeof(TItem)) .Property(columnExpression.GetPropertyAccess()) .HasBlazorComponentValue(renderFragment); return(this); } var columnName = columnExpression.GetPropertyAccess().Name; var configurationProperty = entityType.FindProperty(columnName); if (configurationProperty is Property property) { new InternalPropertyBuilder(property, internalModelBuilder) .HasBlazorComponentValue(renderFragment); } return(this); }
public MasterDetailTableDataSet( ITableDataSet tableDataSet, IGridConfigurationProvider gridConfigurationProvider, ITableDataAdapterProvider tableDataAdapterProvider) { this.tableDataSet = tableDataSet ?? throw new ArgumentNullException(nameof(tableDataSet)); this.tableDataAdapterProvider = tableDataAdapterProvider ?? throw new ArgumentNullException(nameof(tableDataAdapterProvider)); this.tableDataAdapters = new HashSet <ITableDataAdapter>(); this.selectedDataAdapters = new Dictionary <object, ITableDataAdapter>(); this.gridConfiguration = gridConfigurationProvider?.FindGridEntityConfigurationByType(typeof(TItem)) ?? throw new ArgumentNullException(nameof(gridConfigurationProvider)); }
public void Apply(Type type) { var entityType = gridConfigurationProvider.FindGridEntityConfigurationByType(type); if (entityType is NullEntityType) { var entityTypeBuilder = internalModelBuilder .Entity(type); Apply(entityTypeBuilder); } else { Apply(new InternalEntityTypeBuilder(entityType as EntityType, internalModelBuilder)); } }
private InternalPropertyBuilder GetPropertyBuilder <TColumn>(Expression <Func <TItem, TColumn> > columnExpression) { var entityType = _gridConfigurationProvider.FindGridEntityConfigurationByType(typeof(TItem)); if (entityType is NullEntityType) { return(_internalModelBuilder .Entity(typeof(TItem)) .Property(columnExpression.GetPropertyAccess())); } var columnName = columnExpression.GetPropertyAccess().Name; var configurationProperty = entityType.FindProperty(columnName); if (configurationProperty is Property property) { return(new InternalPropertyBuilder(property, _internalModelBuilder)); } return(null); }
private ImutableGridRendererContext GetImutableGridRendererContext(Type dataSetItemType) { if (imutableRendererContextCache.TryGetValue(dataSetItemType, out var imutableGridRendererContext)) { return(imutableGridRendererContext); } var gridConfiguration = gridConfigurationProvider.FindGridEntityConfigurationByType(dataSetItemType); propertyValueAccessorCache.AddPropertyAccessor(dataSetItemType, new TypeWrapper(dataSetItemType)); imutableGridRendererContext = new ImutableGridRendererContext( gridConfiguration, dataSetItemType.GetProperties().ToList(), propertyValueAccessorCache.GetPropertyAccesor(dataSetItemType) ); imutableRendererContextCache.Add(dataSetItemType, imutableGridRendererContext); return(imutableGridRendererContext); }