/// <summary> /// Add a column to the factory /// </summary> /// <param name="expression"></param> /// <returns></returns> public GridColumnsBuilder Add <T>(Expression <Func <TModel, T> > expression) { var p = PropertyBuilder.GetPropertyInfo(expression); string pName = PropertyBuilder.GetPropertyName(p); GridColumnsBuilder column = new GridColumnsBuilder(); this.Columns.Add(column.Data(pName)); return(column); }
/// <summary> /// Add a column to the factory /// </summary> /// <typeparam name="T"></typeparam> /// <param name="propertyName"></param> /// <returns></returns> public GridColumnsBuilder Add <T>(string propertyName) { if (string.IsNullOrEmpty(propertyName)) { throw new ArgumentNullException(nameof(propertyName)); } GridColumnsBuilder column = new GridColumnsBuilder(); this.Columns.Add(column.Data(propertyName)); return(column); }