public DataCountries(DataModelColumnProperties <int> countryIDProperties, int countryID, DataModelColumnProperties <string> countryNameProperties, string countryName) { ColumnCountryID = new DataModelColumn <int>(countryIDProperties, countryID); DataModelColumns.Add(ColumnCountryID); ColumnCountryName = new DataModelColumn <string>(countryNameProperties, countryName); DataModelColumns.Add(ColumnCountryName); }
/* * public List<IDataModelColumn> Get_ForeignKeys() * { * return DataModelColumns.Where(dc => dc.GetColumnProperties().IsForeignKey()).ToList(); * } */ public List <IDataModelColumn> Get_DataModelColumnsByName(string[] columnNames) { var enm_dmc = DataModelColumns.Where(dmc => columnNames.Contains(dmc.GetColumnProperties().ColumnName)); if (enm_dmc != null) { return(enm_dmc.ToList()); } return(new List <IDataModelColumn>()); }
private void Init(DataModelColumnProperties <int> columnUserIDProperties, DataModelColumnProperties <string> columnFirstNameProperties, DataModelColumnProperties <string> columnLastNameProperties, DataModeForeignKey fkCountry) { ColumnUserID = new DataModelColumn <int>(columnUserIDProperties); DataModelColumns.Add(ColumnUserID); ColumnFirstName = new DataModelColumn <string>(columnFirstNameProperties); DataModelColumns.Add(ColumnFirstName); ColumnLastName = new DataModelColumn <string>(columnLastNameProperties); DataModelColumns.Add(ColumnLastName); FKCountry = fkCountry; DataModelForeignKeys.Add(FKCountry); }
public IDataModelColumn Get_PrimaryKey() { return(DataModelColumns.FirstOrDefault(dmc => dmc.GetColumnProperties().IsPrimaryKey)); }