public PetaPocoMap <T> CompositePrimaryKey(params Expression <Func <T, object> >[] columns) { var columnNames = new string[columns.Length]; for (int i = 0; i < columns.Length; i++) { columnNames[i] = PropertyHelper <T> .GetProperty(columns[i]).Name; } _petaPocoTypeDefinition.PrimaryKey = string.Join(",", columnNames); return(this); }
private void SetColumnDefinition(Expression <Func <T, object> > property, string dbColumnName, bool?ignoreColumn, bool?resultColumn, bool?versionColumn) { var propertyInfo = PropertyHelper <T> .GetProperty(property); _columnDefinitions[propertyInfo.Name] = new PetaPocoColumnDefinition { PropertyInfo = propertyInfo, DbColumnName = dbColumnName, ResultColumn = resultColumn, IgnoreColumn = ignoreColumn, VersionColumn = versionColumn }; }
public PetaPocoMap <T> PrimaryKey(Expression <Func <T, object> > column, bool autoIncrement) { var propertyInfo = PropertyHelper <T> .GetProperty(column); return(PrimaryKey(propertyInfo.Name, autoIncrement)); }
public PetaPocoMap <T> PrimaryKey(Expression <Func <T, object> > column, string sequenceName) { var propertyInfo = PropertyHelper <T> .GetProperty(column); return(PrimaryKey(propertyInfo.Name, sequenceName)); }