diff --git a/PetaPoco/Attributes/ColumnAttribute.cs b/PetaPoco/Attributes/ColumnAttribute.cs index a48e8c08..0345c2b3 100644 --- a/PetaPoco/Attributes/ColumnAttribute.cs +++ b/PetaPoco/Attributes/ColumnAttribute.cs @@ -6,7 +6,8 @@ namespace PetaPoco /// The ColumnAttribute class defines an attribute for POCO properties that map to a database column. /// /// - /// This attribute can be used to override the default mapped column name, provide hints to PetaPoco for how to treat DateTime and String columns, and further customize INSERT and UPDATE operations with the use of string templates. + /// This attribute can be used to override the default mapped column name, provide hints to PetaPoco for how to treat DateTime and + /// String columns, and further customize INSERT and UPDATE operations with the use of string templates. /// [AttributeUsage(AttributeTargets.Property)] public class ColumnAttribute : Attribute @@ -18,28 +19,34 @@ public class ColumnAttribute : Attribute public string Name { get; set; } /// - /// Gets or sets whether the column is of type (SQL DB data type VARCHAR). + /// Gets or sets whether the column is of type (SQL DB data type VARCHAR). /// /// - /// For use with properties. This property is implicitly for properties of type . + /// For use with properties. This property is implicitly for properties of type . /// public bool ForceToAnsiString { get; set; } /// - /// Gets or sets whether the column is of type . + /// Gets or sets whether the column is of type . /// /// - /// For use with properties. This property is implicitly for properties of type . + /// For use with properties. This property is implicitly for properties of type . /// public bool ForceToDateTime2 { get; set; } /// - /// Gets or sets whether the DbType.DateTime or DbType.DateTime2 values in this DB column are always UTC. + /// Gets or sets whether the DbType.DateTime or DbType.DateTime2 values in this DB column are always UTC. /// /// - /// No conversion is applied - the of the POCO property's underlying value is simply set to correctly reflect the UTC timezone as an invariant. + /// No conversion is applied - the of the POCO property's underlying value is + /// simply set to correctly reflect the UTC timezone as an invariant. /// - /// If , the underlying 's property is set to Utc; otherwise, the default is used (Unspecified). + /// If , the underlying 's property is set to Utc; otherwise, the default is used (Unspecified). public bool ForceToUtc { get; set; } /// diff --git a/PetaPoco/Attributes/ExplicitColumnsAttribute.cs b/PetaPoco/Attributes/ExplicitColumnsAttribute.cs index dd90ed48..053b54b6 100644 --- a/PetaPoco/Attributes/ExplicitColumnsAttribute.cs +++ b/PetaPoco/Attributes/ExplicitColumnsAttribute.cs @@ -3,7 +3,8 @@ namespace PetaPoco { /// - /// The ExplicitColumnsAttribute class defines an attribute for POCO classes specifying that only explicitly-marked properties should be mapped to columns in the database table. + /// The ExplicitColumnsAttribute class defines an attribute for POCO classes specifying that only explicitly-marked properties should be + /// mapped to columns in the database table. /// /// /// When using this attribute, any properties not decorated with one of the following attributes are ignored by the mapper: diff --git a/PetaPoco/Attributes/IgnoreAttribute.cs b/PetaPoco/Attributes/IgnoreAttribute.cs index c4204df9..975a27ee 100644 --- a/PetaPoco/Attributes/IgnoreAttribute.cs +++ b/PetaPoco/Attributes/IgnoreAttribute.cs @@ -6,8 +6,10 @@ namespace PetaPoco /// The IgnoreAttribute class defines an attribute for POCO properties that should be explicitly ignored by the mapper. /// /// - /// Properties decorated with this attribute are completely ignored by PetaPoco, and do not participate in any database-related operations. - /// If you find yourself using this attribute excessively, consider instead decorating your POCO class with the , and then marking the properties you want mapped with their appropriate column attribute. + /// Properties decorated with this attribute are completely ignored by PetaPoco, and do not participate in any database-related + /// operations. + /// If you find yourself using this attribute excessively, consider instead decorating your POCO class with the , and then marking the properties you want mapped with their appropriate column attribute. /// /// [AttributeUsage(AttributeTargets.Property)] diff --git a/PetaPoco/Attributes/PrimaryKeyAttribute.cs b/PetaPoco/Attributes/PrimaryKeyAttribute.cs index fe02dcc2..0c5328f9 100644 --- a/PetaPoco/Attributes/PrimaryKeyAttribute.cs +++ b/PetaPoco/Attributes/PrimaryKeyAttribute.cs @@ -6,7 +6,9 @@ namespace PetaPoco /// The PrimaryKeyAttribute class defines an attribute for POCO properties that map to primary key columns in the database. /// /// - /// The PrimaryKeyAttribute, when used in a POCO class, designates the decorated property as the primary key column in the database. It can also be used to override the default mapped column name for the primary key, mark the column as auto-incrementing, and optionally assign a sequence name for Oracle sequence columns. + /// The PrimaryKeyAttribute, when used in a POCO class, designates the decorated property as the primary key column in the database. It + /// can also be used to override the default mapped column name for the primary key, mark the column as auto-incrementing, and + /// optionally assign a sequence name for Oracle sequence columns. /// [AttributeUsage(AttributeTargets.Class)] public class PrimaryKeyAttribute : Attribute diff --git a/PetaPoco/Attributes/ResultColumnAttribute.cs b/PetaPoco/Attributes/ResultColumnAttribute.cs index 57ac4b5a..ec208430 100644 --- a/PetaPoco/Attributes/ResultColumnAttribute.cs +++ b/PetaPoco/Attributes/ResultColumnAttribute.cs @@ -60,7 +60,8 @@ public ResultColumnAttribute(IncludeInAutoSelect includeInAutoSelect) } /// - /// Initializes a new instance of the class with the specified column name and auto-select inclusion setting. + /// Initializes a new instance of the class with the specified column name and auto-select + /// inclusion setting. /// /// The name of the database column associated with this property. /// Specifies whether the property should be included in auto-select queries. diff --git a/PetaPoco/Attributes/ValueConverterAttribute.cs b/PetaPoco/Attributes/ValueConverterAttribute.cs index 3b5dd0d2..f61a81f1 100644 --- a/PetaPoco/Attributes/ValueConverterAttribute.cs +++ b/PetaPoco/Attributes/ValueConverterAttribute.cs @@ -6,8 +6,10 @@ namespace PetaPoco /// The ValueConverterAttribute class provides a base class all ValueConverters must derive from and implement. /// /// - /// ValueConverters are used to implement custom two-way conversions between your POCO property data type, and the mapped database column's data type. They are ideal for implementing a custom conversion without requiring any changes to the mapper. - /// To provide a custom ValueConverter for a property, inherit from this class, and supply definitions for both conversion methods for your data type. Decorate the appropriate properties that require your ValueConverter with your derived class. + /// ValueConverters are used to implement custom two-way conversions between your POCO property data type, and the mapped database + /// column's data type. They are ideal for implementing a custom conversion without requiring any changes to the mapper. + /// To provide a custom ValueConverter for a property, inherit from this class, and supply definitions for both conversion methods + /// for your data type. Decorate the appropriate properties that require your ValueConverter with your derived class. /// [AttributeUsage(AttributeTargets.Property)] public abstract class ValueConverterAttribute : Attribute diff --git a/PetaPoco/Core/AnsiString.cs b/PetaPoco/Core/AnsiString.cs index 8619ee71..3e2d97dd 100644 --- a/PetaPoco/Core/AnsiString.cs +++ b/PetaPoco/Core/AnsiString.cs @@ -4,7 +4,8 @@ /// Wraps a Unicode string that will be stored in a VARCHAR DB column as an . /// /// - /// Using this type for a column-mapped POCO property is equivalent to decorating a property with . + /// Using this type for a column-mapped POCO property is equivalent to decorating a property with . /// public class AnsiString { diff --git a/PetaPoco/Core/ColumnInfo.cs b/PetaPoco/Core/ColumnInfo.cs index 2c7ca246..35722e3c 100644 --- a/PetaPoco/Core/ColumnInfo.cs +++ b/PetaPoco/Core/ColumnInfo.cs @@ -8,7 +8,8 @@ namespace PetaPoco /// The ColumnInfo class stores information about a column in the database. /// /// - /// Typically ColumnInfo is automatically populated from the attributes on a POCO object and its properties. It can, however, also be returned from the interface allowing you to provide your own custom bindings between the DB and your POCOs. + /// Typically ColumnInfo is automatically populated from the attributes on a POCO object and its properties. It can, however, also be + /// returned from the interface allowing you to provide your own custom bindings between the DB and your POCOs. /// /// /// @@ -22,16 +23,21 @@ public class ColumnInfo public string ColumnName { get; set; } /// - /// Gets or sets whether this column represents a property that should be updated in queries that include a user-supplied SELECT statement, but ignored in queries generated by auto-select. Result columns are always ignored in UPDATE and INSERT operations. + /// Gets or sets whether this column represents a property that should be updated in queries that include a user-supplied + /// SELECT statement, but ignored in queries generated by auto-select. Result columns are always ignored in UPDATE and + /// INSERT operations. /// - /// If , this property will be updated in SQL query operations containing a user-supplied SELECT statement, and ignored for all other database operations. + /// If , this property will be updated in SQL query operations containing a user-supplied SELECT + /// statement, and ignored for all other database operations. /// public bool ResultColumn { get; set; } /// - /// Gets or sets whether this serves as a ResultColumn that is included with auto-select queries as well as queries containing user-supplied SELECT statements. + /// Gets or sets whether this serves as a ResultColumn that is included with auto-select queries as well as queries containing + /// user-supplied SELECT statements. /// - /// If , this property will be updated in all SQL queries, but ignored for all other database operations such as INSERT and UPDATE. + /// If , this property will be updated in all SQL queries, but ignored for all other database + /// operations such as INSERT and UPDATE. /// public bool AutoSelectedResultColumn { get; set; } @@ -39,20 +45,25 @@ public class ColumnInfo /// Gets or sets a value indicating whether the column's data type should be treated as . /// /// - /// For use with properties. This property is implicitly for properties of type . + /// For use with properties. This property is implicitly for properties of type . /// - /// If , the column's data type is assumed to be DbType.AnsiString (equivalent to the DB data type VARCHAR). + /// If , the column's data type is assumed to be DbType.AnsiString (equivalent to the DB data type VARCHAR). /// /// public bool ForceToAnsiString { get; set; } /// - /// Gets or sets a value indicating whether the column containing a DateTime data type should be treated as DbType.DateTime. + /// Gets or sets a value indicating whether the column containing a DateTime data type should be treated as DbType.DateTime. /// /// - /// For use with properties. This property is implicitly for properties of type . + /// For use with properties. This property is implicitly for properties of type . /// - /// If , the column's data type is assumed to be DbType.DateTime. + /// If , the column's data type is assumed to be DbType.DateTime. /// /// public bool ForceToDateTime2 { get; set; } @@ -61,9 +72,12 @@ public class ColumnInfo /// Gets or sets a value indicating whether the DateTime value of this column should be treated as UTC. /// /// - /// For use with or properties. No conversion is applied - the of the POCO property's underlying value is simply set to correctly reflect the UTC timezone as an invariant. + /// For use with or properties. No conversion is applied - the of the POCO property's underlying value is simply set to correctly reflect the UTC + /// timezone as an invariant. /// - /// If , the DateTime value is assumed to be in UTC. If , the property will be assigned . + /// If , the DateTime value is assumed to be in UTC. If , the property will be assigned . /// /// public bool ForceToUtc { get; set; } diff --git a/PetaPoco/Core/ConventionMapper.cs b/PetaPoco/Core/ConventionMapper.cs index 6233c91f..71201e1f 100644 --- a/PetaPoco/Core/ConventionMapper.cs +++ b/PetaPoco/Core/ConventionMapper.cs @@ -9,7 +9,7 @@ namespace PetaPoco /// The ConventionMapper class represents a configurable convention mapper. /// /// - /// By default this mapper replaces the original without change, ensuring backwards compatibility. + /// By default this mapper replaces the original without change, ensuring backwards compatibility. /// public class ConventionMapper : IMapper { diff --git a/PetaPoco/Core/DatabaseProvider.cs b/PetaPoco/Core/DatabaseProvider.cs index 68c3e0c5..65911993 100644 --- a/PetaPoco/Core/DatabaseProvider.cs +++ b/PetaPoco/Core/DatabaseProvider.cs @@ -14,40 +14,41 @@ namespace PetaPoco.Core { /// - /// The DatabaseProvider class defines a base implementation for database Provider classes, and provides common defaults used by different database engines. + /// The DatabaseProvider class defines a base implementation for database Provider classes, and provides common defaults used by + /// different database management systems. /// public abstract class DatabaseProvider : IProvider { private static readonly ConcurrentDictionary customProviders = new ConcurrentDictionary(); - /// + /// public abstract DbProviderFactory GetFactory(); - /// + /// public virtual bool HasNativeGuidSupport => false; - /// + /// public virtual IPagingHelper PagingUtility => PagingHelper.Instance; - /// + /// public virtual string EscapeTableName(string tableName) => tableName.IndexOf('.') >= 0 ? tableName : EscapeSqlIdentifier(tableName); - /// + /// public virtual string EscapeSqlIdentifier(string sqlIdentifier) => $"[{sqlIdentifier}]"; - /// + /// public virtual string GetParameterPrefix(string connectionString) => "@"; - /// + /// public virtual object MapParameterValue(object value) => value is bool b ? b ? 1 : 0 : value; - /// + /// public virtual void PreExecute(IDbCommand cmd) { } - /// + /// public virtual string BuildPageQuery(long skip, long take, SQLParts parts, ref object[] args) { var sql = $"{parts.Sql}\nLIMIT @{args.Length} OFFSET @{args.Length + 1}"; @@ -55,16 +56,16 @@ public virtual string BuildPageQuery(long skip, long take, SQLParts parts, ref o return sql; } - /// + /// public virtual string GetExistsSql() => "SELECT COUNT(*) FROM {0} WHERE {1}"; - /// + /// public virtual string GetAutoIncrementExpression(TableInfo tableInfo) => null; - /// + /// public virtual string GetInsertOutputClause(string primaryKeyName) => string.Empty; - /// + /// public virtual object ExecuteInsert(Database db, IDbCommand cmd, string primaryKeyName) { cmd.CommandText += ";\nSELECT @@IDENTITY AS NewID;"; @@ -72,7 +73,7 @@ public virtual object ExecuteInsert(Database db, IDbCommand cmd, string primaryK } #if ASYNC - /// + /// public virtual Task ExecuteInsertAsync(CancellationToken cancellationToken, Database db, IDbCommand cmd, string primaryKeyName) { cmd.CommandText += ";\nSELECT @@IDENTITY AS NewID;"; @@ -104,11 +105,13 @@ protected DbProviderFactory GetFactory(params string[] assemblyQualifiedNames) } /// - /// Registers a custom IProvider with a string that will match the beginning of the name of the provider, DbConnection, or DbProviderFactory. + /// Registers a custom IProvider with a string that will match the beginning of the name of the provider, DbConnection, or + /// DbProviderFactory. /// /// The type of IProvider to be registered. /// The string to be matched against the beginning of the provider name. - /// is null, empty, or consists of only white space. + /// is null, empty, or consists of only white + /// space. public static void RegisterCustomProvider(string initialString) where T : IProvider, new() { if (String.IsNullOrWhiteSpace(initialString)) @@ -133,7 +136,8 @@ private static IProvider GetCustomProvider(string name) /// Instantiates a suitable IProvider instance based on the specified provider's type. /// /// The type of provider to be registered. - /// Specifies whether to allow the default to be returned if no matching provider is found. + /// Specifies whether to allow the default to be returned if no + /// matching provider is found. /// The connection string. /// The resolved database provider. /// The name cannot be matched to a provider. @@ -198,7 +202,8 @@ internal static IProvider Resolve(Type providerType, bool allowDefault, string c /// Instantiates a suitable IProvider instance based on the specified provider name. /// /// The provider name. - /// Specifies whether to allow the default to be returned if no matching provider is found. + /// Specifies whether to allow the default to be returned if no + /// matching provider is found. /// The connection string. /// The resolved database provider. /// The name cannot be matched to a provider. @@ -229,7 +234,8 @@ internal static IProvider Resolve(string providerName, bool allowDefault, string providerName.IndexOf("SqlCeConnection", StringComparison.InvariantCultureIgnoreCase) >= 0) return Singleton.Instance; - if (providerName.IndexOf("Npgsql", StringComparison.InvariantCultureIgnoreCase) >= 0 || providerName.IndexOf("pgsql", StringComparison.InvariantCultureIgnoreCase) >= 0) + if (providerName.IndexOf("Npgsql", StringComparison.InvariantCultureIgnoreCase) >= 0 || + providerName.IndexOf("pgsql", StringComparison.InvariantCultureIgnoreCase) >= 0) return Singleton.Instance; if (providerName.IndexOf("Oracle", StringComparison.InvariantCultureIgnoreCase) >= 0) @@ -298,7 +304,9 @@ internal static DbProviderFactory Unwrap(DbProviderFactory factory) /// A cancellation token that can be used to cancel the operation. /// The database instance that will execute the SQL command. /// The SQL command to execute. - /// A task that represents the asynchronous operation. + /// + /// A task that represents the asynchronous operation. + /// protected Task ExecuteNonQueryHelperAsync(CancellationToken cancellationToken, Database db, IDbCommand cmd) => db.ExecuteNonQueryHelperAsync(cancellationToken, cmd); @@ -308,7 +316,9 @@ protected Task ExecuteNonQueryHelperAsync(CancellationToken cancellationToken, D /// A cancellation token that can be used to cancel the operation. /// The database instance that will execute the SQL command. /// The SQL command to execute. - /// A task that represents the asynchronous operation. The task result contains the first column of the first row in the result set. + /// + /// A task that represents the asynchronous operation. The task result contains the first column of the first row in the result set. + /// protected Task ExecuteScalarHelperAsync(CancellationToken cancellationToken, Database db, IDbCommand cmd) => db.ExecuteScalarHelperAsync(cancellationToken, cmd); #endif diff --git a/PetaPoco/Core/DateTime2.cs b/PetaPoco/Core/DateTime2.cs index 540c1f3e..05556170 100644 --- a/PetaPoco/Core/DateTime2.cs +++ b/PetaPoco/Core/DateTime2.cs @@ -6,8 +6,10 @@ namespace PetaPoco /// Wraps a that will be stored in the database as a . /// /// - /// Using this type for a column-mapped POCO property is equivalent to decorating a DateTime property with . - /// DbType.DateTime2 is a data type used by SQL DBs with a larger date range and fractional second precision than DbType.DateTime. + /// Using this type for a column-mapped POCO property is equivalent to decorating a DateTime property with . + /// DbType.DateTime2 is a data type used by SQL DBs with a larger date range and + /// fractional second precision than DbType.DateTime. /// public class DateTime2 { diff --git a/PetaPoco/Core/DateTime2Extensions.cs b/PetaPoco/Core/DateTime2Extensions.cs index e673e7f6..7ba1a902 100644 --- a/PetaPoco/Core/DateTime2Extensions.cs +++ b/PetaPoco/Core/DateTime2Extensions.cs @@ -11,14 +11,14 @@ public static class DateTime2Extensions /// Converts a to its representation. /// /// The DateTime object to be converted. - /// A object containing the converted . + /// A object containing the converted . public static DateTime2 ToDateTime2(this DateTime value) => new DateTime2(value); /// /// Parses a string to its representation. /// /// The string representing a date and time to be converted. - /// A object containing the parsed . + /// A object containing the parsed . /// public static DateTime2 ToDateTime2(this string value) => new DateTime2(DateTime.Parse(value)); } diff --git a/PetaPoco/Core/GridReader.cs b/PetaPoco/Core/GridReader.cs index 0b57d1fa..e78234b5 100644 --- a/PetaPoco/Core/GridReader.cs +++ b/PetaPoco/Core/GridReader.cs @@ -127,7 +127,8 @@ private IEnumerable SinglePocoFromIDataReader(int index) /// The POCO type representing a single result record. /// The zero-based row index to be read from the underlying . /// An array of types representing the POCO types in the returned result set. - /// A function used to connect the POCO instances as a single POCO of type , or to let PetaPoco automatically deduce the relationships. + /// A function used to connect the POCO instances as a single POCO of type , or + /// to let PetaPoco automatically deduce the relationships. /// A composite POCO of type . /// Called after the data reader has been disposed. /// Result records are consumed in the incorrect order, or more than once. @@ -213,7 +214,8 @@ private void NextResult() } /// - /// Disposes the GridReader, closing and releasing the underlying , , and shared . + /// Disposes the GridReader, closing and releasing the underlying , , and shared + /// . /// public void Dispose() { diff --git a/PetaPoco/Core/IGridReader.cs b/PetaPoco/Core/IGridReader.cs index 6fe1f84e..d76af284 100644 --- a/PetaPoco/Core/IGridReader.cs +++ b/PetaPoco/Core/IGridReader.cs @@ -28,10 +28,12 @@ public interface IGridReader : IDisposable IEnumerable Read(); /// - /// Reads a sequence of results from a data reader and projects them into a new form of type using a default mapping function. + /// Reads a sequence of results from a data reader and projects them into a new form of type using a + /// default mapping function. /// /// - /// PetaPoco will automatically attempt to determine the split points and auto-map any additional POCO types into . + /// PetaPoco will automatically attempt to determine the split points and auto-map any additional POCO types into . /// /// The first POCO type, and the projected POCO type representing a single composite result record. /// The second POCO type. @@ -51,10 +53,12 @@ public interface IGridReader : IDisposable IEnumerable Read(Func projector); /// - /// Reads a sequence of results from a data reader and projects them into a new form of type using the provided mapping function. + /// Reads a sequence of results from a data reader and projects them into a new form of type using + /// the provided mapping function. /// /// - /// If is , PetaPoco will automatically attempt to determine the split points and auto-map each POCO type into . + /// If is , PetaPoco will automatically attempt to determine the split points and + /// auto-map each POCO type into . /// /// The first POCO type. /// The second POCO type. diff --git a/PetaPoco/Core/IMapper.cs b/PetaPoco/Core/IMapper.cs index 2ce7029d..b4d73a6d 100644 --- a/PetaPoco/Core/IMapper.cs +++ b/PetaPoco/Core/IMapper.cs @@ -7,7 +7,8 @@ namespace PetaPoco /// Provides a way to hook into PetaPoco's DB-to-POCO mapping mechanism to either customise or completely replace it. /// /// - /// To use this functionality, instantiate a class that implements IMapper and then register it using one of the static register methods. + /// To use this functionality, instantiate a class that implements IMapper and then register it using one of the + /// static register methods. /// /// /// @@ -17,7 +18,8 @@ public interface IMapper /// Returns information about the table associated with a POCO class. /// /// - /// This method must return a valid . To create a TableInfo from a POCO's attributes, use . + /// This method must return a valid . To create a TableInfo from a POCO's attributes, use . /// /// The POCO type representing a single result record in the associated database table. /// A TableInfo instance. @@ -45,7 +47,8 @@ public interface IMapper /// Supplies a function to convert a property value to the correct database value. /// /// - /// This conversion is only used for converting values from POCOs that are being Inserted or Updated. Conversion is not available for parameter values passed directly to queries. + /// This conversion is only used for converting values from POCOs that are being Inserted or Updated. Conversion is not available + /// for parameter values passed directly to queries. /// /// The property to be converted. /// A function to perform the conversion, or if no conversion is needed. diff --git a/PetaPoco/Core/IProvider.cs b/PetaPoco/Core/IProvider.cs index 5e8b9489..3ec7ca57 100644 --- a/PetaPoco/Core/IProvider.cs +++ b/PetaPoco/Core/IProvider.cs @@ -14,7 +14,7 @@ namespace PetaPoco.Core public interface IProvider { /// - /// Gets the supplied by this provider. + /// Gets the supplied by this provider. /// IPagingHelper PagingUtility { get; } @@ -26,7 +26,8 @@ public interface IProvider /// /// Escapes a table name into a suitable format for the associated database provider. /// - /// The name of the table as specified by the client program, or as attributes on the associated POCO class. + /// The name of the table as specified by the client program, or as attributes on the associated POCO + /// class. /// The escaped table name. string EscapeTableName(string tableName); @@ -55,7 +56,8 @@ public interface IProvider object MapParameterValue(object value); /// - /// Called immediately before an SQL command is executed, allowing for modification of the command before being passed to the database provider. + /// Called immediately before an SQL command is executed, allowing for modification of the command before being passed to the + /// database provider. /// /// The SQL command to be executed. void PreExecute(IDbCommand cmd); @@ -83,7 +85,9 @@ public interface IProvider /// The database instance that will execute the SQL command. /// The SQL command to be executed. /// The primary key column name for the table being inserted into. - /// A task that represents the asynchronous operation. The task result contains the primary key of the new record. + /// + /// A task that represents the asynchronous operation. The task result contains the primary key of the new record. + /// Task ExecuteInsertAsync(CancellationToken cancellationToken, Database db, IDbCommand cmd, string primaryKeyName); #endif diff --git a/PetaPoco/Core/Inflection/EnglishInflector.cs b/PetaPoco/Core/Inflection/EnglishInflector.cs index db7479a8..0f0668bd 100644 --- a/PetaPoco/Core/Inflection/EnglishInflector.cs +++ b/PetaPoco/Core/Inflection/EnglishInflector.cs @@ -120,7 +120,8 @@ public string Camelise(string lowercaseAndUnderscoredWord) /// public string Underscore(string pascalCasedWord) { - return Regex.Replace(Regex.Replace(Regex.Replace(pascalCasedWord, @"([A-Z]+)([A-Z][a-z])", "$1_$2"), @"([a-z\d])([A-Z])", "$1_$2"), @"[-\s]", "_").ToLower(); + return Regex.Replace(Regex.Replace(Regex.Replace( + pascalCasedWord, @"([A-Z]+)([A-Z][a-z])", "$1_$2"), @"([a-z\d])([A-Z])", "$1_$2"), @"[-\s]", "_").ToLower(); } /// diff --git a/PetaPoco/Core/Page.cs b/PetaPoco/Core/Page.cs index be33aaf1..7ae4496a 100644 --- a/PetaPoco/Core/Page.cs +++ b/PetaPoco/Core/Page.cs @@ -6,7 +6,8 @@ namespace PetaPoco /// Provides access to the result collection from a paged request. /// /// - /// Represents a paged result set, both providing access to the items on the current page and maintaining state information about the pagination for additional queries. + /// Represents a paged result set, both providing access to the items on the current page and maintaining state information about the + /// pagination for additional queries. /// /// The POCO type representing a single result record. public class Page diff --git a/PetaPoco/Core/PocoData.cs b/PetaPoco/Core/PocoData.cs index 4fb2b0c8..376f66a2 100644 --- a/PetaPoco/Core/PocoData.cs +++ b/PetaPoco/Core/PocoData.cs @@ -31,11 +31,16 @@ public class PocoData public Type Type { get; set; } /// - /// Gets the array of all queryable database column names used by auto-select for query operations when is enabled. + /// Gets the array of all queryable database column names used by auto-select for query operations when is enabled. /// /// - /// Column names are returned unescaped. Escaping should be applied based on the configured if accessing this list to construct an SQL query. To access all - /// Excluded columns include: columns decorated with the , unannotated columns in a POCO marked with the , and any that has opted out of auto-select by setting to or through the property. + /// Column names are returned unescaped. Escaping should be applied based on the configured if + /// accessing this list to construct an SQL query. To access all + /// Excluded columns include: columns decorated with the , unannotated columns in a POCO marked + /// with the , and any that has opted out of auto-select + /// by setting to or through the property. /// public string[] QueryColumns { get; private set; } @@ -154,7 +159,8 @@ public static PocoData ForObject(object obj, string primaryKeyName, IMapper defa } /// - /// Creates a factory function to generate and cache a POCO from a data reader record at runtime. Subsequent reads attempt to locate the object in the for performance gains. + /// Creates a factory function to generate and cache a POCO from a data reader record at runtime. Subsequent reads attempt to locate + /// the object in the for performance gains. /// /// The SQL statement. /// The connection string. @@ -163,7 +169,8 @@ public static PocoData ForObject(object obj, string primaryKeyName, IMapper defa /// The data reader instance. /// The default mapper to use for the POCO. /// A delegate that can convert an record into a POCO. - /// The POCO type is a value type, or the POCO type has no default constructor, or the POCO type is an interface or abstract class. + /// The POCO type is a value type, or the POCO type has no default constructor, or the + /// POCO type is an interface or abstract class. public Delegate GetFactory(string sql, string connectionString, int firstColumn, int columnCount, IDataReader reader, IMapper defaultMapper) { // Create key for cache lookup diff --git a/PetaPoco/Core/Sql.cs b/PetaPoco/Core/Sql.cs index 2ce6c1ce..f79a6e1f 100644 --- a/PetaPoco/Core/Sql.cs +++ b/PetaPoco/Core/Sql.cs @@ -260,7 +260,8 @@ public SqlJoinClause(Sql sql) /// /// Appends an ON expression to the JOIN clause. /// - /// The SQL expression defining the ON condition for the JOIN clause: {table1}.{column1} = {table2}.{column2}. + /// The SQL expression defining the ON condition for the JOIN clause: {table1}.{column1} = + /// {table2}.{column2}. /// The parameters to embed in the SQL string. /// The parent Sql builder, allowing for fluent style concatenation. public Sql On(string onClause, params object[] args) diff --git a/PetaPoco/Core/StandardMapper.cs b/PetaPoco/Core/StandardMapper.cs index d03471ae..c77f0550 100644 --- a/PetaPoco/Core/StandardMapper.cs +++ b/PetaPoco/Core/StandardMapper.cs @@ -4,10 +4,10 @@ namespace PetaPoco { /// - /// This is the original default implementation of used by PetaPoco. + /// This is the original default implementation of used by PetaPoco. /// /// - /// PetaPoco now ships with an improved as the default mapper. + /// PetaPoco now ships with an improved as the default mapper. /// public class StandardMapper : IMapper { diff --git a/PetaPoco/Database.cs b/PetaPoco/Database.cs index 9afcdc02..3c109e57 100644 --- a/PetaPoco/Database.cs +++ b/PetaPoco/Database.cs @@ -59,14 +59,15 @@ public Database(IMapper defaultMapper = null) } /// - /// Constructs an instance with the specified connection string name. The connection string and database provider will be read from the app or web configuration file. + /// Constructs an instance with the specified connection string name. The connection string and database provider will be read from + /// the app or web configuration file. /// /// /// PetaPoco will automatically close and dispose of any connections it creates. /// /// The name of the connection string to locate. /// The default mapper to use when no specific mapper has been registered. - /// is null or empty. + /// is null or empty. /// A connection string cannot be found. public Database(string connectionStringName, IMapper defaultMapper = null) { @@ -116,7 +117,8 @@ public Database(IDbConnection connection, IMapper defaultMapper = null) /// The connection string. /// The database provider name. /// The default mapper to use when no specific mapper has been registered. - /// or is null or empty. + /// or is null or + /// empty. public Database(string connectionString, string providerName, IMapper defaultMapper = null) { if (string.IsNullOrEmpty(connectionString)) @@ -177,7 +179,8 @@ public Database(string connectionString, IProvider provider, IMapper defaultMapp /// /// The build configuration instance. /// is null. - /// A connection string cannot be found or is not configured, or unable to locate a provider. + /// A connection string cannot be found or is not configured, or unable to locate a + /// provider. public Database(IDatabaseBuildConfiguration configuration) { if (configuration == null) @@ -376,7 +379,8 @@ public void CloseSharedConnection() /// Releases the shared connection. /// /// - /// Implicitly called when the instance goes out of scope at the end of a using block, calling to ensure the connection is properly closed. + /// Implicitly called when the instance goes out of scope at the end of a using block, calling to ensure the connection is properly closed. /// public void Dispose() { @@ -394,7 +398,9 @@ public void Dispose() /// /// - /// This method facilitates proper transaction lifetime management, especially when nested. Transactions can be nested but they must all include a call to prior to exiting the scope, otherwise the entire transaction is aborted. + /// This method facilitates proper transaction lifetime management, especially when nested. Transactions can be nested but they must + /// all include a call to prior to exiting the scope, otherwise the entire transaction is + /// aborted. /// /// /// A basic example of using transactional scopes (part pseudocode) is shown below: @@ -419,7 +425,8 @@ public void Dispose() /// ]]> /// /// - /// An reference that must be completed or disposed. + /// An reference that must be completed or disposed. public ITransaction GetTransaction() => new Transaction(this); @@ -573,6 +580,7 @@ private async Task CleanupTransactionAsync() #region Exception Reporting and Logging // TODO: Not in IDatabase interface: `OnException(Exception)`, to allow GridReader's DI impl to accept IDatabase (IAsyncReader is able to correctly use the interface for it's IOC because it doesn't require the OnException)) + /// /// Called if an exception is thrown during a database operation, and invokes the event. /// @@ -631,7 +639,8 @@ public virtual void OnConnectionClosing(IDbConnection connection) /// Called immediately before a database command is executed, and invokes the event. /// /// - /// Override this method to provide custom logging of commands, modification of the IDbCommand before it's executed, or any other custom actions that should be performed before every command + /// Override this method to provide custom logging of commands, modification of the IDbCommand before it's executed, or any other + /// custom actions that should be performed before every command /// /// The SQL command to be executed. public virtual void OnExecutingCommand(IDbCommand cmd) @@ -640,7 +649,7 @@ public virtual void OnExecutingCommand(IDbCommand cmd) } /// - /// Called immediately after completion of a database command execution, and invokes the event. + /// Called immediately after a database command execution completes, and invokes the event. /// /// /// Override this method to provide custom logging or other actions after every command has completed. @@ -889,6 +898,7 @@ public Task> QueryAsync(CancellationToken cancellationToken, => QueryAsync(cancellationToken, CommandType.Text, sql.SQL, sql.Arguments); // TODO: QueryAsync(CancellationToken, string, object[]) takes a caller-provided CancellationToken, but uses a default empty token for wrapped call + /// public Task> QueryAsync(CancellationToken cancellationToken, string sql, params object[] args) => QueryAsync(CancellationToken.None, CommandType.Text, sql, args); @@ -943,6 +953,7 @@ public Task QueryAsync(Action action, CancellationToken cancellationToken, => QueryAsync(action, cancellationToken, CommandType.Text, sql.SQL, sql.Arguments); // TODO: QueryAsync(Action, CancellationToken, string, object[]) takes a caller-provided CancellationToken, but uses a default empty token for wrapped call + /// public Task QueryAsync(Action action, CancellationToken cancellationToken, string sql, params object[] args) => QueryAsync(action, CancellationToken.None, CommandType.Text, sql, args); @@ -1334,6 +1345,7 @@ public Task> FetchAsync(CancellationToken cancellationToken, Sql sql) => FetchAsync(cancellationToken, CommandType.Text, sql.SQL, sql.Arguments); // TODO: FetchAsync(CancellationToken, string, object[]) takes a caller-provided CancellationToken, but uses a default empty token for wrapped call + /// public Task> FetchAsync(CancellationToken cancellationToken, string sql, params object[] args) => FetchAsync(CancellationToken.None, CommandType.Text, sql, args); @@ -1616,6 +1628,7 @@ public Task> SkipTakeAsync(long skip, long take) => SkipTakeAsync(CancellationToken.None, skip, take, string.Empty); // TODO: SkipTakeAsync(long, long, Sql) should forward call to an overload that receives a CancellationToken + /// public Task> SkipTakeAsync(long skip, long take, Sql sql) => SkipTakeAsync(skip, take, sql.SQL, sql.Arguments); @@ -1641,15 +1654,16 @@ public Task> SkipTakeAsync(CancellationToken cancellationToken, long #endif /// - /// Starting with a regular SELECT statement, derives the SQL statements required to query a DB for a page of records and the total number of records. + /// Starting with a regular SELECT statement, derives the SQL statements required to query a DB for a page of records and the + /// total number of records. /// /// The POCO type representing a single result record. /// The number of records to skip before the start of the page. /// The number of records in the page. /// The SQL statement. /// The parameters to embed in the SQL statement. - /// When this method returns, contains the SQL statement to query for the total number of matching records. - /// When this method returns, contains the SQL statement to retrieve a single page of matching records. + /// When this method returns, contains the SQL statement to query for the total number of records. + /// When this method returns, contains the SQL statement to retrieve a single page of records. /// Unable to parse the given statement. protected virtual void BuildPageQueries(long skip, long take, string sql, ref object[] args, out string countSql, out string pageSql) { @@ -1925,7 +1939,8 @@ public object Insert(string tableName, object poco) } /// - /// , , or is null or empty. + /// , , or is null or empty. public object Insert(string tableName, string primaryKeyName, object poco) { if (string.IsNullOrEmpty(tableName)) @@ -1946,7 +1961,8 @@ public object Insert(string tableName, string primaryKeyName, object poco) } /// - /// , , or is null or empty. + /// , , or is null or empty. public object Insert(string tableName, string primaryKeyName, bool autoIncrement, object poco) { if (string.IsNullOrEmpty(tableName)) @@ -1973,12 +1989,14 @@ public Task InsertAsync(string tableName, object poco) => InsertAsync(CancellationToken.None, tableName, poco); /// - /// , , or is null or empty. + /// , , or is null or empty. public Task InsertAsync(string tableName, string primaryKeyName, object poco) => InsertAsync(CancellationToken.None, tableName, primaryKeyName, poco); /// - /// , , or is null or empty. + /// , , or is null or empty. public Task InsertAsync(string tableName, string primaryKeyName, bool autoIncrement, object poco) => InsertAsync(CancellationToken.None, tableName, primaryKeyName, autoIncrement, poco); @@ -2008,7 +2026,8 @@ public Task InsertAsync(CancellationToken cancellationToken, string tabl } /// - /// , , or is null or empty. + /// , , or is null or empty. public Task InsertAsync(CancellationToken cancellationToken, string tableName, string primaryKeyName, object poco) { // TODO: use `string.IsNullOrEmpty(tableName)` (not `tableName == null`) @@ -2029,7 +2048,8 @@ public Task InsertAsync(CancellationToken cancellationToken, string tabl } /// - /// , , or is null or empty. + /// , , or is null or empty. public Task InsertAsync(CancellationToken cancellationToken, string tableName, string primaryKeyName, bool autoIncrement, object poco) { // TODO: use `string.IsNullOrEmpty(tableName)` (not `tableName == null`) @@ -2215,22 +2235,26 @@ public int Update(object poco, object primaryKeyValue, IEnumerable colum } /// - /// , , or is null or empty. + /// , , or is null or empty. public int Update(string tableName, string primaryKeyName, object poco) => Update(tableName, primaryKeyName, poco, null); /// - /// , , or is null or empty. + /// , , or is null or empty. public int Update(string tableName, string primaryKeyName, object poco, IEnumerable columns) => Update(tableName, primaryKeyName, poco, null, columns); /// - /// , , or is null or empty. + /// , , or is null or empty. public int Update(string tableName, string primaryKeyName, object poco, object primaryKeyValue) => Update(tableName, primaryKeyName, poco, primaryKeyValue, null); /// - /// , , or is null or empty. + /// , , or is null or empty. public int Update(string tableName, string primaryKeyName, object poco, object primaryKeyValue, IEnumerable columns) { if (string.IsNullOrEmpty(tableName)) @@ -2292,22 +2316,26 @@ public Task UpdateAsync(object poco, object primaryKeyValue, IEnumerable UpdateAsync(CancellationToken.None, poco, primaryKeyValue, columns); /// - /// , , or is null or empty. + /// , , or is null or empty. public Task UpdateAsync(string tableName, string primaryKeyName, object poco) => UpdateAsync(CancellationToken.None, tableName, primaryKeyName, poco); /// - /// , , or is null or empty. + /// , , or is null or empty. public Task UpdateAsync(string tableName, string primaryKeyName, object poco, IEnumerable columns) => UpdateAsync(CancellationToken.None, tableName, primaryKeyName, poco, columns); /// - /// , , or is null or empty. + /// , , or is null or empty. public Task UpdateAsync(string tableName, string primaryKeyName, object poco, object primaryKeyValue) => UpdateAsync(CancellationToken.None, tableName, primaryKeyName, poco, primaryKeyValue); /// - /// , , or is null or empty. + /// , , or is null or empty. public Task UpdateAsync(string tableName, string primaryKeyName, object poco, object primaryKeyValue, IEnumerable columns) => UpdateAsync(CancellationToken.None, tableName, primaryKeyName, poco, primaryKeyValue, columns); @@ -2351,22 +2379,26 @@ public Task UpdateAsync(CancellationToken cancellationToken, object poco, o } /// - /// , , or is null or empty. + /// , , or is null or empty. public Task UpdateAsync(CancellationToken cancellationToken, string tableName, string primaryKeyName, object poco) => UpdateAsync(cancellationToken, tableName, primaryKeyName, poco, null); /// - /// , , or is null or empty. + /// , , or is null or empty. public Task UpdateAsync(CancellationToken cancellationToken, string tableName, string primaryKeyName, object poco, IEnumerable columns) => UpdateAsync(cancellationToken, tableName, primaryKeyName, poco, null, columns); /// - /// , , or is null or empty. + /// , , or is null or empty. public Task UpdateAsync(CancellationToken cancellationToken, string tableName, string primaryKeyName, object poco, object primaryKeyValue) => UpdateAsync(cancellationToken, tableName, primaryKeyName, poco, primaryKeyValue, null); /// - /// , , or is null or empty. + /// , , or is null or empty. public Task UpdateAsync(CancellationToken cancellationToken, string tableName, string primaryKeyName, object poco, object primaryKeyValue, IEnumerable columns) { if (string.IsNullOrEmpty(tableName)) @@ -2717,8 +2749,10 @@ public bool IsNew(string primaryKeyName, object poco) /// The table's primary key column name. /// The PocoData instance for the specified POCO. /// The POCO instance to check. - /// is null or empty, or is an ExpandoObject. - /// The doesn't have a property matching the primary key column name. + /// is null or empty, or is an + /// ExpandoObject. + /// The doesn't have a property matching the primary key column + /// name. protected virtual bool IsNew(string primaryKeyName, PocoData pocoData, object poco) { if (string.IsNullOrEmpty(primaryKeyName) || poco is ExpandoObject) @@ -2782,10 +2816,12 @@ public void Save(object poco) } // TODO: Inconsistent exception types for same params. Save(string,string,object) throws: first 2 types (2 lines) from IsNew, last 3 types (1 line) from Insert and Update. `primaryKeyName` overlaps with 2 different exception types. + /// /// is null or empty. /// is null. - /// , , or is null or empty. + /// , , or is null or empty. public void Save(string tableName, string primaryKeyName, object poco) { if (IsNew(primaryKeyName, poco)) @@ -2802,7 +2838,8 @@ public Task SaveAsync(object poco) /// /// is null or empty. - /// , , or is null or empty. + /// , , or is null or empty. public Task SaveAsync(string tableName, string primaryKeyName, object poco) => SaveAsync(CancellationToken.None, tableName, primaryKeyName, poco); @@ -2816,7 +2853,8 @@ public Task SaveAsync(CancellationToken cancellationToken, object poco) /// /// is null or empty. - /// , , or is null or empty. + /// , , or is null or empty. public Task SaveAsync(CancellationToken cancellationToken, string tableName, string primaryKeyName, object poco) { if (IsNew(primaryKeyName, poco)) @@ -3192,7 +3230,9 @@ private object CommandHelper(IDbCommand cmd, Func executionF /// /// A cancellation token that can be used to cancel the operation. /// The SQL command to execute. - /// A task that represents the asynchronous operation. The task result contains a data reader for reading the result set. + /// + /// A task that represents the asynchronous operation. The task result contains a data reader for reading the result set. + /// /// internal protected async Task ExecuteReaderHelperAsync(CancellationToken cancellationToken, IDbCommand cmd) { @@ -3211,7 +3251,9 @@ internal protected async Task ExecuteReaderHelperAsync(Cancellation /// /// A cancellation token that can be used to cancel the operation. /// The SQL command to execute. - /// A task that represents the asynchronous operation. The task result contains the number of rows affected. + /// + /// A task that represents the asynchronous operation. The task result contains the number of rows affected. + /// /// internal protected async Task ExecuteNonQueryHelperAsync(CancellationToken cancellationToken, IDbCommand cmd) { @@ -3230,7 +3272,9 @@ internal protected async Task ExecuteNonQueryHelperAsync(CancellationToken /// /// A cancellation token that can be used to cancel the operation. /// The SQL command to execute. - /// A task that represents the asynchronous operation. The task result contains the first column of the first row in the result set. + /// + /// A task that represents the asynchronous operation. The task result contains the first column of the first row in the result set. + /// /// internal protected Task ExecuteScalarHelperAsync(CancellationToken cancellationToken, IDbCommand cmd) { @@ -3244,13 +3288,17 @@ internal protected Task ExecuteScalarHelperAsync(CancellationToken cance } // TODO: `CommandHelperAsync(CancellationToken, DbCommand, Func>` takes DBCommand type; inconsistent with synchronous version `CommandHelper(IDbCommand, Func)` which uses IDbCommand type (is this intentional?) + /// /// Asynchronously executes an SQL command using the provided function and returns the result. /// /// A cancellation token that can be used to cancel the operation. /// The SQL command to execute. /// The function to execute the SQL command and return the result. - /// A task that represents the asynchronous operation. The task result contains an object containing the result of the SQL command execution. + /// + /// A task that represents the asynchronous operation. The task result contains an object containing the result of the SQL command + /// execution. + /// private async Task CommandHelperAsync(CancellationToken cancellationToken, DbCommand cmd, Func> executionFunction) { DoPreExecute(cmd); @@ -3365,7 +3413,8 @@ public IsolationLevel? IsolationLevel /// /// Default is . /// - /// If , PetaPoco will automatically generate the SELECT portion of the query when needed if not explicitly provided in the supplied SQL statement. + /// If , PetaPoco will automatically generate the SELECT portion of the query when needed if not + /// explicitly provided in the supplied SQL statement. /// /// In the following example, all three queries below will result in the same outcome: /// @@ -3385,17 +3434,17 @@ public IsolationLevel? IsolationLevel public bool EnableAutoSelect { get; set; } /// - /// - /// Default is . + /// Default is . /// - /// If , parameters can be named "?myparam" in the SQL string, and populated from properties of the passed-in argument values. + /// If , parameters can be named "?myparam" in the SQL string, and populated from properties of the + /// passed-in argument values. public bool EnableNamedParams { get; set; } /// - /// - /// Default is 0. + /// Default is 0. /// - /// If 0, PetaPoco will use the default value for the active database (typically 30 seconds). + /// If 0, PetaPoco will use the default value for the active database (typically 30 seconds). public int CommandTimeout { get; set; } /// diff --git a/PetaPoco/DatabaseConfiguration.cs b/PetaPoco/DatabaseConfiguration.cs index 9c01ceee..e8798c63 100644 --- a/PetaPoco/DatabaseConfiguration.cs +++ b/PetaPoco/DatabaseConfiguration.cs @@ -38,7 +38,7 @@ void IBuildConfigurationSettings.TryGetSetting(string key, Action onGetAct /// /// Starts a new PetaPoco build configuration. /// - /// An instance of to form a fluent interface. + /// An instance of to form a fluent interface. public static IDatabaseBuildConfiguration Build() { return new DatabaseConfiguration(); diff --git a/PetaPoco/DatabaseConfigurationExtensions.cs b/PetaPoco/DatabaseConfigurationExtensions.cs index 793b2919..ae25e88f 100644 --- a/PetaPoco/DatabaseConfigurationExtensions.cs +++ b/PetaPoco/DatabaseConfigurationExtensions.cs @@ -5,7 +5,7 @@ namespace PetaPoco { /// - /// Extension methods for , and the fluent interface integration. + /// Extension methods for , and the fluent interface integration. /// public static class DatabaseConfigurationExtensions { @@ -59,7 +59,7 @@ public static IDatabaseBuildConfiguration UsingCommandTimeout(this IDatabaseBuil #region AutoSelect Settings /// - /// Enables auto-select, equivalent to setting to . + /// Enables auto-select, equivalent to setting to . /// /// The configuration source. /// The original configuration, to form a fluent interface. @@ -70,7 +70,7 @@ public static IDatabaseBuildConfiguration WithAutoSelect(this IDatabaseBuildConf } /// - /// Disables auto-select, equivalent to setting to . + /// Disables auto-select, equivalent to setting to . /// /// The configuration source. /// The original configuration, to form a fluent interface. @@ -85,7 +85,7 @@ public static IDatabaseBuildConfiguration WithoutAutoSelect(this IDatabaseBuildC #region NamedParams Settings /// - /// Enables named parameters, equivalent to setting to . + /// Enables named parameters, equivalent to setting to . /// /// The configuration source. /// The original configuration, to form a fluent interface. @@ -96,7 +96,7 @@ public static IDatabaseBuildConfiguration WithNamedParams(this IDatabaseBuildCon } /// - /// Disables named parameters, equivalent to setting to . + /// Disables named parameters, equivalent to setting to . /// /// The configuration source. /// The original configuration, to form a fluent interface. @@ -112,7 +112,8 @@ public static IDatabaseBuildConfiguration WithoutNamedParams(this IDatabaseBuild #if !NETSTANDARD /// - /// Specifies a connection string name to be used to locate a connection string. The and will be read from the app or web configuration file. + /// Specifies a connection string name to be used to locate a connection string. The and + /// will be read from the app or web configuration file. /// /// /// PetaPoco will automatically close and dispose of any connections it creates. @@ -120,7 +121,7 @@ public static IDatabaseBuildConfiguration WithoutNamedParams(this IDatabaseBuild /// The configuration source. /// The name of the connection string to locate. /// The original configuration, to form a fluent interface. - /// is null or empty. + /// is null or empty. public static IDatabaseBuildConfiguration UsingConnectionStringName(this IDatabaseBuildConfiguration source, string connectionStringName) { if (string.IsNullOrEmpty(connectionStringName)) @@ -139,7 +140,7 @@ public static IDatabaseBuildConfiguration UsingConnectionStringName(this IDataba /// The configuration source. /// The connection string. /// The original configuration, to form a fluent interface. - /// is null or empty. + /// is null or empty. public static IDatabaseBuildConfiguration UsingConnectionString(this IDatabaseBuildConfiguration source, string connectionString) { if (string.IsNullOrEmpty(connectionString)) @@ -157,7 +158,7 @@ public static IDatabaseBuildConfiguration UsingConnectionString(this IDatabaseBu /// The configuration source. /// The database connection. /// The original configuration, to form a fluent interface. - /// is null. + /// is null. public static IDatabaseBuildConfiguration UsingConnection(this IDatabaseBuildConfiguration source, IDbConnection connection) { if (connection == null) @@ -176,7 +177,7 @@ public static IDatabaseBuildConfiguration UsingConnection(this IDatabaseBuildCon /// The configuration source. /// The provider name to resolve. /// The original configuration, to form a fluent interface. - /// is null or empty. + /// is null or empty. public static IDatabaseBuildConfiguration UsingProviderName(this IDatabaseBuildConfiguration source, string providerName) { if (string.IsNullOrEmpty(providerName)) @@ -189,7 +190,7 @@ public static IDatabaseBuildConfiguration UsingProviderName(this IDatabaseBuildC /// Specifies the to use. /// /// - /// This takes precedence over . + /// This takes precedence over . /// /// The provider type, which must implement the the interface. /// The configuration source. @@ -205,7 +206,7 @@ public static IDatabaseBuildConfiguration UsingProvider(this IDatabas /// Specifies the to use, with an accompanying configuration provider action. /// /// - /// This takes precedence over . + /// This takes precedence over . /// /// The provider type, which must implement the the interface. /// The configuration source. @@ -285,7 +286,8 @@ public static IDatabaseBuildConfiguration UsingDefaultMapper(this IData } /// - /// Specifies the default to use when no specific mapper has been registered, with an accompanying configuration mapper action. + /// Specifies the default to use when no specific mapper has been registered, with an accompanying + /// configuration mapper action. /// /// The mapper type, which must implement the the interface. /// The configuration source. @@ -321,7 +323,8 @@ public static IDatabaseBuildConfiguration UsingDefaultMapper(this IData } /// - /// Specifies the default to use when no specific mapper has been registered, with an accompanying configuration mapper action. + /// Specifies the default to use when no specific mapper has been registered, with an accompanying + /// configuration mapper action. /// /// The mapper type, which must implement the the interface. /// The configuration source. @@ -462,7 +465,7 @@ public static IDatabaseBuildConfiguration UsingExceptionThrown(this IDatabaseBui #region Finalize Fluent Configuration /// - /// Creates an instance of PetaPoco using the specified . + /// Creates an instance of PetaPoco using the specified . /// /// The configuration source used to create and configure an instance of PetaPoco. /// An instance of PetaPoco. diff --git a/PetaPoco/IAlterPoco.cs b/PetaPoco/IAlterPoco.cs index 0c032127..b46305bf 100644 --- a/PetaPoco/IAlterPoco.cs +++ b/PetaPoco/IAlterPoco.cs @@ -16,13 +16,15 @@ public interface IAlterPoco object Insert(object poco); /// - /// If a mapped primary key column is auto-incrementing and is , the primary key property of the POCO will be updated with the new record's auto-incremented ID. + /// If a mapped primary key column is auto-incrementing and is , the + /// primary key property of the POCO will be updated with the new record's auto-incremented ID. /// /// object Insert(string tableName, object poco); /// - /// If represents an auto-incrementing column and is , the primary key property of the POCO will be updated with the new record's auto-incremented ID. + /// If represents an auto-incrementing column and is , the primary key property of the POCO will be updated with the new record's auto-incremented ID. /// /// object Insert(string tableName, string primaryKeyName, object poco); @@ -31,7 +33,8 @@ public interface IAlterPoco /// Inserts a new record into the specified table and returns the primary key of the newly inserted record. /// /// - /// If is , the primary key property of the POCO will be updated with the new record's auto-incremented ID. + /// If is , the primary key property of the POCO will be updated with the new + /// record's auto-incremented ID. /// /// The name of the table where the record will be inserted. /// The table's primary key column name. @@ -87,7 +90,8 @@ public interface IAlterPoco int Update(string tableName, string primaryKeyName, object poco, object primaryKeyValue); /// - /// Updates the specified columns of a record with the given ID in the provided table and returns the number of rows affected by the update operation. + /// Updates the specified columns of a record with the given ID in the provided table and returns the number of rows affected by the + /// update operation. /// /// The name of the table to update. /// The table's primary key column name. @@ -101,7 +105,8 @@ public interface IAlterPoco /// Executes an SQL update and returns the number of rows affected by the update operation. /// /// The POCO type associated with the table to update. - /// An SQL builder instance representing the condition portion of the WHERE clause identifying the row to update (everything after UPDATE tablename) and its parameters. + /// An SQL builder instance representing the condition portion of the WHERE clause identifying the row to update + /// (everything after UPDATE tablename) and its parameters. /// The number of rows affected by the update operation. int Update(Sql sql); @@ -109,7 +114,8 @@ public interface IAlterPoco /// Executes an SQL update and returns the number of rows affected by the update operation. /// /// The POCO type associated with the table to update. - /// The SQL string representing the condition portion of the WHERE clause identifying the row to update (everything after UPDATE tablename). + /// The SQL string representing the condition portion of the WHERE clause identifying the row to update + /// (everything after UPDATE tablename). /// The parameters to embed in the SQL string. /// The number of rows affected by the update operation. int Update(string sql, params object[] args); @@ -139,8 +145,10 @@ public interface IAlterPoco /// /// The name of the table containing the record to delete. /// The table's primary key column name. - /// The POCO instance representing the record to delete, or to use the provided . - /// The primary key value identifying the record to delete, used if is . + /// The POCO instance representing the record to delete, or to use the provided . + /// The primary key value identifying the record to delete, used if is . /// The number of rows affected by the delete operation. int Delete(string tableName, string primaryKeyName, object poco, object primaryKeyValue); @@ -156,7 +164,8 @@ public interface IAlterPoco /// Executes an SQL delete and returns the number of rows affected by the delete operation. /// /// The POCO type associated with the table to delete. - /// An SQL builder instance representing the condition portion of the WHERE clause identifying the row to delete (everything after DELETE FROM tablename) and its parameters. + /// An SQL builder instance representing the condition portion of the WHERE clause identifying the row to delete + /// (everything after DELETE FROM tablename) and its parameters. /// The number of rows affected by the delete operation. int Delete(Sql sql); @@ -164,7 +173,8 @@ public interface IAlterPoco /// Executes an SQL delete and returns the number of rows affected by the delete operation. /// /// The POCO type associated with the table to delete. - /// The SQL string representing the condition portion of the WHERE clause identifying the row to delete (everything after DELETE FROM tablename). + /// The SQL string representing the condition portion of the WHERE clause identifying the row to delete + /// (everything after DELETE FROM tablename). /// The parameters to embed in the SQL string. /// The number of rows affected by the delete operation. int Delete(string sql, params object[] args); @@ -174,7 +184,8 @@ public interface IAlterPoco #region IsNew /// - /// A POCO instance is considered "new" if the property that maps to the associated table's primary key column contains a default value. + /// A POCO instance is considered "new" if the property that maps to the associated table's primary key + /// column contains a default value. /// /// bool IsNew(object poco); @@ -183,7 +194,8 @@ public interface IAlterPoco /// Determines whether the specified POCO represents a new record that has not yet been saved to the database. /// /// - /// A POCO instance is considered "new" if the property that maps to the associated table's provided column name contains a default value. + /// A POCO instance is considered "new" if the property that maps to the associated table's provided column + /// name contains a default value. /// /// The table's primary key column name. /// The POCO instance to check. @@ -195,8 +207,10 @@ public interface IAlterPoco #region Save /// - /// Performs an operation if the POCO is new (as determined by ), and an operation otherwise. - /// If an Insert operation is performed, and a mapped primary key column is auto-incrementing, the primary key property of the POCO will be updated with the new record's auto-incremented ID. + /// Performs an operation if the POCO is new (as determined by ), and an + /// operation otherwise. + /// If an Insert operation is performed, and a mapped primary key column is auto-incrementing, the primary key property of the + /// POCO will be updated with the new record's auto-incremented ID. /// /// void Save(object poco); @@ -205,8 +219,10 @@ public interface IAlterPoco /// Saves the specified POCO to the database by performing either an insert or an update operation, as appropriate. /// /// - /// Performs an operation if the POCO is new (as determined by ), and an operation otherwise. - /// If an Insert operation is performed, and represents an auto-incrementing column, the primary key property of the POCO will be updated with the new record's auto-incremented ID. + /// Performs an operation if the POCO is new (as determined by ), and an operation otherwise. + /// If an Insert operation is performed, and represents an auto-incrementing column, the + /// primary key property of the POCO will be updated with the new record's auto-incremented ID. /// /// The name of the table where the POCO will be saved. /// The table's primary key column name. diff --git a/PetaPoco/IAlterPocoAsync.cs b/PetaPoco/IAlterPocoAsync.cs index ebc3dfa7..79439e2a 100644 --- a/PetaPoco/IAlterPocoAsync.cs +++ b/PetaPoco/IAlterPocoAsync.cs @@ -31,13 +31,15 @@ public interface IAlterPocoAsync Task InsertAsync(CancellationToken cancellationToken, object poco); /// - /// If a mapped primary key column is auto-incrementing and is , the primary key property of the POCO will be updated with the new record's auto-incremented ID. + /// If a mapped primary key column is auto-incrementing and is , the + /// primary key property of the POCO will be updated with the new record's auto-incremented ID. /// /// Task InsertAsync(CancellationToken cancellationToken, string tableName, object poco); /// - /// If represents an auto-incrementing column and is , the primary key property of the POCO will be updated with the new record's auto-incremented ID. + /// If represents an auto-incrementing column and is , the primary key property of the POCO will be updated with the new record's auto-incremented ID. /// /// Task InsertAsync(CancellationToken cancellationToken, string tableName, string primaryKeyName, object poco); @@ -46,14 +48,18 @@ public interface IAlterPocoAsync /// Asynchronously inserts a new record into the specified table and returns the primary key of the newly inserted record. /// /// - /// If is , the primary key property of the POCO will be updated with the new record's auto-incremented ID. + /// If is , the primary key property of the POCO will be updated with the new + /// record's auto-incremented ID. /// /// A cancellation token that can be used to cancel the operation. /// The name of the table where the record will be inserted. /// The table's primary key column name. /// Specifies whether the primary key column in the database is auto-incrementing. /// The POCO instance to insert. - /// A task that represents the asynchronous operation. The task result contains the primary key of the new record if the table has a primary key column; otherwise, . + /// + /// A task that represents the asynchronous operation. The task result contains the primary key of the new record if the table has a + /// primary key column; otherwise, . + /// Task InsertAsync(CancellationToken cancellationToken, string tableName, string primaryKeyName, bool autoIncrement, object poco); #endregion @@ -109,7 +115,8 @@ public interface IAlterPocoAsync Task UpdateAsync(CancellationToken cancellationToken, object poco, object primaryKeyValue); /// - /// Asynchronously updates the specified columns of a record with the given ID and returns the number of rows affected by the update operation. + /// Asynchronously updates the specified columns of a record with the given ID and returns the number of rows affected by the update + /// operation. /// /// Task UpdateAsync(CancellationToken cancellationToken, object poco, object primaryKeyValue, IEnumerable columns); @@ -121,7 +128,8 @@ public interface IAlterPocoAsync Task UpdateAsync(CancellationToken cancellationToken, string tableName, string primaryKeyName, object poco); /// - /// Asynchronously updates the specified columns of a record in the provided table and returns the number of rows affected by the update operation. + /// Asynchronously updates the specified columns of a record in the provided table and returns the number of rows affected by the + /// update operation. /// /// Task UpdateAsync(CancellationToken cancellationToken, string tableName, string primaryKeyName, object poco, IEnumerable columns); @@ -133,7 +141,8 @@ public interface IAlterPocoAsync Task UpdateAsync(CancellationToken cancellationToken, string tableName, string primaryKeyName, object poco, object primaryKeyValue); /// - /// Asynchronously updates the specified columns of a record with the given ID in the provided table and returns the number of rows affected by the update operation. + /// Asynchronously updates the specified columns of a record with the given ID in the provided table and returns the number of rows + /// affected by the update operation. /// /// A cancellation token that can be used to cancel the operation. /// The name of the table to update. @@ -141,7 +150,9 @@ public interface IAlterPocoAsync /// The POCO instance containing the column values to update. /// The primary key value identifying the record to update. /// A list of column names to update, or to update all columns. - /// A task that represents the asynchronous operation. The task result contains the number of rows affected by the update operation. + /// + /// A task that represents the asynchronous operation. The task result contains the number of rows affected by the update operation. + /// Task UpdateAsync(CancellationToken cancellationToken, string tableName, string primaryKeyName, object poco, object primaryKeyValue, IEnumerable columns); /// @@ -149,8 +160,11 @@ public interface IAlterPocoAsync /// /// The POCO type associated with the table to update. /// A cancellation token that can be used to cancel the operation. - /// An SQL builder instance representing the condition portion of the WHERE clause identifying the row to update (everything after UPDATE tablename) and its parameters. - /// A task that represents the asynchronous operation. The task result contains the number of rows affected by the update operation. + /// An SQL builder instance representing the condition portion of the WHERE clause identifying the row to update + /// (everything after UPDATE tablename) and its parameters. + /// + /// A task that represents the asynchronous operation. The task result contains the number of rows affected by the update operation. + /// Task UpdateAsync(CancellationToken cancellationToken, Sql sql); /// @@ -158,9 +172,12 @@ public interface IAlterPocoAsync /// /// The POCO type associated with the table to update. /// A cancellation token that can be used to cancel the operation. - /// The SQL string representing the condition portion of the WHERE clause identifying the row to update (everything after UPDATE tablename). + /// The SQL string representing the condition portion of the WHERE clause identifying the row to update + /// (everything after UPDATE tablename). /// The parameters to embed in the SQL string. - /// A task that represents the asynchronous operation. The task result contains the number of rows affected by the update operation. + /// + /// A task that represents the asynchronous operation. The task result contains the number of rows affected by the update operation. + /// Task UpdateAsync(CancellationToken cancellationToken, string sql, params object[] args); #endregion @@ -190,7 +207,9 @@ public interface IAlterPocoAsync /// /// A cancellation token that can be used to cancel the operation. /// The POCO instance representing the record to delete. - /// A task that represents the asynchronous operation. The task result contains the number of rows affected by the delete operation. + /// + /// A task that represents the asynchronous operation. The task result contains the number of rows affected by the delete operation. + /// Task DeleteAsync(CancellationToken cancellationToken, object poco); /// @@ -200,18 +219,25 @@ public interface IAlterPocoAsync /// The name of the table containing the record to delete. /// The table's primary key column name. /// The POCO instance representing the record to delete. - /// A task that represents the asynchronous operation. The task result contains the number of rows affected by the delete operation. + /// + /// A task that represents the asynchronous operation. The task result contains the number of rows affected by the delete operation. + /// Task DeleteAsync(CancellationToken cancellationToken, string tableName, string primaryKeyName, object poco); /// - /// Asynchronously deletes a record with the given ID from the provided table and returns the number of rows affected by the delete operation. + /// Asynchronously deletes a record with the given ID from the provided table and returns the number of rows affected by the delete + /// operation. /// /// A cancellation token that can be used to cancel the operation. /// The name of the table containing the record to delete. /// The table's primary key column name. - /// The POCO instance representing the record to delete, or to use the provided . - /// The primary key value identifying the record to delete, used if is . - /// A task that represents the asynchronous operation. The task result contains the number of rows affected by the delete operation. + /// The POCO instance representing the record to delete, or to use the provided . + /// The primary key value identifying the record to delete, used if is . + /// + /// A task that represents the asynchronous operation. The task result contains the number of rows affected by the delete operation. + /// Task DeleteAsync(CancellationToken cancellationToken, string tableName, string primaryKeyName, object poco, object primaryKeyValue); /// @@ -220,7 +246,9 @@ public interface IAlterPocoAsync /// The POCO type associated with the table to delete. /// A cancellation token that can be used to cancel the operation. /// The primary key value, or a POCO containing an assigned primary key value. - /// A task that represents the asynchronous operation. The task result contains the number of rows affected by the delete operation. + /// + /// A task that represents the asynchronous operation. The task result contains the number of rows affected by the delete operation. + /// Task DeleteAsync(CancellationToken cancellationToken, object pocoOrPrimaryKeyValue); /// @@ -228,8 +256,11 @@ public interface IAlterPocoAsync /// /// The POCO type associated with the table to delete. /// A cancellation token that can be used to cancel the operation. - /// An SQL builder instance representing the condition portion of the WHERE clause identifying the row to delete (everything after DELETE FROM tablename) and its parameters. - /// A task that represents the asynchronous operation. The task result contains the number of rows affected by the delete operation. + /// An SQL builder instance representing the condition portion of the WHERE clause identifying the row to delete + /// (everything after DELETE FROM tablename) and its parameters. + /// + /// A task that represents the asynchronous operation. The task result contains the number of rows affected by the delete operation. + /// Task DeleteAsync(CancellationToken cancellationToken, Sql sql); /// @@ -237,9 +268,12 @@ public interface IAlterPocoAsync /// /// The POCO type associated with the table to delete. /// A cancellation token that can be used to cancel the operation. - /// The SQL string representing the condition portion of the WHERE clause identifying the row to delete (everything after DELETE FROM tablename). + /// The SQL string representing the condition portion of the WHERE clause identifying the row to delete + /// (everything after DELETE FROM tablename). /// The parameters to embed in the SQL string. - /// A task that represents the asynchronous operation. The task result contains the number of rows affected by the delete operation. + /// + /// A task that represents the asynchronous operation. The task result contains the number of rows affected by the delete operation. + /// Task DeleteAsync(CancellationToken cancellationToken, string sql, params object[] args); #endregion @@ -253,8 +287,10 @@ public interface IAlterPocoAsync Task SaveAsync(string tableName, string primaryKeyName, object poco); /// - /// Performs an operation if the POCO is new (as determined by ), and an operation otherwise. - /// If an Insert operation is performed, and a mapped primary key column is auto-incrementing, the primary key property of the POCO will be updated with the new record's auto-incremented ID. + /// Performs an operation if the POCO is new (as determined by ), and an operation otherwise. + /// If an Insert operation is performed, and a mapped primary key column is auto-incrementing, the primary key property of the + /// POCO will be updated with the new record's auto-incremented ID. /// /// Task SaveAsync(CancellationToken cancellationToken, object poco); @@ -263,14 +299,18 @@ public interface IAlterPocoAsync /// Asynchronously saves the specified POCO to the database by performing either an insert or an update operation, as appropriate. /// /// - /// Performs an operation if the POCO is new (as determined by ), and an operation otherwise. - /// If an Insert operation is performed, and represents an auto-incrementing column, the primary key property of the POCO will be updated with the new record's auto-incremented ID. + /// Performs an operation if the POCO is new (as determined by ), and an operation otherwise. + /// If an Insert operation is performed, and represents an auto-incrementing column, the + /// primary key property of the POCO will be updated with the new record's auto-incremented ID. /// /// A cancellation token that can be used to cancel the operation. /// The name of the table where the record will be saved. /// The table's primary key column name. /// The POCO instance to save. - /// A task that represents the asynchronous operation. + /// + /// A task that represents the asynchronous operation. + /// Task SaveAsync(CancellationToken cancellationToken, string tableName, string primaryKeyName, object poco); #endregion diff --git a/PetaPoco/IAsyncReader.cs b/PetaPoco/IAsyncReader.cs index 2d208110..ad723779 100644 --- a/PetaPoco/IAsyncReader.cs +++ b/PetaPoco/IAsyncReader.cs @@ -17,7 +17,10 @@ public interface IAsyncReader : IDisposable /// /// Asynchronously reads the next row from the data source. /// - /// A task that represents the asynchronous operation. The task result contains if more records exist, otherwise . + /// + /// A task that represents the asynchronous operation. The task result contains if more records exist, + /// otherwise . + /// Task ReadAsync(); // TODO: Missing overload: `Task ReadAsync(CancellationToken)` diff --git a/PetaPoco/IBuildConfigurationSettings.cs b/PetaPoco/IBuildConfigurationSettings.cs index 9f2f53b8..240cd791 100644 --- a/PetaPoco/IBuildConfigurationSettings.cs +++ b/PetaPoco/IBuildConfigurationSettings.cs @@ -15,7 +15,8 @@ public interface IBuildConfigurationSettings void SetSetting(string key, object value); /// - /// Attempts to locate a setting of type using the specified , and invokes with the setting's value if found. + /// Attempts to locate a setting of type using the specified , and invokes with the setting's value if found. /// /// The type of the setting's value object. /// The setting's key. diff --git a/PetaPoco/IConnection.cs b/PetaPoco/IConnection.cs index 1b5bd099..b96754ec 100644 --- a/PetaPoco/IConnection.cs +++ b/PetaPoco/IConnection.cs @@ -4,7 +4,8 @@ namespace PetaPoco { /// - /// Defines methods and properties for managing database connections. This includes opening and closing shared connections, and accessing the currently open connection. + /// Defines methods and properties for managing database connections. This includes opening and closing shared connections, and + /// accessing the currently open connection. /// public interface IConnection { @@ -12,7 +13,8 @@ public interface IConnection /// Gets or sets the connection reuse policy for the shared connection or instance. /// /// - /// When set to the first opened connection is kept alive until is called or the is disposed. + /// When set to the first opened connection is kept alive until is called + /// or the is disposed. /// bool KeepConnectionAlive { get; set; } @@ -25,7 +27,7 @@ public interface IConnection /// Opens a connection that will be used for all subsequent queries. /// /// - /// Calls to and are reference counted and should be balanced. + /// Calls to and are reference counted and must be balanced. /// void OpenSharedConnection(); @@ -34,9 +36,12 @@ public interface IConnection /// Asynchronously opens a connection that will be used for all subsequent queries. /// /// - /// Calls to and are reference counted and should be balanced. + /// Calls to and are reference counted and must be + /// balanced. /// - /// A task that represents the asynchronous operation. + /// + /// A task that represents the asynchronous operation. + /// Task OpenSharedConnectionAsync(); // TODO: Missing overload: `Task OpenSharedConnectionAsync(CancellationToken)` @@ -46,7 +51,7 @@ public interface IConnection /// Releases the shared connection. /// /// - /// Calls to and are reference counted and should be balanced. + /// Calls to and are reference counted and must be balanced. /// void CloseSharedConnection(); } diff --git a/PetaPoco/IDatabase.cs b/PetaPoco/IDatabase.cs index 9b03ee26..2fe65448 100644 --- a/PetaPoco/IDatabase.cs +++ b/PetaPoco/IDatabase.cs @@ -35,7 +35,8 @@ public interface IDatabase : IDisposable, IQuery, IAlterPoco, IExecute, ITransac string LastCommand { get; } /// - /// Gets or sets a value indicating whether automatic generation of the SELECT and WHERE parts of an SQL statement is enabled when not explicitly provided by the caller. + /// Gets or sets a value indicating whether automatic generation of the SELECT and WHERE parts of an SQL statement is + /// enabled when not explicitly provided by the caller. /// bool EnableAutoSelect { get; set; } @@ -50,7 +51,7 @@ public interface IDatabase : IDisposable, IQuery, IAlterPoco, IExecute, ITransac int CommandTimeout { get; set; } /// - /// Gets or sets a single-use timeout value that will temporarily override for the next command execution. + /// Gets or sets a one-time timeout value to temporarily override for the next command execution. /// int OneTimeCommandTimeout { get; set; } @@ -85,14 +86,18 @@ public interface IDatabase : IDisposable, IQuery, IAlterPoco, IExecute, ITransac /// /// Asynchronously begins a transaction scope. /// - /// A task that represents the asynchronous operation. + /// + /// A task that represents the asynchronous operation. + /// Task BeginTransactionAsync(); /// /// Asynchronously begins a transaction scope. /// /// A cancellation token that can be used to cancel the operation. - /// A task that represents the asynchronous operation. + /// + /// A task that represents the asynchronous operation. + /// Task BeginTransactionAsync(CancellationToken cancellationToken); #endif diff --git a/PetaPoco/IExecuteAsync.cs b/PetaPoco/IExecuteAsync.cs index af44d8fc..380f71f2 100644 --- a/PetaPoco/IExecuteAsync.cs +++ b/PetaPoco/IExecuteAsync.cs @@ -26,7 +26,9 @@ public interface IExecuteAsync /// /// A cancellation token that can be used to cancel the operation. /// An SQL builder instance representing the SQL statement and its parameters. - /// A task that represents the asynchronous operation. The task result contains the number of rows affected by the operation. + /// + /// A task that represents the asynchronous operation. The task result is the number of rows affected by the operation. + /// Task ExecuteAsync(CancellationToken cancellationToken, Sql sql); /// @@ -35,7 +37,9 @@ public interface IExecuteAsync /// A cancellation token that can be used to cancel the operation. /// The SQL string. /// The parameters to embed in the SQL string. - /// A task that represents the asynchronous operation. The task result contains the number of rows affected by the operation. + /// + /// A task that represents the asynchronous operation. The task result is the number of rows affected by the operation. + /// Task ExecuteAsync(CancellationToken cancellationToken, string sql, params object[] args); /// @@ -44,7 +48,9 @@ public interface IExecuteAsync /// The type of the result value. /// A cancellation token that can be used to cancel the operation. /// An SQL builder instance representing the SQL statement and its parameters. - /// A task that represents the asynchronous operation. The task result contains the scalar result value of type . + /// + /// A task that represents the asynchronous operation. The task result is the scalar result value of type . + /// Task ExecuteScalarAsync(CancellationToken cancellationToken, Sql sql); /// @@ -54,7 +60,9 @@ public interface IExecuteAsync /// A cancellation token that can be used to cancel the operation. /// The SQL query string. /// The parameters to embed in the SQL query string. - /// A task that represents the asynchronous operation. The task result contains the scalar result value of type . + /// + /// A task that represents the asynchronous operation. The task result is the scalar result value of type . + /// Task ExecuteScalarAsync(CancellationToken cancellationToken, string sql, params object[] args); } #endif diff --git a/PetaPoco/IHideObjectMethods.cs b/PetaPoco/IHideObjectMethods.cs index 98908918..37092bbe 100644 --- a/PetaPoco/IHideObjectMethods.cs +++ b/PetaPoco/IHideObjectMethods.cs @@ -4,12 +4,12 @@ namespace PetaPoco { /// - /// An interface used to hide the compiler-generated public instance methods from the list of intellisense code completion suggestions. + /// Hides the compiler-generated public instance methods from the list of intellisense code completion suggestions. /// /// - ///
Reference Project: MicroLite ORM () + /// Reference Project: MicroLite ORM () ///
Author: Trevor Pilley - ///
Source: + ///
Source: ///
[EditorBrowsable(EditorBrowsableState.Never)] public interface IHideObjectMethods diff --git a/PetaPoco/IQuery.cs b/PetaPoco/IQuery.cs index c2dfc685..a64c50c7 100644 --- a/PetaPoco/IQuery.cs +++ b/PetaPoco/IQuery.cs @@ -29,7 +29,9 @@ public interface IQuery /// Executes a query and returns the results as a sequence of type . ///
/// - /// Because this method streams the results from the database, care should be taken to not start a new query before finishing with and disposing of the previous one to prevent encountering database locks. In cases where contention could be an issue, consider using the equivalent Fetch method. + /// Because this method streams the results from the database, care should be taken to not start a new query before finishing with + /// and disposing of the previous one to prevent encountering database locks. In cases where contention could be an issue, consider + /// using the equivalent Fetch method. /// /// The POCO type representing a single result record. /// The SQL query string. @@ -51,10 +53,12 @@ public interface IQuery IEnumerable Query(Sql sql); /// - /// Executes a multi-poco query and projects the result sequence into a new form of type using a default mapping function. + /// Executes a multi-poco query and projects the result sequence into a new form of type using a default + /// mapping function. /// /// - /// PetaPoco will automatically attempt to determine the split points and auto-map each additional POCO type into . + /// PetaPoco will automatically attempt to determine the split points and auto-map each additional POCO type into . /// /// The first POCO type. /// The second POCO type. @@ -75,10 +79,12 @@ public interface IQuery IEnumerable Query(string sql, params object[] args); /// - /// Executes a multi-poco query and projects the result sequence into a new form of type using a default mapping function. + /// Executes a multi-poco query and projects the result sequence into a new form of type using a default + /// mapping function. /// /// - /// PetaPoco will automatically attempt to determine the split points and auto-map each additional POCO type into . + /// PetaPoco will automatically attempt to determine the split points and auto-map each additional POCO type into . /// /// The first POCO type. /// The second POCO type. @@ -104,10 +110,12 @@ public interface IQuery IEnumerable Query(Func projector, Sql sql); /// - /// Executes a multi-poco query and projects the result sequence into a new form of type using the provided mapping function. + /// Executes a multi-poco query and projects the result sequence into a new form of type using the + /// provided mapping function. /// /// - /// If is , PetaPoco will automatically attempt to determine the split points and auto-map each POCO type into . + /// If is , PetaPoco will automatically attempt to determine the split points and + /// auto-map each POCO type into . /// /// The first POCO type. /// The second POCO type. @@ -115,7 +123,8 @@ public interface IQuery /// The fourth POCO type. /// The fifth POCO type. /// The projected POCO type representing a single result record. - /// A function that transforms each of the given types into a , or to use a default mapping function. + /// A function that transforms each of the given types into a , or to use a default mapping function. /// An SQL builder instance representing the SQL query and its parameters. /// An enumerable sequence of POCOs of type . IEnumerable Query(Func projector, Sql sql); @@ -130,10 +139,12 @@ public interface IQuery IEnumerable Query(Func projector, string sql, params object[] args); /// - /// Executes a multi-poco query and projects the result sequence into a new form of type using the provided mapping function. + /// Executes a multi-poco query and projects the result sequence into a new form of type using the + /// provided mapping function. /// /// - /// If is , PetaPoco will automatically attempt to determine the split points and auto-map each POCO type into . + /// If is , PetaPoco will automatically attempt to determine the split points and + /// auto-map each POCO type into . /// /// The first POCO type. /// The second POCO type. @@ -141,21 +152,26 @@ public interface IQuery /// The fourth POCO type. /// The fifth POCO type. /// The projected POCO type representing a single result record. - /// A function that transforms each of the given types into a , or to use a default mapping function. + /// A function that transforms each of the given types into a , or to use a default mapping function. /// The SQL query string. /// The parameters to embed in the SQL string. /// An enumerable sequence of POCOs of type . IEnumerable Query(Func projector, string sql, params object[] args); /// - /// Executes a multi-poco query and projects the result sequence into a new form of type using the provided mapping function. + /// Executes a multi-poco query and projects the result sequence into a new form of type using the + /// provided mapping function. /// /// - /// If is , PetaPoco will automatically attempt to determine the split points and auto-map each POCO type into . + /// If is , PetaPoco will automatically attempt to determine the split points and + /// auto-map each POCO type into . /// /// The projected POCO type representing a single result record. - /// An array of POCO types representing the types referenced in composite type . - /// A function that transforms each of the given types into a , or to use a default mapping function. + /// An array of POCO types representing the types referenced in composite type . + /// A function that transforms each of the given types into a , or to use a default mapping function. /// The SQL query string. /// The parameters to embed in the SQL string. /// An enumerable sequence of POCOs of type . @@ -218,10 +234,12 @@ public interface IQuery List Fetch(Sql sql); /// - /// Executes a multi-poco query and projects the result sequence into a new form of type using a default mapping function. + /// Executes a multi-poco query and projects the result sequence into a new form of type using a default + /// mapping function. /// /// - /// PetaPoco will automatically attempt to determine the split points and auto-map each additional POCO type into . + /// PetaPoco will automatically attempt to determine the split points and auto-map each additional POCO type into . /// /// The first POCO type. /// The second POCO type. @@ -242,10 +260,12 @@ public interface IQuery List Fetch(string sql, params object[] args); /// - /// Executes a multi-poco query and projects the result sequence into a new form of type using a default mapping function. + /// Executes a multi-poco query and projects the result sequence into a new form of type using a default + /// mapping function. /// /// - /// PetaPoco will automatically attempt to determine the split points and auto-map each additional POCO type into . + /// PetaPoco will automatically attempt to determine the split points and auto-map each additional POCO type into . /// /// The first POCO type. /// The second POCO type. @@ -271,10 +291,12 @@ public interface IQuery List Fetch(Func projector, Sql sql); /// - /// Executes a multi-poco query and projects the result sequence into a new form of type using the provided mapping function. + /// Executes a multi-poco query and projects the result sequence into a new form of type using the + /// provided mapping function. /// /// - /// If is , PetaPoco will automatically attempt to determine the split points and auto-map each POCO type into . + /// If is , PetaPoco will automatically attempt to determine the split points and + /// auto-map each POCO type into . /// /// The first POCO type. /// The second POCO type. @@ -282,7 +304,8 @@ public interface IQuery /// The fourth POCO type. /// The fifth POCO type. /// The projected POCO type representing a single result record. - /// A function that transforms each of the given types into a , or to use a default mapping function. + /// A function that transforms each of the given types into a , or to use a default mapping function. /// An SQL builder instance representing the SQL query and its parameters. /// A list of POCOs of type . List Fetch(Func projector, Sql sql); @@ -297,10 +320,12 @@ public interface IQuery List Fetch(Func projector, string sql, params object[] args); /// - /// Executes a multi-poco query and projects the result sequence into a new form of type using the provided mapping function. + /// Executes a multi-poco query and projects the result sequence into a new form of type using the + /// provided mapping function. /// /// - /// If is , PetaPoco will automatically attempt to determine the split points and auto-map each POCO type into . + /// If is , PetaPoco will automatically attempt to determine the split points and + /// auto-map each POCO type into . /// /// The first POCO type. /// The second POCO type. @@ -308,7 +333,8 @@ public interface IQuery /// The fourth POCO type. /// The fifth POCO type. /// The projected POCO type representing a single result record. - /// A function that transforms each of the given types into a , or to use a default mapping function. + /// A function that transforms each of the given types into a , or to use a default mapping function. /// The SQL query string. /// The parameters to embed in the SQL string. /// A list of POCOs of type . @@ -319,19 +345,22 @@ public interface IQuery #region Fetch : Paged SkipTake /// - /// Executes an auto-select query (SELECT *) for a subset of records based on the specified parameters, and returns the results as a list of type . + /// Executes an auto-select query (SELECT *) for a subset of records based on the specified parameters, and returns the + /// results as a list of type . /// /// /// must be enabled in order to generate the auto-select portion of the SQL statement. - /// This method performs essentially the same operation as . - /// Determining the number of records to skip, and how many to take, however, are calculated automatically based on the specified index and values. + /// This method performs essentially the same operation as . Determining the number of + /// records to skip, and how many to take, however, are calculated automatically based on the specified + /// index and values. /// /// List Fetch(long page, long maxItemsPerPage); /// - /// This method performs essentially the same operation as . - /// Determining the number of records to skip, and how many to take, however, are calculated automatically based on the specified index and values. + /// This method performs essentially the same operation as . Determining the number of + /// records to skip, and how many to take, however, are calculated automatically based on the specified + /// index and values. /// /// The one-based page number used to calculate the number of records to skip. /// The maximum number of records per page. @@ -340,11 +369,13 @@ public interface IQuery List Fetch(long page, long maxItemsPerPage, Sql sql); /// - /// Executes a query for a subset of records based on the specified parameters, and returns the results as a list of type . + /// Executes a query for a subset of records based on the specified parameters, and returns the results as a list of type + /// . /// /// - /// This method performs essentially the same operation as . - /// Determining the number of records to skip, and how many to take, however, are calculated automatically based on the specified index and values. + /// This method performs essentially the same operation as . Determining the + /// number of records to skip, and how many to take, however, are calculated automatically based on the specified index and values. /// /// The POCO type representing a single result record. /// The one-based page number used to calculate the number of records to skip. @@ -359,12 +390,13 @@ public interface IQuery #region Page /// - /// Executes an auto-select query (SELECT *) for a subset of records based on the specified parameters, and returns the results as a Page of type . + /// Executes an auto-select query (SELECT *) for a subset of records based on the specified parameters, and returns the + /// results as a Page of type . /// /// /// must be enabled in order to generate the auto-select portion of the SQL statement. - /// PetaPoco will automatically modify a default SELECT * statement to only retrieve the records for the specified page. - /// It will also execute a second query to retrieve the total number of records in the result set. + /// PetaPoco will automatically modify a default SELECT * statement to only retrieve the records for the specified + /// page. It will also execute a second query to retrieve the total number of records in the result set. /// /// The POCO type representing a single result record. /// The one-based page number used to calculate the number of records to skip. @@ -379,11 +411,12 @@ public interface IQuery Page Page(long page, long maxItemsPerPage, Sql sql); /// - /// Executes a query for a subset of records based on the specified parameters, and returns the results as a Page of type . + /// Executes a query for a subset of records based on the specified parameters, and returns the results as a Page of type + /// . /// /// - /// PetaPoco will automatically modify the supplied SELECT statement to only retrieve the records for the specified page. - /// It will also execute a second query to retrieve the total number of records in the result set. + /// PetaPoco will automatically modify the supplied SELECT statement to only retrieve the records for the specified page. It + /// will also execute a second query to retrieve the total number of records in the result set. /// /// The POCO type representing a single result record. /// The one-based page number used to calculate the number of records to skip. @@ -395,17 +428,20 @@ public interface IQuery /// The one-based page number for this page. /// The maximum number of records per page. - /// An SQL builder instance representing the SQL statement and its parameters, used to query the total number of records. - /// An SQL builder instance representing the SQL statement and its parameters, used to retrieve a single page of results. + /// An SQL builder instance representing the SQL statement and its parameters, used to query the total number + /// of records. + /// An SQL builder instance representing the SQL statement and its parameters, used to retrieve a single page + /// of results. /// Page Page(long page, long maxItemsPerPage, Sql countSql, Sql pageSql); /// - /// Executes a query for a subset of records based on the specified parameters, and returns the results as a Page of type . + /// Executes a query for a subset of records based on the specified parameters, and returns the results as a Page of type + /// . /// /// - /// This method accepts two separate SQL statements that will be used explicitly for both parts of the page query. - /// The and parameters are used to populate the returned Page object. + /// This method accepts two separate SQL statements that will be used explicitly for both parts of the page query. The and parameters are used to populate the returned Page object. /// /// The POCO type representing a single result record. /// The one-based page number for this page. @@ -444,7 +480,8 @@ public interface IQuery /// Executes a query and returns a subset of the results as a list of type . ///
/// - /// The provided SQL query will be modified to limit the starting offset and number of returned records based on the specified parameters. + /// The provided SQL query will be modified to limit the starting offset and number of returned records based on the specified + /// parameters. /// /// The POCO type representing a single result record. /// The number of records to skip. @@ -462,11 +499,13 @@ public interface IQuery /// Determines whether a record exists with the specified primary key value. ///
/// - /// If provided a POCO instance as the parameter, PetaPoco will extract the value from the POCO's mapped primary key property, and perform the same query as if the primary key value was provided directly. + /// If provided a POCO instance as the parameter, PetaPoco will extract the value from the + /// POCO's mapped primary key property, and perform the same query as if the primary key value was provided directly. /// /// The POCO type representing a single result record. /// The primary key value, or a POCO containing an assigned primary key value. - /// if one or more records exist with the specified primary key value; otherwise, . + /// if one or more records exist with the specified primary key value; otherwise, . bool Exists(object pocoOrPrimaryKeyValue); // TODO: Missing overload: `bool IQuery.Exists(Sql)` @@ -477,7 +516,8 @@ public interface IQuery /// The POCO type representing a single result record. /// The SQL string representing the condition portion of the WHERE clause. /// The parameters to embed in the SQL string. - /// if one or more records exist that satisfy the conditions defined in the specified query; otherwise, . + /// if one or more records exist that satisfy the conditions defined in the specified query; + /// otherwise, . bool Exists(string sql, params object[] args); #endregion @@ -485,12 +525,14 @@ public interface IQuery #region Single /// - /// Returns the only record that matches the specified primary key value, and throws an exception if there is not exactly one matching record. + /// Returns the only record that matches the specified primary key value, and throws an exception if there is not exactly one + /// matching record. /// /// The POCO type representing a single result record. /// The primary key value. /// The single result returned by the query. - /// The result set is empty, or the result set contains more than one record. + /// The result set is empty, or the result set contains more than one + /// record. T Single(object primaryKey); /// An SQL builder instance representing the SQL query and its parameters. @@ -504,7 +546,8 @@ public interface IQuery /// The SQL query string. /// The parameters to embed in the SQL string. /// The single result returned by the query. - /// The result set is empty, or the result set contains more than one record. + /// The result set is empty, or the result set contains more than one + /// record. T Single(string sql, params object[] args); #endregion @@ -512,7 +555,8 @@ public interface IQuery #region SingleOrDefault /// - /// Returns the only record that matches the specified primary key value, or a default value if the result set is empty; this method throws an exception if there is more than one matching record. + /// Returns the only record that matches the specified primary key value, or a default value if the result set is empty; this method + /// throws an exception if there is more than one matching record. /// /// The POCO type representing a single result record. /// The primary key value. @@ -525,7 +569,8 @@ public interface IQuery T SingleOrDefault(Sql sql); /// - /// Returns the only record that matches the specified query, or a default value if the result set is empty; this method throws an exception if there is more than one matching record. + /// Returns the only record that matches the specified query, or a default value if the result set is empty; this method throws an + /// exception if there is more than one matching record. /// /// The POCO type representing a single result record. /// The SQL query string. diff --git a/PetaPoco/IQueryAsync.cs b/PetaPoco/IQueryAsync.cs index 7b774306..cef87434 100644 --- a/PetaPoco/IQueryAsync.cs +++ b/PetaPoco/IQueryAsync.cs @@ -8,7 +8,8 @@ namespace PetaPoco { #if ASYNC /// - /// Specifies a set of methods for asynchronously executing SQL queries and returning the result set as lists, enumerables, single POCOs, multi-POCOs, or paged results. + /// Specifies a set of methods for asynchronously executing SQL queries and returning the result set as lists, enumerables, single + /// POCOs, multi-POCOs, or paged results. /// public interface IQueryAsync { @@ -31,7 +32,10 @@ public interface IQueryAsync /// /// The POCO type representing a single result record. /// A cancellation token that can be used to cancel the operation. - /// A task that represents the asynchronous operation. The task result contains an for reading the result set. + /// + /// A task that represents the asynchronous operation. The task result contains an for reading the + /// result set. + /// Task> QueryAsync(CancellationToken cancellationToken); /// @@ -40,7 +44,10 @@ public interface IQueryAsync /// The POCO type representing a single result record. /// A cancellation token that can be used to cancel the operation. /// An SQL builder instance representing the SQL query and its parameters. - /// A task that represents the asynchronous operation. The task result contains an for reading the result set. + /// + /// A task that represents the asynchronous operation. The task result contains an for reading the + /// result set. + /// Task> QueryAsync(CancellationToken cancellationToken, Sql sql); /// @@ -50,8 +57,14 @@ public interface IQueryAsync /// A cancellation token that can be used to cancel the operation. /// The SQL query string. /// The parameters to embed in the SQL string. - /// A task that represents the asynchronous operation. The task result contains an for reading the result set. - /// A task that represents the asynchronous operation. The task result contains an for reading the result set. + /// + /// A task that represents the asynchronous operation. The task result contains an for reading the + /// result set. + /// + /// + /// A task that represents the asynchronous operation. The task result contains an for reading the + /// result set. + /// Task> QueryAsync(CancellationToken cancellationToken, string sql, params object[] args); #endregion @@ -76,7 +89,10 @@ public interface IQueryAsync /// The POCO type representing a single result record. /// A cancellation token that can be used to cancel the operation. /// The type of command to execute. - /// A task that represents the asynchronous operation. The task result contains an for reading the result set. + /// + /// A task that represents the asynchronous operation. The task result contains an for reading the + /// result set. + /// Task> QueryAsync(CancellationToken cancellationToken, CommandType commandType); /// @@ -86,7 +102,10 @@ public interface IQueryAsync /// A cancellation token that can be used to cancel the operation. /// The type of command to execute. /// An SQL builder instance representing the SQL query and its parameters. - /// A task that represents the asynchronous operation. The task result contains an for reading the result set. + /// + /// A task that represents the asynchronous operation. The task result contains an for reading the + /// result set. + /// Task> QueryAsync(CancellationToken cancellationToken, CommandType commandType, Sql sql); /// @@ -97,8 +116,10 @@ public interface IQueryAsync /// The type of command to execute. /// The SQL query string. /// The parameters to embed in the SQL string. - /// A task that represents the asynchronous operation. The task result contains an for reading the result set. - /// A task that represents the asynchronous operation. The task result contains an for reading the result set. + /// + /// A task that represents the asynchronous operation. The task result contains an for reading the + /// result set. + /// Task> QueryAsync(CancellationToken cancellationToken, CommandType commandType, string sql, params object[] args); #endregion @@ -115,7 +136,8 @@ public interface IQueryAsync Task QueryAsync(Action action, string sql, params object[] args); /// - /// Asynchronously executes an auto-select query (SELECT *) and invokes the specified action on each result read from the underlying data reader. + /// Asynchronously executes an auto-select query (SELECT *) and invokes the specified action on each result read from the + /// underlying data reader. /// /// /// must be enabled in order to generate the auto-select portion of the SQL statement. @@ -123,7 +145,9 @@ public interface IQueryAsync /// The POCO type representing a single result record. /// A cancellation token that can be used to cancel the operation. /// An action to perform on each POCO in the result set. - /// A task that represents the asynchronous operation. + /// + /// A task that represents the asynchronous operation. + /// Task QueryAsync(Action action, CancellationToken cancellationToken); /// A cancellation token that can be used to cancel the operation. @@ -140,7 +164,9 @@ public interface IQueryAsync /// A cancellation token that can be used to cancel the operation. /// The SQL query string. /// The parameters to embed in the SQL string. - /// A task that represents the asynchronous operation. + /// + /// A task that represents the asynchronous operation. + /// Task QueryAsync(Action action, CancellationToken cancellationToken, string sql, params object[] args); #endregion @@ -157,7 +183,8 @@ public interface IQueryAsync Task QueryAsync(Action action, CommandType commandType, string sql, params object[] args); /// - /// Asynchronously executes an auto-select query (SELECT *) for the specified command type and invokes the specified action on each result read from the underlying data reader. + /// Asynchronously executes an auto-select query (SELECT *) for the specified command type and invokes the specified action + /// on each result read from the underlying data reader. /// /// /// must be enabled in order to generate the auto-select portion of the SQL statement. @@ -166,7 +193,9 @@ public interface IQueryAsync /// A cancellation token that can be used to cancel the operation. /// An action to perform on each POCO in the result set. /// The type of command to execute. - /// A task that represents the asynchronous operation. + /// + /// A task that represents the asynchronous operation. + /// Task QueryAsync(Action action, CancellationToken cancellationToken, CommandType commandType); /// A cancellation token that can be used to cancel the operation. @@ -177,7 +206,8 @@ public interface IQueryAsync Task QueryAsync(Action action, CancellationToken cancellationToken, CommandType commandType, Sql sql); /// - /// Asynchronously executes a query for the specified command type and invokes the specified action on each result read from the underlying data reader. + /// Asynchronously executes a query for the specified command type and invokes the specified action on each result read from the + /// underlying data reader. /// /// The POCO type representing a single result record. /// An action to perform on each POCO in the result set. @@ -185,7 +215,9 @@ public interface IQueryAsync /// The type of command to execute. /// The SQL query string. /// The parameters to embed in the SQL string. - /// A task that represents the asynchronous operation. + /// + /// A task that represents the asynchronous operation. + /// Task QueryAsync(Action action, CancellationToken cancellationToken, CommandType commandType, string sql, params object[] args); #endregion @@ -214,14 +246,17 @@ public interface IQueryAsync Task> FetchAsync(string sql, params object[] args); /// - /// Asynchronously executes an auto-select query (SELECT *) and returns the results as a list of type . + /// Asynchronously executes an auto-select query (SELECT *) and returns the results as a list of type . /// /// /// must be enabled in order to generate the auto-select portion of the SQL statement. /// /// The POCO type representing a single result record. /// A cancellation token that can be used to cancel the operation. - /// A list of POCOs of type . + /// + /// A task that represents the asynchronous operation. The task result contains a list of POCOs of type . + /// Task> FetchAsync(CancellationToken cancellationToken); /// A cancellation token that can be used to cancel the operation. @@ -230,13 +265,15 @@ public interface IQueryAsync Task> FetchAsync(CancellationToken cancellationToken, Sql sql); /// - /// Executes a query and returns the results as a list of type . + /// Asynchronously executes a query and returns the results as a list of type . /// /// The POCO type representing a single result record. /// A cancellation token that can be used to cancel the operation. /// The SQL query string. /// The parameters to embed in the SQL string. - /// A list of POCOs of type . + /// + /// A task that represents the asynchronous operation. The task result contains a list of POCOs of type . + /// Task> FetchAsync(CancellationToken cancellationToken, string sql, params object[] args); #endregion @@ -253,7 +290,8 @@ public interface IQueryAsync Task> FetchAsync(CommandType commandType, string sql, params object[] args); /// - /// Asynchronously executes an auto-select query (SELECT *) for the specified command type and returns the results as a list of type . + /// Asynchronously executes an auto-select query (SELECT *) for the specified command type and returns the results as a list + /// of type . /// /// /// must be enabled in order to generate the auto-select portion of the SQL statement. @@ -261,7 +299,9 @@ public interface IQueryAsync /// The POCO type representing a single result record. /// A cancellation token that can be used to cancel the operation. /// The type of command to execute. - /// A list of POCOs of type . + /// + /// A task that represents the asynchronous operation. The task result contains a list of POCOs of type . + /// Task> FetchAsync(CancellationToken cancellationToken, CommandType commandType); /// A cancellation token that can be used to cancel the operation. @@ -271,14 +311,17 @@ public interface IQueryAsync Task> FetchAsync(CancellationToken cancellationToken, CommandType commandType, Sql sql); /// - /// Executes a query for the specified command type and returns the results as a list of type . + /// Asynchronously executes a query for the specified command type and returns the results as a list of type . /// /// The POCO type representing a single result record. /// A cancellation token that can be used to cancel the operation. /// The type of command to execute. /// The SQL query string. /// The parameters to embed in the SQL string. - /// A list of POCOs of type . + /// + /// A task that represents the asynchronous operation. The task result contains a list of POCOs of type . + /// Task> FetchAsync(CancellationToken cancellationToken, CommandType commandType, string sql, params object[] args); #endregion @@ -301,23 +344,28 @@ public interface IQueryAsync Task> FetchAsync(long page, long maxItemsPerPage, string sql, params object[] args); /// - /// Asynchronously executes an auto-select query (SELECT *) for a subset of records based on the specified parameters, and returns the results as a list of type . + /// Asynchronously executes an auto-select query (SELECT *) for a subset of records based on the specified parameters, and + /// returns the results as a list of type . /// /// /// must be enabled in order to generate the auto-select portion of the SQL statement. /// This method performs essentially the same operation as . - /// Determining the number of records to skip, and how many to take, however, are calculated automatically based on the specified index and values. + /// Determining the number of records to skip, and how many to take, however, are calculated automatically based on the specified + /// index and values. /// /// The POCO type representing a single result record. /// A cancellation token that can be used to cancel the operation. /// The one-based page number used to calculate the number of records to skip. /// The maximum number of records per page. - /// A task that represents the asynchronous operation. The task result contains a list of POCOs of type . + /// + /// A task that represents the asynchronous operation. The task result contains a list of POCOs of type . + /// Task> FetchAsync(CancellationToken cancellationToken, long page, long maxItemsPerPage); /// /// This method performs essentially the same operation as . - /// Determining the number of records to skip, and how many to take, however, are calculated automatically based on the specified index and values. + /// Determining the number of records to skip, and how many to take, however, are calculated automatically based on the specified + /// index and values. /// /// A cancellation token that can be used to cancel the operation. /// The one-based page number used to calculate the number of records to skip. @@ -327,11 +375,13 @@ public interface IQueryAsync Task> FetchAsync(CancellationToken cancellationToken, long page, long maxItemsPerPage, Sql sql); /// - /// Asynchronously executes a query for a subset of records based on the specified parameters, and returns the results as a list of type . + /// Asynchronously executes a query for a subset of records based on the specified parameters, and returns the results as a list of + /// type . /// /// - /// This method performs essentially the same operation as . - /// Determining the number of records to skip, and how many to take, however, are calculated automatically based on the specified index and values. + /// This method performs essentially the same operation as . Determining the number of records to skip, and how many to take, however, are calculated automatically based on + /// the specified index and values. /// /// The POCO type representing a single result record. /// A cancellation token that can be used to cancel the operation. @@ -339,7 +389,9 @@ public interface IQueryAsync /// The maximum number of records per page. /// The SQL query string. /// The parameters to embed in the SQL string. - /// A task that represents the asynchronous operation. The task result contains a list of POCOs of type . + /// + /// A task that represents the asynchronous operation. The task result contains a list of POCOs of type . + /// Task> FetchAsync(CancellationToken cancellationToken, long page, long maxItemsPerPage, string sql, params object[] args); #endregion @@ -362,7 +414,8 @@ public interface IQueryAsync Task> PageAsync(long page, long maxItemsPerPage, string countSql, object[] countArgs, string pageSql, object[] pageArgs); /// - /// Asynchronously executes an auto-select query (SELECT *) for a subset of records based on the specified parameters, and returns the results as a Page of type . + /// Asynchronously executes an auto-select query (SELECT *) for a subset of records based on the specified parameters, and + /// returns the results as a Page of type . /// /// /// must be enabled in order to generate the auto-select portion of the SQL statement. @@ -371,22 +424,30 @@ public interface IQueryAsync /// A cancellation token that can be used to cancel the operation. /// The one-based page number for this page. /// The maximum number of records per page. - /// A task that represents the asynchronous operation. The task result contains an initialized containing a list of POCOs. + /// + /// A task that represents the asynchronous operation. The task result contains an initialized containing a + /// list of POCOs. + /// Task> PageAsync(CancellationToken cancellationToken, long page, long maxItemsPerPage); /// - /// Asynchronously executes a query for a subset of records based on the specified parameters, and returns the results as a Page of type . + /// Asynchronously executes a query for a subset of records based on the specified parameters, and returns the results as a Page of + /// type . /// /// The POCO type representing a single result record. /// A cancellation token that can be used to cancel the operation. /// The one-based page number for this page. /// The maximum number of records per page. /// An SQL builder instance representing the SQL query and its parameters. - /// A task that represents the asynchronous operation. The task result contains an initialized containing a list of POCOs. + /// + /// A task that represents the asynchronous operation. The task result contains an initialized containing a + /// list of POCOs. + /// Task> PageAsync(CancellationToken cancellationToken, long page, long maxItemsPerPage, Sql sql); /// - /// Asynchronously executes a query for a subset of records based on the specified parameters, and returns the results as a Page of type . + /// Asynchronously executes a query for a subset of records based on the specified parameters, and returns the results as a Page of + /// type . /// /// The POCO type representing a single result record. /// A cancellation token that can be used to cancel the operation. @@ -394,23 +455,33 @@ public interface IQueryAsync /// The maximum number of records per page. /// The SQL query string. /// The parameters to embed in the SQL string. - /// A task that represents the asynchronous operation. The task result contains an initialized containing a list of POCOs. + /// + /// A task that represents the asynchronous operation. The task result contains an initialized containing a + /// list of POCOs. + /// Task> PageAsync(CancellationToken cancellationToken, long page, long maxItemsPerPage, string sql, params object[] args); /// - /// Asynchronously executes a query for a subset of records based on the specified parameters, and returns the results as a Page of type . + /// Asynchronously executes a query for a subset of records based on the specified parameters, and returns the results as a Page of + /// type . /// /// The POCO type representing a single result record. /// A cancellation token that can be used to cancel the operation. /// The one-based page number for this page. /// The maximum number of records per page. - /// An SQL builder instance representing the SQL statement and its parameters, used to query the total number of records. - /// An SQL builder instance representing the SQL statement and its parameters, used to retrieve a single page of results. - /// A task that represents the asynchronous operation. The task result contains an initialized containing a list of POCOs. + /// An SQL builder instance representing the SQL statement and its parameters, used to query the total number + /// of records. + /// An SQL builder instance representing the SQL statement and its parameters, used to retrieve a single page + /// of results. + /// + /// A task that represents the asynchronous operation. The task result contains an initialized containing a + /// list of POCOs. + /// Task> PageAsync(CancellationToken cancellationToken, long page, long maxItemsPerPage, Sql countSql, Sql pageSql); /// - /// Asynchronously executes a query for a subset of records based on the specified parameters, and returns the results as a Page of type . + /// Asynchronously executes a query for a subset of records based on the specified parameters, and returns the results as a Page of + /// type . /// /// The POCO type representing a single result record. /// A cancellation token that can be used to cancel the operation. @@ -420,7 +491,10 @@ public interface IQueryAsync /// The parameters to embed in . /// The SQL statement used to retrieve a single page of results. /// The parameters to embed in the string. - /// A task that represents the asynchronous operation. The task result contains an initialized containing a list of POCOs. + /// + /// A task that represents the asynchronous operation. The task result contains an initialized containing a + /// list of POCOs. + /// Task> PageAsync(CancellationToken cancellationToken, long page, long maxItemsPerPage, string countSql, object[] countArgs, string pageSql, object[] pageArgs); #endregion @@ -437,7 +511,8 @@ public interface IQueryAsync Task> SkipTakeAsync(long skip, long take, string sql, params object[] args); /// - /// Asynchronously executes an auto-select query (SELECT *) for a subset of records based on the specified parameters, and returns the results as a list of type . + /// Asynchronously executes an auto-select query (SELECT *) for a subset of records based on the specified parameters, and + /// returns the results as a list of type . /// /// /// must be enabled in order to generate the auto-select portion of the SQL statement. @@ -446,7 +521,9 @@ public interface IQueryAsync /// A cancellation token that can be used to cancel the operation. /// The number of records to skip. /// The number of records to take. - /// A task that represents the asynchronous operation. The task result contains a list of POCOs of type . + /// + /// A task that represents the asynchronous operation. The task result contains a list of POCOs of type . + /// Task> SkipTakeAsync(CancellationToken cancellationToken, long skip, long take); /// A cancellation token that can be used to cancel the operation. @@ -457,7 +534,8 @@ public interface IQueryAsync Task> SkipTakeAsync(CancellationToken cancellationToken, long skip, long take, Sql sql); /// - /// Asynchronously executes a query for a subset of records based on the specified parameters, and returns the results as a list of type . + /// Asynchronously executes a query for a subset of records based on the specified parameters, and returns the results as a list of + /// type . /// /// The POCO type representing a single result record. /// A cancellation token that can be used to cancel the operation. @@ -465,7 +543,9 @@ public interface IQueryAsync /// The number of records to take. /// The SQL query string. /// The parameters to embed in the SQL string. - /// A task that represents the asynchronous operation. The task result contains a list of POCOs of type . + /// + /// A task that represents the asynchronous operation. The task result contains a list of POCOs of type . + /// Task> SkipTakeAsync(CancellationToken cancellationToken, long skip, long take, string sql, params object[] args); #endregion @@ -484,12 +564,16 @@ public interface IQueryAsync /// Asynchronously determines whether a record exists with the specified primary key value. /// /// - /// If provided a POCO object as the parameter, PetaPoco will extract the value from the POCO's mapped primary key property, and perform the same query as if the primary key value was provided directly. + /// If provided a POCO object as the parameter, PetaPoco will extract the value from the + /// POCO's mapped primary key property, and perform the same query as if the primary key value was provided directly. /// /// The POCO type representing a single result record. /// A cancellation token that can be used to cancel the operation. /// The primary key value, or a POCO containing an assigned primary key value. - /// A task that represents the asynchronous operation. The task result contains if one or more records exist with the specified primary key value; otherwise, . + /// + /// A task that represents the asynchronous operation. The task result contains if one or more records exist + /// with the specified primary key value; otherwise, . + /// Task ExistsAsync(CancellationToken cancellationToken, object pocoOrPrimaryKeyValue); // TODO: Missing overload: `IQueryAsync.ExistsAsync(CancellationToken, Sql)` @@ -501,7 +585,10 @@ public interface IQueryAsync /// A cancellation token that can be used to cancel the operation. /// The SQL string representing the condition portion of the WHERE clause. /// The parameters to embed in the SQL string. - /// A task that represents the asynchronous operation. The task result contains if one or more records exist that satisfy the conditions defined in the specified query; otherwise, . + /// + /// A task that represents the asynchronous operation. The task result contains if one or more records exist + /// that satisfy the conditions defined in the specified query; otherwise, . + /// Task ExistsAsync(CancellationToken cancellationToken, string sql, params object[] args); #endregion @@ -518,13 +605,17 @@ public interface IQueryAsync Task SingleAsync(string sql, params object[] args); /// - /// Asynchronously returns the only record that matches the specified primary key value, and throws an exception if there is not exactly one matching record. + /// Asynchronously returns the only record that matches the specified primary key value, and throws an exception if there is not + /// exactly one matching record. /// /// The POCO type representing a single result record. /// A cancellation token that can be used to cancel the operation. /// The primary key value. - /// A task that represents the asynchronous operation. The task result contains the single result returned by the query. - /// The result set is empty, or the result set contains more than one record. + /// + /// A task that represents the asynchronous operation. The task result contains the single result returned by the query. + /// + /// The result set is empty, or the result set contains more than one + /// record. Task SingleAsync(CancellationToken cancellationToken, object primaryKey); /// A cancellation token that can be used to cancel the operation. @@ -533,14 +624,18 @@ public interface IQueryAsync Task SingleAsync(CancellationToken cancellationToken, Sql sql); /// - /// Asynchronously returns the only record that matches the specified query, and throws an exception if there is not exactly one matching record. + /// Asynchronously returns the only record that matches the specified query, and throws an exception if there is not exactly one + /// matching record. /// /// The POCO type representing a single result record. /// A cancellation token that can be used to cancel the operation. /// The SQL query string. /// The parameters to embed in the SQL string. - /// A task that represents the asynchronous operation. The task result contains the single result returned by the query. - /// The result set is empty, or the result set contains more than one record. + /// + /// A task that represents the asynchronous operation. The task result contains the single result returned by the query. + /// + /// The result set is empty, or the result set contains more than one + /// record. Task SingleAsync(CancellationToken cancellationToken, string sql, params object[] args); #endregion @@ -557,12 +652,16 @@ public interface IQueryAsync Task SingleOrDefaultAsync(string sql, params object[] args); /// - /// Asynchronously returns the only record that matches the specified primary key value, or a default value if the result set is empty; this method throws an exception if there is more than one matching record. + /// Asynchronously returns the only record that matches the specified primary key value, or a default value if the result set is + /// empty; this method throws an exception if there is more than one matching record. /// /// The POCO type representing a single result record. /// A cancellation token that can be used to cancel the operation. /// The primary key value. - /// A task that represents the asynchronous operation. The task result contains default(T) if no record is found; otherwise, the single result returned by the specified query. + /// + /// A task that represents the asynchronous operation. The task result contains default(T) if no record is found; otherwise, the + /// single result returned by the specified query. + /// /// The result set contains more than one record. Task SingleOrDefaultAsync(CancellationToken cancellationToken, object primaryKey); @@ -572,13 +671,17 @@ public interface IQueryAsync Task SingleOrDefaultAsync(CancellationToken cancellationToken, Sql sql); /// - /// Asynchronously returns the only record that matches the specified query, or a default value if the result set is empty; this method throws an exception if there is more than one matching record. + /// Asynchronously returns the only record that matches the specified query, or a default value if the result set is empty; this + /// method throws an exception if there is more than one matching record. /// /// The POCO type representing a single result record. /// A cancellation token that can be used to cancel the operation. /// The SQL query string. /// The parameters to embed in the SQL string. - /// A task that represents the asynchronous operation. The task result contains default(T) if no record is found; otherwise, the single result returned by the specified query. + /// + /// A task that represents the asynchronous operation. The task result contains default(T) if no record is found; otherwise, the + /// single result returned by the specified query. + /// /// The result set contains more than one record. Task SingleOrDefaultAsync(CancellationToken cancellationToken, string sql, params object[] args); @@ -604,7 +707,9 @@ public interface IQueryAsync /// A cancellation token that can be used to cancel the operation. /// The SQL query string. /// The parameters to embed in the SQL string. - /// A task that represents the asynchronous operation. The task result contains the first result returned by the specified query. + /// + /// A task that represents the asynchronous operation. The task result contains the first result returned by the specified query. + /// /// The result set is empty. Task FirstAsync(CancellationToken cancellationToken, string sql, params object[] args); @@ -630,7 +735,10 @@ public interface IQueryAsync /// A cancellation token that can be used to cancel the operation. /// The SQL query string. /// The parameters to embed in the SQL string. - /// A task that represents the asynchronous operation. The task result contains default(T) if the result set is empty; otherwise, the first result returned by the specified query. + /// + /// A task that represents the asynchronous operation. The task result contains default(T) if the result set is empty; otherwise, + /// the first result returned by the specified query. + /// Task FirstOrDefaultAsync(CancellationToken cancellationToken, string sql, params object[] args); #endregion diff --git a/PetaPoco/IStoredProc.cs b/PetaPoco/IStoredProc.cs index c79e5d14..331c3b59 100644 --- a/PetaPoco/IStoredProc.cs +++ b/PetaPoco/IStoredProc.cs @@ -11,7 +11,8 @@ public interface IStoredProc /// Executes a non-query stored procedure and returns the number of rows affected. /// /// - /// For any arguments which are POCOs, each readable property will be turned into a named parameter for the stored procedure. Arguments which are IDbDataParameters will be passed through. Any other argument types will throw an exception. + /// For any arguments which are POCOs, each readable property will be turned into a named parameter for the stored procedure. + /// Arguments which are IDbDataParameters will be passed through. Any other argument types will throw an exception. /// /// The name of the stored procedure to execute. /// The arguments to pass to the stored procedure. @@ -22,7 +23,8 @@ public interface IStoredProc /// Executes a scalar stored procedure and returns the first column of the first row in the result set. /// /// - /// For any arguments which are POCOs, each readable property will be turned into a named parameter for the stored procedure. Arguments which are IDbDataParameters will be passed through. Any other argument types will throw an exception. + /// For any arguments which are POCOs, each readable property will be turned into a named parameter for the stored procedure. + /// Arguments which are IDbDataParameters will be passed through. Any other argument types will throw an exception. /// /// The POCO type representing a single result record. /// The name of the stored procedure to execute. @@ -34,7 +36,8 @@ public interface IStoredProc /// Executes a query stored procedure and returns the results as a sequence of type . /// /// - /// For any arguments which are POCOs, each readable property will be turned into a named parameter for the stored procedure. Arguments which are IDbDataParameters will be passed through. Any other argument types will throw an exception. + /// For any arguments which are POCOs, each readable property will be turned into a named parameter for the stored procedure. + /// Arguments which are IDbDataParameters will be passed through. Any other argument types will throw an exception. /// /// The POCO type representing a single result record. /// The name of the stored procedure to execute. @@ -46,7 +49,8 @@ public interface IStoredProc /// Executes a query stored procedure and returns the results as a list of type . /// /// - /// For any arguments which are POCOs, each readable property will be turned into a named parameter for the stored procedure. Arguments which are IDbDataParameters will be passed through. Any other argument types will throw an exception. + /// For any arguments which are POCOs, each readable property will be turned into a named parameter for the stored procedure. + /// Arguments which are IDbDataParameters will be passed through. Any other argument types will throw an exception. /// /// The POCO type representing a single result record. /// The name of the stored procedure to execute. diff --git a/PetaPoco/IStoredProcAsync.cs b/PetaPoco/IStoredProcAsync.cs index bdd30c79..9ee2a48b 100644 --- a/PetaPoco/IStoredProcAsync.cs +++ b/PetaPoco/IStoredProcAsync.cs @@ -30,65 +30,82 @@ public interface IStoredProcAsync /// Asynchronously executes a non-query stored procedure and returns the number of rows affected. /// /// - /// For any arguments which are POCOs, each readable property will be turned into a named parameter for the stored procedure. Arguments which are IDbDataParameters will be passed through. Any other argument types will throw an exception. + /// For any arguments which are POCOs, each readable property will be turned into a named parameter for the stored procedure. + /// Arguments which are IDbDataParameters will be passed through. Any other argument types will throw an exception. /// /// A cancellation token that can be used to cancel the operation. /// The name of the stored procedure to execute. /// The arguments to pass to the stored procedure. - /// A task that represents the asynchronous operation. The task result contains the number of rows affected. + /// + /// A task that represents the asynchronous operation. The task result contains the number of rows affected. + /// Task ExecuteNonQueryProcAsync(CancellationToken cancellationToken, string storedProcedureName, params object[] args); /// /// Asynchronously executes a scalar stored procedure and returns the first column of the first row in the result set. /// /// - /// For any arguments which are POCOs, each readable property will be turned into a named parameter for the stored procedure. Arguments which are IDbDataParameters will be passed through. Any other argument types will throw an exception. + /// For any arguments which are POCOs, each readable property will be turned into a named parameter for the stored procedure. + /// Arguments which are IDbDataParameters will be passed through. Any other argument types will throw an exception. /// /// The POCO type representing a single result record. /// A cancellation token that can be used to cancel the operation. /// The name of the stored procedure to execute. /// The arguments to pass to the stored procedure. - /// A task that represents the asynchronous operation. The task result contains the scalar result value of type . + /// + /// A task that represents the asynchronous operation. The task result contains the scalar result value of type . + /// Task ExecuteScalarProcAsync(CancellationToken cancellationToken, string storedProcedureName, params object[] args); /// /// Asynchronously executes a query stored procedure and returns an IAsyncReader of type . /// /// - /// For any arguments which are POCOs, each readable property will be turned into a named parameter for the stored procedure. Arguments which are IDbDataParameters will be passed through. Any other argument types will throw an exception. + /// For any arguments which are POCOs, each readable property will be turned into a named parameter for the stored procedure. + /// Arguments which are IDbDataParameters will be passed through. Any other argument types will throw an exception. /// /// The POCO type representing a single result record. /// A cancellation token that can be used to cancel the operation. /// The name of the stored procedure to execute. /// The arguments to pass to the stored procedure. - /// A task that represents the asynchronous operation. The task result contains an for reading the result set. + /// + /// A task that represents the asynchronous operation. The task result contains an for reading the + /// result set. + /// Task> QueryProcAsync(CancellationToken cancellationToken, string storedProcedureName, params object[] args); /// /// Asynchronously executes a query stored procedure and invokes the specified action on each POCO in the result set. /// /// - /// For any arguments which are POCOs, each readable property will be turned into a named parameter for the stored procedure. Arguments which are IDbDataParameters will be passed through. Any other argument types will throw an exception. + /// For any arguments which are POCOs, each readable property will be turned into a named parameter for the stored procedure. + /// Arguments which are IDbDataParameters will be passed through. Any other argument types will throw an exception. /// /// The POCO type representing a single result record. /// An action to perform on each POCO in the result set. /// A cancellation token that can be used to cancel the operation. /// The name of the stored procedure to execute. /// The arguments to pass to the stored procedure. - /// A task that represents the asynchronous operation. + /// + /// A task that represents the asynchronous operation. + /// Task QueryProcAsync(Action action, CancellationToken cancellationToken, string storedProcedureName, params object[] args); /// /// Asynchronously executes a query stored procedure and returns a list of type . /// /// - /// For any arguments which are POCOs, each readable property will be turned into a named parameter for the stored procedure. Arguments which are IDbDataParameters will be passed through. Any other argument types will throw an exception. + /// For any arguments which are POCOs, each readable property will be turned into a named parameter for the stored procedure. + /// Arguments which are IDbDataParameters will be passed through. Any other argument types will throw an exception. /// /// The POCO type representing a single result record. /// A cancellation token that can be used to cancel the operation. /// The name of the stored procedure to execute. /// The arguments to pass to the stored procedure. - /// A task that represents the asynchronous operation. The task result contains a list of POCOs of type . + /// + /// A task that represents the asynchronous operation. The task result contains a list of POCOs of type . + /// Task> FetchProcAsync(CancellationToken cancellationToken, string storedProcedureName, params object[] args); } #endif diff --git a/PetaPoco/ITransactionAccessor.cs b/PetaPoco/ITransactionAccessor.cs index 956b3d65..8b2416d4 100644 --- a/PetaPoco/ITransactionAccessor.cs +++ b/PetaPoco/ITransactionAccessor.cs @@ -3,7 +3,7 @@ namespace PetaPoco { /// - /// Represents a contract which exposes the current instance. + /// Represents a contract which exposes the current instance. /// public interface ITransactionAccessor { diff --git a/PetaPoco/OracleProvider.cs b/PetaPoco/OracleProvider.cs index 75504644..9988e87f 100644 --- a/PetaPoco/OracleProvider.cs +++ b/PetaPoco/OracleProvider.cs @@ -5,10 +5,11 @@ namespace PetaPoco { /// - /// The OracleProvider class provides an implementation of for early versions of the Oracle drivers that don't include it. + /// Pprovides an implementation of for early versions of the Oracle drivers that don't include it. /// /// - /// For later versions of Oracle, the standard OracleProviderFactory class should work fine. Uses reflection to load Oracle.DataAccess assembly and in-turn create connections and commands. + /// For later versions of Oracle, the standard OracleProviderFactory class should work fine. + /// Uses reflection to load Oracle.DataAccess assembly and in-turn create connections and commands. /// Thanks to Adam Schroder (@schotime) for this. /// Currently untested. /// diff --git a/PetaPoco/Providers/FirebirdDbDatabaseProvider.cs b/PetaPoco/Providers/FirebirdDbDatabaseProvider.cs index 89bda30d..3a409709 100644 --- a/PetaPoco/Providers/FirebirdDbDatabaseProvider.cs +++ b/PetaPoco/Providers/FirebirdDbDatabaseProvider.cs @@ -11,7 +11,7 @@ namespace PetaPoco.Providers { /// - /// The FirebirdDbDatabaseProvider class provides an implementation of the class specific to the Firebird database. + /// Provides a specific implementation of the class for Firebird. /// public class FirebirdDbDatabaseProvider : DatabaseProvider { diff --git a/PetaPoco/Providers/MariaDbDatabaseProvider.cs b/PetaPoco/Providers/MariaDbDatabaseProvider.cs index d6395638..dc50aad5 100644 --- a/PetaPoco/Providers/MariaDbDatabaseProvider.cs +++ b/PetaPoco/Providers/MariaDbDatabaseProvider.cs @@ -5,10 +5,10 @@ namespace PetaPoco.Providers { /// - /// Provides a specific implementation of the class for the MariaDB database. + /// Provides a specific implementation of the class for MariaDB. /// /// - /// Under the hood, this class uses the MySql data provider. + /// This class uses the provider. /// public class MariaDbDatabaseProvider : DatabaseProvider { diff --git a/PetaPoco/Providers/MsAccessDbDatabaseProvider.cs b/PetaPoco/Providers/MsAccessDbDatabaseProvider.cs index dd51c435..814eb8b9 100644 --- a/PetaPoco/Providers/MsAccessDbDatabaseProvider.cs +++ b/PetaPoco/Providers/MsAccessDbDatabaseProvider.cs @@ -11,15 +11,15 @@ namespace PetaPoco.Providers { /// - /// The MsAccessDbDatabaseProvider class provides a specific implementation of the class for the Microsoft Access database. + /// Provides a specific implementation of the class for Microsoft Access. /// public class MsAccessDbDatabaseProvider : DatabaseProvider { - /// + /// public override DbProviderFactory GetFactory() => GetFactory("System.Data.OleDb.OleDbFactory, System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"); - /// + /// public override object ExecuteInsert(Database db, IDbCommand cmd, string primaryKeyName) { ExecuteNonQueryHelper(db, cmd); @@ -28,7 +28,7 @@ public override object ExecuteInsert(Database db, IDbCommand cmd, string primary } #if ASYNC - /// + /// public override async Task ExecuteInsertAsync(CancellationToken cancellationToken, Database db, IDbCommand cmd, string primaryKeyName) { await ExecuteNonQueryHelperAsync(cancellationToken, db, cmd).ConfigureAwait(false); @@ -42,7 +42,7 @@ public override async Task ExecuteInsertAsync(CancellationToken cancella /// /// This method always throws a . /// The MsAccess provider does not support paging. - /// + /// public override string BuildPageQuery(long skip, long take, SQLParts parts, ref object[] args) => throw new NotSupportedException("The Access provider does not support paging."); } diff --git a/PetaPoco/Providers/MySqlConnectorDatabaseProvider.cs b/PetaPoco/Providers/MySqlConnectorDatabaseProvider.cs index 075807ab..a7bb7d1f 100644 --- a/PetaPoco/Providers/MySqlConnectorDatabaseProvider.cs +++ b/PetaPoco/Providers/MySqlConnectorDatabaseProvider.cs @@ -5,7 +5,7 @@ namespace PetaPoco.Providers { /// - /// The MySqlConnectorDatabaseProvider class provides a specific implementation of the class for the MySQL database using the MySqlConnector library. + /// Provides a specific implementation of the class for MySQL using the MySqlConnector library. /// public class MySqlConnectorDatabaseProvider : DatabaseProvider { diff --git a/PetaPoco/Providers/MySqlDatabaseProvider.cs b/PetaPoco/Providers/MySqlDatabaseProvider.cs index e1df5af7..69a180fe 100644 --- a/PetaPoco/Providers/MySqlDatabaseProvider.cs +++ b/PetaPoco/Providers/MySqlDatabaseProvider.cs @@ -5,15 +5,15 @@ namespace PetaPoco.Providers { /// - /// The MySqlDatabaseProvider class provides a specific implementation of the class for the MySQL database. + /// Provides a specific implementation of the class for MySQL. /// public class MySqlDatabaseProvider : DatabaseProvider { - /// + /// public override DbProviderFactory GetFactory() => GetFactory("MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Culture=neutral, PublicKeyToken=c5687fc88969c44d"); - /// + /// public override string GetParameterPrefix(string connectionString) { if (connectionString != null && connectionString.IndexOf("Allow User Variables=true", StringComparison.Ordinal) >= 0) @@ -21,10 +21,10 @@ public override string GetParameterPrefix(string connectionString) return "@"; } - /// + /// public override string EscapeSqlIdentifier(string sqlIdentifier) => $"`{sqlIdentifier}`"; - /// + /// public override string GetExistsSql() => "SELECT EXISTS (SELECT 1 FROM {0} WHERE {1})"; } } diff --git a/PetaPoco/Providers/OracleDatabaseProvider.cs b/PetaPoco/Providers/OracleDatabaseProvider.cs index 99401aee..cfd5dc62 100644 --- a/PetaPoco/Providers/OracleDatabaseProvider.cs +++ b/PetaPoco/Providers/OracleDatabaseProvider.cs @@ -12,21 +12,21 @@ namespace PetaPoco.Providers { /// - /// The OracleDatabaseProvider class provides a specific implementation of the class for the Oracle database. + /// Provides a specific implementation of the class for Oracle. /// public class OracleDatabaseProvider : DatabaseProvider { - /// + /// public override string GetParameterPrefix(string connectionString) => ":"; - /// + /// public override void PreExecute(IDbCommand cmd) { cmd.GetType().GetProperty("BindByName")?.SetValue(cmd, true, null); cmd.GetType().GetProperty("InitialLONGFetchSize")?.SetValue(cmd, -1, null); } - /// + /// /// A paged query does not alias '*' public override string BuildPageQuery(long skip, long take, SQLParts parts, ref object[] args) { @@ -37,7 +37,7 @@ public override string BuildPageQuery(long skip, long take, SQLParts parts, ref return Singleton.Instance.BuildPageQuery(skip, take, parts, ref args); } - /// + /// public override DbProviderFactory GetFactory() { // "Oracle.ManagedDataAccess.Client.OracleClientFactory, Oracle.ManagedDataAccess" is for Oracle.ManagedDataAccess.dll @@ -46,13 +46,13 @@ public override DbProviderFactory GetFactory() "Oracle.DataAccess.Client.OracleClientFactory, Oracle.DataAccess"); } - /// + /// public override string EscapeSqlIdentifier(string sqlIdentifier) => $"\"{sqlIdentifier.ToUpperInvariant()}\""; - /// + /// public override string GetAutoIncrementExpression(TableInfo ti) => !string.IsNullOrEmpty(ti.SequenceName) ? $"{ti.SequenceName}.nextval" : null; - /// + /// public override object ExecuteInsert(Database db, IDbCommand cmd, string primaryKeyName) { if (primaryKeyName != null) @@ -67,7 +67,7 @@ public override object ExecuteInsert(Database db, IDbCommand cmd, string primary } #if ASYNC - /// + /// public override async Task ExecuteInsertAsync(CancellationToken cancellationToken, Database db, IDbCommand cmd, string primaryKeyName) { if (primaryKeyName != null) diff --git a/PetaPoco/Providers/PostgreSQLDatabaseProvider.cs b/PetaPoco/Providers/PostgreSQLDatabaseProvider.cs index 4fad815a..0531b925 100644 --- a/PetaPoco/Providers/PostgreSQLDatabaseProvider.cs +++ b/PetaPoco/Providers/PostgreSQLDatabaseProvider.cs @@ -9,21 +9,21 @@ namespace PetaPoco.Providers { /// - /// The PostgreSQLDatabaseProvider class provides a specific implementation of the class for the PostgreSQL database. + /// Provides a specific implementation of the class for PostgreSQL. /// public class PostgreSQLDatabaseProvider : DatabaseProvider { - /// + /// public override bool HasNativeGuidSupport => true; - /// + /// public override DbProviderFactory GetFactory() => GetFactory("Npgsql.NpgsqlFactory, Npgsql, Culture=neutral, PublicKeyToken=5d8b90d52f46fda7"); - /// + /// public override string GetExistsSql() => "SELECT CASE WHEN EXISTS(SELECT 1 FROM {0} WHERE {1}) THEN 1 ELSE 0 END"; - /// + /// public override object MapParameterValue(object value) { // Don't map bools to ints in PostgreSQL @@ -33,10 +33,10 @@ public override object MapParameterValue(object value) return base.MapParameterValue(value); } - /// + /// public override string EscapeSqlIdentifier(string sqlIdentifier) => $"\"{sqlIdentifier}\""; - /// + /// public override object ExecuteInsert(Database db, IDbCommand cmd, string primaryKeyName) { if (primaryKeyName != null) @@ -50,7 +50,7 @@ public override object ExecuteInsert(Database db, IDbCommand cmd, string primary } #if ASYNC - /// + /// public override async Task ExecuteInsertAsync(CancellationToken cancellationToken, Database db, IDbCommand cmd, string primaryKeyName) { if (primaryKeyName != null) diff --git a/PetaPoco/Providers/SQLiteDatabaseProvider.cs b/PetaPoco/Providers/SQLiteDatabaseProvider.cs index 24eb3a84..b4b3d204 100644 --- a/PetaPoco/Providers/SQLiteDatabaseProvider.cs +++ b/PetaPoco/Providers/SQLiteDatabaseProvider.cs @@ -7,15 +7,15 @@ namespace PetaPoco.Providers { /// - /// The SQLiteDatabaseProvider class provides a specific implementation of the class for the SQLite database. + /// Provides a specific implementation of the class for SQLite. /// public class SQLiteDatabaseProvider : DatabaseProvider { - /// + /// public override DbProviderFactory GetFactory() => GetFactory("System.Data.SQLite.SQLiteFactory, System.Data.SQLite", "Microsoft.Data.Sqlite.SqliteFactory, Microsoft.Data.Sqlite"); - /// + /// public override object MapParameterValue(object value) { if (value is uint u) @@ -24,7 +24,7 @@ public override object MapParameterValue(object value) return base.MapParameterValue(value); } - /// + /// public override object ExecuteInsert(Database db, IDbCommand cmd, string primaryKeyName) { if (primaryKeyName != null) @@ -38,7 +38,7 @@ public override object ExecuteInsert(Database db, IDbCommand cmd, string primary } #if ASYNC - /// + /// public override async Task ExecuteInsertAsync(CancellationToken cancellationToken, Database db, IDbCommand cmd, string primaryKeyName) { if (primaryKeyName != null) @@ -52,7 +52,7 @@ public override async Task ExecuteInsertAsync(CancellationToken cancella } #endif - /// + /// public override string GetExistsSql() => "SELECT EXISTS (SELECT 1 FROM {0} WHERE {1})"; } } diff --git a/PetaPoco/Providers/SqlServerCEDatabaseProviders.cs b/PetaPoco/Providers/SqlServerCEDatabaseProviders.cs index c6324d80..72c494a5 100644 --- a/PetaPoco/Providers/SqlServerCEDatabaseProviders.cs +++ b/PetaPoco/Providers/SqlServerCEDatabaseProviders.cs @@ -9,15 +9,15 @@ namespace PetaPoco.Providers { /// - /// The SqlServerCEDatabaseProviders class provides a specific implementation of the class for the SQL Server Compact Edition database. + /// Provides a specific implementation of the class for SQL Server CE. /// public class SqlServerCEDatabaseProviders : DatabaseProvider { - /// + /// public override DbProviderFactory GetFactory() => GetFactory("System.Data.SqlServerCe.SqlCeProviderFactory, System.Data.SqlServerCe, Culture=neutral, PublicKeyToken=89845dcd8080cc91"); - /// + /// public override string BuildPageQuery(long skip, long take, SQLParts parts, ref object[] args) { if (string.IsNullOrEmpty(parts.SqlOrderBy)) @@ -27,7 +27,7 @@ public override string BuildPageQuery(long skip, long take, SQLParts parts, ref return sqlPage; } - /// + /// public override object ExecuteInsert(Database db, IDbCommand cmd, string primaryKeyName) { ExecuteNonQueryHelper(db, cmd); @@ -35,7 +35,7 @@ public override object ExecuteInsert(Database db, IDbCommand cmd, string primary } #if ASYNC - /// + /// public override async Task ExecuteInsertAsync(CancellationToken cancellationToken, Database db, IDbCommand cmd, string primaryKeyName) { await ExecuteNonQueryHelperAsync(cancellationToken, db, cmd); diff --git a/PetaPoco/Providers/SqlServerDatabaseProvider.cs b/PetaPoco/Providers/SqlServerDatabaseProvider.cs index b75df40a..fb7b0167 100644 --- a/PetaPoco/Providers/SqlServerDatabaseProvider.cs +++ b/PetaPoco/Providers/SqlServerDatabaseProvider.cs @@ -9,15 +9,15 @@ namespace PetaPoco.Providers { /// - /// The SqlServerDatabaseProvider class provides a specific implementation of the class for the SQL Server database. + /// Provides a specific implementation of the class for SQL Server. /// public class SqlServerDatabaseProvider : DatabaseProvider { - /// + /// public override DbProviderFactory GetFactory() => GetFactory("System.Data.SqlClient.SqlClientFactory, System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"); - /// + /// public override string BuildPageQuery(long skip, long take, SQLParts parts, ref object[] args) { var helper = (PagingHelper) PagingUtility; @@ -41,21 +41,21 @@ public override string BuildPageQuery(long skip, long take, SQLParts parts, ref return sqlPage; } - /// + /// public override object ExecuteInsert(Database db, IDbCommand cmd, string primaryKeyName) => ExecuteScalarHelper(db, cmd); #if ASYNC - /// + /// public override Task ExecuteInsertAsync(CancellationToken cancellationToken, Database db, IDbCommand cmd, string primaryKeyName) => ExecuteScalarHelperAsync(cancellationToken, db, cmd); #endif - /// + /// public override string GetExistsSql() => "IF EXISTS (SELECT 1 FROM {0} WHERE {1}) SELECT 1 ELSE SELECT 0"; - /// + /// public override string GetInsertOutputClause(string primaryKeyName) => $" OUTPUT INSERTED.[{primaryKeyName}]"; } diff --git a/PetaPoco/Providers/SqlServerMsDataDatabaseProvider.cs b/PetaPoco/Providers/SqlServerMsDataDatabaseProvider.cs index 40068876..c1e3404c 100644 --- a/PetaPoco/Providers/SqlServerMsDataDatabaseProvider.cs +++ b/PetaPoco/Providers/SqlServerMsDataDatabaseProvider.cs @@ -4,14 +4,14 @@ namespace PetaPoco.Providers { /// - /// The SqlServerMsDataDatabaseProvider class provides a specific implementation of the class for the SQL Server database. + /// Provides a specific implementation of the class for Microsoft.Data.SqlClient. /// /// - /// Under the hood, this class serves as a wrapper for the class. + /// This class serves as a wrapper for the class. /// public class SqlServerMsDataDatabaseProvider : SqlServerDatabaseProvider { - /// + /// public override DbProviderFactory GetFactory() => GetFactory("Microsoft.Data.SqlClient.SqlClientFactory, Microsoft.Data.SqlClient"); } diff --git a/PetaPoco/Utilities/AsyncReader.cs b/PetaPoco/Utilities/AsyncReader.cs index 13728545..4899a5b3 100644 --- a/PetaPoco/Utilities/AsyncReader.cs +++ b/PetaPoco/Utilities/AsyncReader.cs @@ -61,7 +61,8 @@ public async Task ReadAsync() // TODO: Not implemented: `ReadAsync(CancellationToken)` /// - /// Disposes the AsyncReader, closing and releasing the underlying , , and shared . + /// Disposes the AsyncReader, closing and releasing the underlying , , and shared + /// . /// public void Dispose() { diff --git a/PetaPoco/Utilities/IPagingHelper.cs b/PetaPoco/Utilities/IPagingHelper.cs index 1ae6a1b4..077c9887 100644 --- a/PetaPoco/Utilities/IPagingHelper.cs +++ b/PetaPoco/Utilities/IPagingHelper.cs @@ -6,10 +6,12 @@ namespace PetaPoco.Utilities public interface IPagingHelper { /// - /// Splits the given SQL statement into parts, and initializes an instance containing the resulting substrings at . + /// Splits the given SQL statement into parts, and initializes an instance containing the resulting + /// substrings at . /// /// The SQL string to be parsed. This value must not be . - /// When this method returns, the parsed SQL statement split into it's constituent parts, if the SQL statement could be split; otherwise, . This parameter is passed uninitialized. + /// When this method returns, the parsed SQL statement split into it's constituent parts, if the SQL statement + /// could be split; otherwise, . This parameter is passed uninitialized. /// if the SQL statement could be parsed; otherwise, . bool SplitSQL(string sql, out SQLParts parts); } diff --git a/PetaPoco/Utilities/ParametersHelper.cs b/PetaPoco/Utilities/ParametersHelper.cs index 52eda38a..a6336ba0 100644 --- a/PetaPoco/Utilities/ParametersHelper.cs +++ b/PetaPoco/Utilities/ParametersHelper.cs @@ -13,7 +13,8 @@ namespace PetaPoco.Internal /// Provides static utility methods and extensions for handling SQL parameters. /// /// - /// This class includes extensions for validating and replacing parameter prefixes, as well as static methods used for processing parameters for queries and stored procedures. + /// This class includes extensions for validating and replacing parameter prefixes, as well as static methods used for processing + /// parameters for queries and stored procedures. /// internal static class ParametersHelper { @@ -47,7 +48,6 @@ public static string EnsureParamPrefix(this int value, string paramPrefix) public static string EnsureParamPrefix(this string value, string paramPrefix) => value.StartsWith(paramPrefix) ? value : NonWordStartRegex.Replace(value, paramPrefix); - // TODO: Use same collection type for srcArgs and destArgs (`object[]` vs `List`) /// /// Processes the parameters for an SQL statement. /// @@ -58,10 +58,13 @@ public static string EnsureParamPrefix(this string value, string paramPrefix) /// The source arguments to be processed. /// The destination list to store the processed arguments. /// The SQL statement with the parameters processed. - /// The number of parameters is less than the count of numbered parameters in the SQL string. - /// None of the passed parameters have a property with the name used as a named parameter. + /// The number of parameters is less than the count of numbered parameters in the SQL + /// string. + /// None of the passed parameters have a property with the name used as a named + /// parameter. public static string ProcessQueryParams(string sql, object[] srcArgs, List destArgs) { + // TODO: Use same collection type for srcArgs and destArgs (`object[]` vs `List`) return ParamPrefixRegex.Replace(sql, m => { string param = m.Value.Substring(1);