public DataModel.IDataModelColumnProperties Get_PrimaryKeyProperties() { if (_primaryKeyProperties == null) { _primaryKeyProperties = DataModelColumnProperties.FirstOrDefault(dmc => dmc.IsPrimaryKey); } return(_primaryKeyProperties); }
// Check ownership of datamodel of the following public SqliteCommand GetCommand_Insert(T dataModel) { var query = GetCommandText_Insert(); var insertSQL = new SqliteCommand(query); var pk = DataModelColumnProperties.FirstOrDefault(dmc => dmc.IsPrimaryKey); bool includePK = true; if (pk != null) { includePK = !pk.IsAutoIncrement; } dataModel.AddParameters_AllColumns(insertSQL, includePK); return(insertSQL); }