コード例 #1
0
        public DataModel.IDataModelColumnProperties Get_PrimaryKeyProperties()
        {
            if (_primaryKeyProperties == null)
            {
                _primaryKeyProperties = DataModelColumnProperties.FirstOrDefault(dmc => dmc.IsPrimaryKey);
            }

            return(_primaryKeyProperties);
        }
コード例 #2
0
        // 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);
        }