src/Cassandra/Mapping/Statements/CqlGenerator.cs
/// <summary>
/// Generates a "DELETE FROM tablename WHERE pkcolumns = ?" statement for a POCO of Type T.
/// </summary>
Generates a "DELETE FROM tablename WHERE pkcolumns = ?" statement for a POCO of Type T.
Generates a " DELETE FROM tablename WHERE pkcolumns = ? " statement for a POCO of Type T .
public string GenerateDelete<T>()
        {
            var pocoData = _pocoDataFactory.GetPocoData<T>();
            if (pocoData.Columns.Count == 0)
            {
                throw new InvalidOperationException(string.Format(NoColumns, "DELETE", typeof(T).Name));
            }
            if (pocoData.MissingPrimaryKeyColumns.Count > 0)
            {
                throw new InvalidOperationException(string.Format(MissingPkColumns, "DELETE", typeof(T).Name,
                                                                  pocoData.MissingPrimaryKeyColumns.ToCommaDelimitedString()));
            }
            var pkColumns = String.Join(" AND ", pocoData.GetPrimaryKeyColumns().Select(Escape(pocoData, "{0} = ?")));
            return string.Format("DELETE FROM {0} WHERE {1}", GetEscapedTableName(pocoData), pkColumns);
        }
public string GenerateDelete < T > ( ) { var pocoData = _pocoDataFactory . GetPocoData < T > ( ) ; if ( pocoData . Columns . Count == 0 ) { throw new InvalidOperationException ( string . Format ( NoColumns , " " , typeof ( T ) . Name ) ) ; } if ( pocoData . MissingPrimaryKeyColumns . Count > 0 ) { throw new InvalidOperationException ( string . Format ( MissingPkColumns , " " , typeof ( T ) . Name , pocoData . MissingPrimaryKeyColumns . ToCommaDelimitedString ( ) ) ) ; } var pkColumns = String . Join ( " " , pocoData . GetPrimaryKeyColumns ( ) . Select ( Escape ( pocoData , " " ) ) ) ; return string . Format ( " " , GetEscapedTableName ( pocoData ) , pkColumns ) ; }
Generates a "DELETE FROM tablename WHERE pkcolumns = ?"
Generates a " DELETE FROM tablename WHERE pkcolumns = ? "