Repository: maxtoroq/DbExtensions
Branch: v7
Commit: 07fbefe6fe6c
Files: 503
Total size: 1.3 MB
Directory structure:
gitextract_v6wr0hj4/
├── .gitattributes
├── .github/
│ └── FUNDING.yml
├── .gitignore
├── .gitmodules
├── CHANGES.md
├── DbExtensions.sln
├── LICENSE.txt
├── NOTICE.xml
├── README.md
├── appveyor.yml
├── build/
│ ├── .gitignore
│ ├── DbExtensions.shfbproj
│ ├── build-docs.ps1
│ ├── ensure-nuget.ps1
│ └── release.ps1
├── docs/
│ ├── README.md
│ ├── SqlBuilder.md
│ ├── SqlSet.md
│ └── api/
│ ├── DbExtensions/
│ │ ├── AssociationAttribute/
│ │ │ ├── Name.md
│ │ │ ├── OtherKey.md
│ │ │ ├── README.md
│ │ │ ├── ThisKey.md
│ │ │ └── _ctor.md
│ │ ├── AutoSync/
│ │ │ └── README.md
│ │ ├── ChangeConflictException/
│ │ │ ├── README.md
│ │ │ └── _ctor.md
│ │ ├── ColumnAttribute/
│ │ │ ├── AutoSync.md
│ │ │ ├── ConvertTo.md
│ │ │ ├── IsDbGenerated.md
│ │ │ ├── IsPrimaryKey.md
│ │ │ ├── IsVersion.md
│ │ │ ├── Name.md
│ │ │ ├── README.md
│ │ │ └── _ctor.md
│ │ ├── ComplexPropertyAttribute/
│ │ │ ├── Name.md
│ │ │ ├── README.md
│ │ │ ├── Separator.md
│ │ │ └── _ctor.md
│ │ ├── Database/
│ │ │ ├── Add.md
│ │ │ ├── AddAsync.md
│ │ │ ├── AsyncMap.md
│ │ │ ├── AsyncMap_1.md
│ │ │ ├── AsyncMap__1.md
│ │ │ ├── AsyncMap__1_1.md
│ │ │ ├── Configuration.md
│ │ │ ├── Connection.md
│ │ │ ├── CreateCommand.md
│ │ │ ├── Dispose.md
│ │ │ ├── Dispose_1.md
│ │ │ ├── EnsureConnectionOpen.md
│ │ │ ├── EnsureConnectionOpenAsync.md
│ │ │ ├── EnsureInTransaction.md
│ │ │ ├── EnsureInTransactionAsync.md
│ │ │ ├── EnsureInTransactionAsync_1.md
│ │ │ ├── EnsureInTransaction_1.md
│ │ │ ├── Execute.md
│ │ │ ├── ExecuteAsync.md
│ │ │ ├── FindAsync__1.md
│ │ │ ├── Find__1.md
│ │ │ ├── From.md
│ │ │ ├── FromQuery.md
│ │ │ ├── FromQuery_1.md
│ │ │ ├── FromQuery__1.md
│ │ │ ├── FromQuery__1_1.md
│ │ │ ├── From_1.md
│ │ │ ├── From__1.md
│ │ │ ├── LastInsertId.md
│ │ │ ├── LastInsertIdAsync.md
│ │ │ ├── Map.md
│ │ │ ├── Map_1.md
│ │ │ ├── Map__1.md
│ │ │ ├── Map__1_1.md
│ │ │ ├── QuoteIdentifier.md
│ │ │ ├── README.md
│ │ │ ├── Remove.md
│ │ │ ├── RemoveAsync.md
│ │ │ ├── Table.md
│ │ │ ├── Table__1.md
│ │ │ ├── Transaction.md
│ │ │ ├── Update.md
│ │ │ ├── UpdateAsync.md
│ │ │ ├── UpdateAsync_1.md
│ │ │ ├── Update_1.md
│ │ │ ├── _ctor.md
│ │ │ └── _ctor_1.md
│ │ ├── DatabaseConfiguration/
│ │ │ ├── CommandTimeout.md
│ │ │ ├── DefaultComplexPropertySeparator.md
│ │ │ ├── EnableBatchCommands.md
│ │ │ ├── LastInsertIdCommand.md
│ │ │ ├── Log.md
│ │ │ ├── ParameterNameBuilder.md
│ │ │ ├── ParameterPlaceholderBuilder.md
│ │ │ ├── QuotePrefix.md
│ │ │ ├── QuoteSuffix.md
│ │ │ ├── README.md
│ │ │ └── UseVersionMember.md
│ │ ├── Extensions/
│ │ │ ├── GetBoolean.md
│ │ │ ├── GetByte.md
│ │ │ ├── GetChar.md
│ │ │ ├── GetDateTime.md
│ │ │ ├── GetDecimal.md
│ │ │ ├── GetDouble.md
│ │ │ ├── GetFloat.md
│ │ │ ├── GetInt16.md
│ │ │ ├── GetInt32.md
│ │ │ ├── GetInt64.md
│ │ │ ├── GetNullableBoolean.md
│ │ │ ├── GetNullableBoolean_1.md
│ │ │ ├── GetNullableByte.md
│ │ │ ├── GetNullableByte_1.md
│ │ │ ├── GetNullableChar.md
│ │ │ ├── GetNullableChar_1.md
│ │ │ ├── GetNullableDateTime.md
│ │ │ ├── GetNullableDateTime_1.md
│ │ │ ├── GetNullableDecimal.md
│ │ │ ├── GetNullableDecimal_1.md
│ │ │ ├── GetNullableDouble.md
│ │ │ ├── GetNullableDouble_1.md
│ │ │ ├── GetNullableFloat.md
│ │ │ ├── GetNullableFloat_1.md
│ │ │ ├── GetNullableGuid.md
│ │ │ ├── GetNullableGuid_1.md
│ │ │ ├── GetNullableInt16.md
│ │ │ ├── GetNullableInt16_1.md
│ │ │ ├── GetNullableInt32.md
│ │ │ ├── GetNullableInt32_1.md
│ │ │ ├── GetNullableInt64.md
│ │ │ ├── GetNullableInt64_1.md
│ │ │ ├── GetString.md
│ │ │ ├── GetStringOrNull.md
│ │ │ ├── GetStringOrNull_1.md
│ │ │ ├── GetValue.md
│ │ │ ├── GetValueOrNull.md
│ │ │ ├── GetValueOrNull_1.md
│ │ │ └── README.md
│ │ ├── README.md
│ │ ├── SQL/
│ │ │ ├── DELETE_FROM.md
│ │ │ ├── DELETE_FROM_1.md
│ │ │ ├── INSERT_INTO.md
│ │ │ ├── INSERT_INTO_1.md
│ │ │ ├── README.md
│ │ │ ├── SELECT.md
│ │ │ ├── SELECT_1.md
│ │ │ ├── UPDATE.md
│ │ │ ├── UPDATE_1.md
│ │ │ ├── WITH.md
│ │ │ ├── WITH_1.md
│ │ │ ├── WITH_2.md
│ │ │ └── WITH_3.md
│ │ ├── SqlBuilder/
│ │ │ ├── Append.md
│ │ │ ├── AppendClause.md
│ │ │ ├── AppendClause__1.md
│ │ │ ├── AppendElse.md
│ │ │ ├── AppendElseIf.md
│ │ │ ├── AppendIf.md
│ │ │ ├── AppendLine.md
│ │ │ ├── AppendSql.md
│ │ │ ├── Append_1.md
│ │ │ ├── Buffer.md
│ │ │ ├── CROSS_JOIN.md
│ │ │ ├── CROSS_JOIN_1.md
│ │ │ ├── CROSS_JOIN_2.md
│ │ │ ├── Clone.md
│ │ │ ├── CurrentClause.md
│ │ │ ├── DELETE_FROM.md
│ │ │ ├── DELETE_FROM_1.md
│ │ │ ├── FROM.md
│ │ │ ├── FROM_1.md
│ │ │ ├── FROM_2.md
│ │ │ ├── FROM_3.md
│ │ │ ├── FROM_4.md
│ │ │ ├── GROUP_BY.md
│ │ │ ├── GROUP_BY_1.md
│ │ │ ├── GROUP_BY_2.md
│ │ │ ├── HAVING.md
│ │ │ ├── HAVING_1.md
│ │ │ ├── HAVING_2.md
│ │ │ ├── INNER_JOIN.md
│ │ │ ├── INNER_JOIN_1.md
│ │ │ ├── INNER_JOIN_2.md
│ │ │ ├── INSERT_INTO.md
│ │ │ ├── INSERT_INTO_1.md
│ │ │ ├── InsertText.md
│ │ │ ├── IsEmpty.md
│ │ │ ├── JOIN.md
│ │ │ ├── JOIN_1.md
│ │ │ ├── JOIN_2.md
│ │ │ ├── JoinSql.md
│ │ │ ├── JoinSql_1.md
│ │ │ ├── LEFT_JOIN.md
│ │ │ ├── LEFT_JOIN_1.md
│ │ │ ├── LEFT_JOIN_2.md
│ │ │ ├── LIMIT.md
│ │ │ ├── LIMIT_1.md
│ │ │ ├── LIMIT_2.md
│ │ │ ├── LIMIT_3.md
│ │ │ ├── NextClause.md
│ │ │ ├── OFFSET.md
│ │ │ ├── OFFSET_1.md
│ │ │ ├── OFFSET_2.md
│ │ │ ├── OFFSET_3.md
│ │ │ ├── ORDER_BY.md
│ │ │ ├── ORDER_BY_1.md
│ │ │ ├── ORDER_BY_2.md
│ │ │ ├── ParameterValues.md
│ │ │ ├── README.md
│ │ │ ├── RIGHT_JOIN.md
│ │ │ ├── RIGHT_JOIN_1.md
│ │ │ ├── RIGHT_JOIN_2.md
│ │ │ ├── SELECT.md
│ │ │ ├── SELECT_1.md
│ │ │ ├── SELECT_2.md
│ │ │ ├── SET.md
│ │ │ ├── SET_1.md
│ │ │ ├── SetCurrentClause.md
│ │ │ ├── SetCurrentClause__1.md
│ │ │ ├── SetNextClause.md
│ │ │ ├── SetNextClause__1.md
│ │ │ ├── ToString.md
│ │ │ ├── UNION.md
│ │ │ ├── UPDATE.md
│ │ │ ├── UPDATE_1.md
│ │ │ ├── VALUES.md
│ │ │ ├── VALUES_1.md
│ │ │ ├── WHERE.md
│ │ │ ├── WHERE_1.md
│ │ │ ├── WHERE_2.md
│ │ │ ├── WITH.md
│ │ │ ├── WITH_1.md
│ │ │ ├── WITH_2.md
│ │ │ ├── WITH_3.md
│ │ │ ├── _.md
│ │ │ ├── _Else.md
│ │ │ ├── _ElseIf.md
│ │ │ ├── _If.md
│ │ │ └── __1.md
│ │ ├── SqlClause/
│ │ │ ├── Instance__1.md
│ │ │ ├── Name.md
│ │ │ ├── README.md
│ │ │ ├── Separator.md
│ │ │ └── _ctor.md
│ │ ├── SqlSet/
│ │ │ ├── All.md
│ │ │ ├── AllAsync.md
│ │ │ ├── AllAsync_1.md
│ │ │ ├── All_1.md
│ │ │ ├── Any.md
│ │ │ ├── AnyAsync.md
│ │ │ ├── AnyAsync_1.md
│ │ │ ├── AnyAsync_2.md
│ │ │ ├── Any_1.md
│ │ │ ├── Any_2.md
│ │ │ ├── AsAsyncEnumerable.md
│ │ │ ├── AsEnumerable.md
│ │ │ ├── Cast.md
│ │ │ ├── Cast__1.md
│ │ │ ├── Contains.md
│ │ │ ├── ContainsAsync.md
│ │ │ ├── ContainsKey.md
│ │ │ ├── ContainsKeyAsync.md
│ │ │ ├── Count.md
│ │ │ ├── CountAsync.md
│ │ │ ├── CountAsync_1.md
│ │ │ ├── CountAsync_2.md
│ │ │ ├── Count_1.md
│ │ │ ├── Count_2.md
│ │ │ ├── Database.md
│ │ │ ├── Find.md
│ │ │ ├── FindAsync.md
│ │ │ ├── First.md
│ │ │ ├── FirstAsync.md
│ │ │ ├── FirstAsync_1.md
│ │ │ ├── FirstAsync_2.md
│ │ │ ├── FirstOrDefault.md
│ │ │ ├── FirstOrDefaultAsync.md
│ │ │ ├── FirstOrDefaultAsync_1.md
│ │ │ ├── FirstOrDefaultAsync_2.md
│ │ │ ├── FirstOrDefault_1.md
│ │ │ ├── FirstOrDefault_2.md
│ │ │ ├── First_1.md
│ │ │ ├── First_2.md
│ │ │ ├── GetAsyncEnumerator.md
│ │ │ ├── GetDefiningQuery.md
│ │ │ ├── GetEnumerator.md
│ │ │ ├── Include.md
│ │ │ ├── IncludeMany.md
│ │ │ ├── LongCount.md
│ │ │ ├── LongCountAsync.md
│ │ │ ├── LongCountAsync_1.md
│ │ │ ├── LongCountAsync_2.md
│ │ │ ├── LongCount_1.md
│ │ │ ├── LongCount_2.md
│ │ │ ├── OrderBy.md
│ │ │ ├── OrderBy_1.md
│ │ │ ├── README.md
│ │ │ ├── ResultType.md
│ │ │ ├── Select.md
│ │ │ ├── Select_1.md
│ │ │ ├── Select_2.md
│ │ │ ├── Select_3.md
│ │ │ ├── Select__1.md
│ │ │ ├── Select__1_1.md
│ │ │ ├── Select__1_2.md
│ │ │ ├── Select__1_3.md
│ │ │ ├── Single.md
│ │ │ ├── SingleAsync.md
│ │ │ ├── SingleAsync_1.md
│ │ │ ├── SingleAsync_2.md
│ │ │ ├── SingleOrDefault.md
│ │ │ ├── SingleOrDefaultAsync.md
│ │ │ ├── SingleOrDefaultAsync_1.md
│ │ │ ├── SingleOrDefaultAsync_2.md
│ │ │ ├── SingleOrDefault_1.md
│ │ │ ├── SingleOrDefault_2.md
│ │ │ ├── Single_1.md
│ │ │ ├── Single_2.md
│ │ │ ├── Skip.md
│ │ │ ├── Take.md
│ │ │ ├── ToArray.md
│ │ │ ├── ToArrayAsync.md
│ │ │ ├── ToList.md
│ │ │ ├── ToListAsync.md
│ │ │ ├── ToString.md
│ │ │ ├── Where.md
│ │ │ └── Where_1.md
│ │ ├── SqlSet_1/
│ │ │ ├── AsAsyncEnumerable.md
│ │ │ ├── AsEnumerable.md
│ │ │ ├── Contains.md
│ │ │ ├── ContainsAsync.md
│ │ │ ├── Find.md
│ │ │ ├── FindAsync.md
│ │ │ ├── First.md
│ │ │ ├── FirstAsync.md
│ │ │ ├── FirstAsync_1.md
│ │ │ ├── FirstAsync_2.md
│ │ │ ├── FirstOrDefault.md
│ │ │ ├── FirstOrDefaultAsync.md
│ │ │ ├── FirstOrDefaultAsync_1.md
│ │ │ ├── FirstOrDefaultAsync_2.md
│ │ │ ├── FirstOrDefault_1.md
│ │ │ ├── FirstOrDefault_2.md
│ │ │ ├── First_1.md
│ │ │ ├── First_2.md
│ │ │ ├── GetAsyncEnumerator.md
│ │ │ ├── GetEnumerator.md
│ │ │ ├── Include.md
│ │ │ ├── IncludeMany.md
│ │ │ ├── IncludeMany__1.md
│ │ │ ├── Include_1.md
│ │ │ ├── OrderBy.md
│ │ │ ├── OrderBy_1.md
│ │ │ ├── README.md
│ │ │ ├── Single.md
│ │ │ ├── SingleAsync.md
│ │ │ ├── SingleAsync_1.md
│ │ │ ├── SingleAsync_2.md
│ │ │ ├── SingleOrDefault.md
│ │ │ ├── SingleOrDefaultAsync.md
│ │ │ ├── SingleOrDefaultAsync_1.md
│ │ │ ├── SingleOrDefaultAsync_2.md
│ │ │ ├── SingleOrDefault_1.md
│ │ │ ├── SingleOrDefault_2.md
│ │ │ ├── Single_1.md
│ │ │ ├── Single_2.md
│ │ │ ├── Skip.md
│ │ │ ├── Take.md
│ │ │ ├── ToArray.md
│ │ │ ├── ToArrayAsync.md
│ │ │ ├── ToList.md
│ │ │ ├── ToListAsync.md
│ │ │ ├── Where.md
│ │ │ └── Where_1.md
│ │ ├── SqlTable/
│ │ │ ├── Add.md
│ │ │ ├── AddAsync.md
│ │ │ ├── AddRange.md
│ │ │ ├── AddRangeAsync.md
│ │ │ ├── AddRangeAsync_1.md
│ │ │ ├── AddRange_1.md
│ │ │ ├── Cast__1.md
│ │ │ ├── Name.md
│ │ │ ├── README.md
│ │ │ ├── Refresh.md
│ │ │ ├── RefreshAsync.md
│ │ │ ├── Remove.md
│ │ │ ├── RemoveAsync.md
│ │ │ ├── RemoveKey.md
│ │ │ ├── RemoveKeyAsync.md
│ │ │ ├── RemoveRange.md
│ │ │ ├── RemoveRangeAsync.md
│ │ │ ├── RemoveRangeAsync_1.md
│ │ │ ├── RemoveRange_1.md
│ │ │ ├── Update.md
│ │ │ ├── UpdateAsync.md
│ │ │ ├── UpdateAsync_1.md
│ │ │ ├── UpdateRange.md
│ │ │ ├── UpdateRangeAsync.md
│ │ │ ├── UpdateRangeAsync_1.md
│ │ │ ├── UpdateRange_1.md
│ │ │ └── Update_1.md
│ │ ├── SqlTable_1/
│ │ │ ├── Add.md
│ │ │ ├── AddAsync.md
│ │ │ ├── AddRange.md
│ │ │ ├── AddRangeAsync.md
│ │ │ ├── AddRangeAsync_1.md
│ │ │ ├── AddRange_1.md
│ │ │ ├── Name.md
│ │ │ ├── README.md
│ │ │ ├── Refresh.md
│ │ │ ├── RefreshAsync.md
│ │ │ ├── Remove.md
│ │ │ ├── RemoveAsync.md
│ │ │ ├── RemoveKey.md
│ │ │ ├── RemoveKeyAsync.md
│ │ │ ├── RemoveRange.md
│ │ │ ├── RemoveRangeAsync.md
│ │ │ ├── RemoveRangeAsync_1.md
│ │ │ ├── RemoveRange_1.md
│ │ │ ├── Update.md
│ │ │ ├── UpdateAsync.md
│ │ │ ├── UpdateAsync_1.md
│ │ │ ├── UpdateRange.md
│ │ │ ├── UpdateRangeAsync.md
│ │ │ ├── UpdateRangeAsync_1.md
│ │ │ ├── UpdateRange_1.md
│ │ │ └── Update_1.md
│ │ └── TableAttribute/
│ │ ├── Name.md
│ │ ├── README.md
│ │ └── _ctor.md
│ └── README.md
├── samples/
│ ├── App/
│ │ ├── App.config
│ │ ├── Northwind/
│ │ │ ├── Northwind.mdf
│ │ │ ├── Northwind.sl3
│ │ │ └── Northwind_log.ldf
│ │ ├── Program.cs
│ │ ├── Samples.App.csproj
│ │ └── Utilities/
│ │ ├── ObjectDumper-LICENSE.txt
│ │ └── ObjectDumper.cs
│ └── CSharp/
│ ├── Database.Annotated.cs
│ ├── Database.Poco.cs
│ ├── Northwind/
│ │ ├── Category.cs
│ │ ├── Customer.cs
│ │ ├── CustomerCustomerDemo.cs
│ │ ├── CustomerDemographic.cs
│ │ ├── Employee.cs
│ │ ├── EmployeeTerritory.cs
│ │ ├── NorthwindDatabase.cs
│ │ ├── Order.cs
│ │ ├── OrderDetail.cs
│ │ ├── Product.cs
│ │ ├── Region.cs
│ │ ├── Shipper.cs
│ │ ├── Supplier.cs
│ │ └── Territory.cs
│ ├── Samples.CSharp.csproj
│ ├── SqlBuilder.cs
│ └── SqlSet.cs
├── src/
│ ├── DbExtensions/
│ │ ├── .editorconfig
│ │ ├── Attributes.cs
│ │ ├── Database.cs
│ │ ├── DbExtensions.csproj
│ │ ├── DynamicMapper.cs
│ │ ├── Extensions.cs
│ │ ├── Mapper.cs
│ │ ├── Metadata/
│ │ │ ├── Accessors.cs
│ │ │ ├── AttributedMetaModel.cs
│ │ │ ├── Error.cs
│ │ │ ├── MappingSource.cs
│ │ │ ├── MappingSystem.cs
│ │ │ ├── MetaModel.cs
│ │ │ └── TypeSystem.cs
│ │ ├── PocoMapper.cs
│ │ ├── Properties/
│ │ │ └── AssemblyInfo.cs
│ │ ├── SqlBuilder.cs
│ │ ├── SqlSet.Async.cs
│ │ ├── SqlSet.cs
│ │ ├── SqlTable.Async.cs
│ │ ├── SqlTable.SqlSet.cs
│ │ └── SqlTable.cs
│ ├── DbExtensions-QE/
│ │ ├── DbExtensions-QE.csproj
│ │ └── README.md
│ ├── DbExtensions.SqlBuilder/
│ │ ├── DbExtensions.SqlBuilder.csproj
│ │ └── README.md
│ └── DbExtensions.SqlSet/
│ ├── DbExtensions.SqlSet.csproj
│ └── README.md
└── tests/
└── DbExtensions.Tests/
├── DbExtensions.Tests.csproj
├── Mapping/
│ ├── DynamicMappingBehavior.cs
│ ├── EnumMappingBehavior.cs
│ ├── PersistentComplexPropertiesBehavior.cs
│ ├── PocoMappingBehavior.cs
│ ├── PocoMappingConstructorBehavior.cs
│ └── PocoMappingEnumBehavior.cs
├── Metadata/
│ └── AssociationReflection.cs
├── Querying/
│ ├── SqlBuilderBehavior/
│ │ ├── BasicTests.cs
│ │ ├── ConditionalAppendTests.cs
│ │ ├── ConditionalClauseTests.cs
│ │ ├── ExtensibilityTests.cs
│ │ └── ValuesClauseTests.cs
│ ├── SqlSetAnnotatedBehavior/
│ │ ├── BasicTests.cs
│ │ └── IncludeTests.cs
│ ├── SqlSetAsyncBehavior.cs
│ ├── SqlSetBehavior.cs
│ ├── SqlSetBehaviorForSqlServer.cs
│ └── SqlTableBehavior.cs
└── TestUtil.cs
================================================
FILE CONTENTS
================================================
================================================
FILE: .gitattributes
================================================
# Auto detect text files and perform LF normalization
* text=auto
# Custom for Visual Studio
*.cs diff=csharp
*.sln merge=union
*.csproj merge=union
*.vbproj merge=union
*.fsproj merge=union
*.dbproj merge=union
# Standard to msysgit
*.doc diff=astextplain
*.DOC diff=astextplain
*.docx diff=astextplain
*.DOCX diff=astextplain
*.dot diff=astextplain
*.DOT diff=astextplain
*.pdf diff=astextplain
*.PDF diff=astextplain
*.rtf diff=astextplain
*.RTF diff=astextplain
================================================
FILE: .github/FUNDING.yml
================================================
# These are supported funding model platforms
github: maxtoroq
================================================
FILE: .gitignore
================================================
/.vs/
/.nuget/
/packages/
/docs/api/_toc.xml
[Bb]in
[Oo]bj
[Tt]est[Rr]esults
*.suo
*.user
================================================
FILE: .gitmodules
================================================
[submodule "build/sandcastle-md"]
path = build/sandcastle-md
url = https://github.com/maxtoroq/sandcastle-md.git
================================================
FILE: CHANGES.md
================================================
This page has moved [here](https://maxtoroq.github.io/DbExtensions/docs/7/changes.html).
================================================
FILE: DbExtensions.sln
================================================
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.11.35222.181
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DbExtensions", "src\DbExtensions\DbExtensions.csproj", "{0C0CB7A6-FDBA-49A0-8FA9-A35EFFFDE34D}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{0CD55BAA-00D6-4D14-AF01-B2ECC3F8E092}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{CDC6A939-6F5A-4CF5-ABDB-A2F87513A769}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DbExtensions.Tests", "tests\DbExtensions.Tests\DbExtensions.Tests.csproj", "{ABB8412B-D292-4393-BB6D-F0241C41D198}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "samples", "samples", "{A1718337-F793-499A-A4D1-5A6CF5F265DA}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Samples.CSharp", "samples\CSharp\Samples.CSharp.csproj", "{CC01AB1C-A3CD-4E56-9AF0-8E4FD2000CE0}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Samples.App", "samples\App\Samples.App.csproj", "{0ECA5137-1C9A-46BB-B5EB-ED87F0678FB4}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DbExtensions.SqlBuilder", "src\DbExtensions.SqlBuilder\DbExtensions.SqlBuilder.csproj", "{07B53903-2EB1-4E69-98A2-84069197ADB2}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DbExtensions.SqlSet", "src\DbExtensions.SqlSet\DbExtensions.SqlSet.csproj", "{75C3AEF3-213C-494A-97FA-D4DCA76FA94A}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DbExtensions-QE", "src\DbExtensions-QE\DbExtensions-QE.csproj", "{731E7958-87D2-4C2F-9D59-6308D1553F53}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{0C0CB7A6-FDBA-49A0-8FA9-A35EFFFDE34D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0C0CB7A6-FDBA-49A0-8FA9-A35EFFFDE34D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0C0CB7A6-FDBA-49A0-8FA9-A35EFFFDE34D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0C0CB7A6-FDBA-49A0-8FA9-A35EFFFDE34D}.Release|Any CPU.Build.0 = Release|Any CPU
{ABB8412B-D292-4393-BB6D-F0241C41D198}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{ABB8412B-D292-4393-BB6D-F0241C41D198}.Debug|Any CPU.Build.0 = Debug|Any CPU
{ABB8412B-D292-4393-BB6D-F0241C41D198}.Release|Any CPU.ActiveCfg = Release|Any CPU
{ABB8412B-D292-4393-BB6D-F0241C41D198}.Release|Any CPU.Build.0 = Release|Any CPU
{CC01AB1C-A3CD-4E56-9AF0-8E4FD2000CE0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{CC01AB1C-A3CD-4E56-9AF0-8E4FD2000CE0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CC01AB1C-A3CD-4E56-9AF0-8E4FD2000CE0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{CC01AB1C-A3CD-4E56-9AF0-8E4FD2000CE0}.Release|Any CPU.Build.0 = Release|Any CPU
{0ECA5137-1C9A-46BB-B5EB-ED87F0678FB4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0ECA5137-1C9A-46BB-B5EB-ED87F0678FB4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0ECA5137-1C9A-46BB-B5EB-ED87F0678FB4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0ECA5137-1C9A-46BB-B5EB-ED87F0678FB4}.Release|Any CPU.Build.0 = Release|Any CPU
{07B53903-2EB1-4E69-98A2-84069197ADB2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{07B53903-2EB1-4E69-98A2-84069197ADB2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{07B53903-2EB1-4E69-98A2-84069197ADB2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{07B53903-2EB1-4E69-98A2-84069197ADB2}.Release|Any CPU.Build.0 = Release|Any CPU
{75C3AEF3-213C-494A-97FA-D4DCA76FA94A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{75C3AEF3-213C-494A-97FA-D4DCA76FA94A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{75C3AEF3-213C-494A-97FA-D4DCA76FA94A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{75C3AEF3-213C-494A-97FA-D4DCA76FA94A}.Release|Any CPU.Build.0 = Release|Any CPU
{731E7958-87D2-4C2F-9D59-6308D1553F53}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{731E7958-87D2-4C2F-9D59-6308D1553F53}.Debug|Any CPU.Build.0 = Debug|Any CPU
{731E7958-87D2-4C2F-9D59-6308D1553F53}.Release|Any CPU.ActiveCfg = Release|Any CPU
{731E7958-87D2-4C2F-9D59-6308D1553F53}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{0C0CB7A6-FDBA-49A0-8FA9-A35EFFFDE34D} = {0CD55BAA-00D6-4D14-AF01-B2ECC3F8E092}
{ABB8412B-D292-4393-BB6D-F0241C41D198} = {CDC6A939-6F5A-4CF5-ABDB-A2F87513A769}
{CC01AB1C-A3CD-4E56-9AF0-8E4FD2000CE0} = {A1718337-F793-499A-A4D1-5A6CF5F265DA}
{0ECA5137-1C9A-46BB-B5EB-ED87F0678FB4} = {A1718337-F793-499A-A4D1-5A6CF5F265DA}
{07B53903-2EB1-4E69-98A2-84069197ADB2} = {0CD55BAA-00D6-4D14-AF01-B2ECC3F8E092}
{75C3AEF3-213C-494A-97FA-D4DCA76FA94A} = {0CD55BAA-00D6-4D14-AF01-B2ECC3F8E092}
{731E7958-87D2-4C2F-9D59-6308D1553F53} = {0CD55BAA-00D6-4D14-AF01-B2ECC3F8E092}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {96FE150F-41AE-4AB7-AA87-2B8D278F1FF3}
EndGlobalSection
EndGlobal
================================================
FILE: LICENSE.txt
================================================
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
================================================
FILE: NOTICE.xml
================================================
DbExtensions
https://maxtoroq.github.io/DbExtensions/
2009-2025 Max Toro Q.
Max Toro Q.
.NET Framework
https://github.com/Microsoft/referencesource
Microsoft Corporation
================================================
FILE: README.md
================================================
[DbExtensions][1] — The SQL framework for .NET
==============================================
DbExtensions is a data-access framework with a strong focus on **query composition, granularity and code aesthetics**. It supports both POCO and dynamic (untyped) mapping.
See the [project home][1] and the [documentation][2] for more information.
[](https://ci.appveyor.com/project/maxtoroq/dbextensions/branch/v7)

[1]: https://maxtoroq.github.io/DbExtensions/
[2]: https://maxtoroq.github.io/DbExtensions/docs/7/
================================================
FILE: appveyor.yml
================================================
image: Visual Studio 2022
before_build:
- cmd: MSBuild -t:restore
version: '{build}'
build:
verbosity: minimal
================================================
FILE: build/.gitignore
================================================
/api-docs/
/EWSoftware.SHFB/
/EWSoftware.SHFB.*/
/nupkg/
================================================
FILE: build/DbExtensions.shfbproj
================================================
$(MSBuildThisFileDirectory)\EWSoftware.SHFB\tools\
Debug
AnyCPU
2.0
{e4c3bd2c-c9c8-4484-bc16-0d4a5f6dfcd3}
2017.9.26.0
Documentation
Documentation
Documentation
api-docs\html\
Documentation
en-US
Website
False
DbExtensions
MemberName
Top
C#
False
DbExtensions
DbExtensions is a data-access framework with a strong focus on query composition, granularity and code aesthetics. <see cref="T:DbExtensions.Database"/> is the entry point of the <see cref="N:DbExtensions"/> API.
True
VS2013
False
AboveNamespaces
OnlyWarningsAndErrors
False
.NET Core/.NET Standard/.NET 5.0+
False
False
False
AutoDocumentCtors, AutoDocumentDispose
2
False
DbExtensions Namespaces
InheritedMembers, Protected, SealedProtected, NonBrowsable
================================================
FILE: build/build-docs.ps1
================================================
param([string]$ProjectName = "DbExtensions", [switch]$NoBuildProj, [switch]$XmlOnly)
$ErrorActionPreference = "Stop"
Push-Location (Split-Path $script:MyInvocation.MyCommand.Path)
try {
$nuget = .\ensure-nuget.ps1
if (-not (Test-Path EWSoftware.SHFB -PathType Container)) {
&$nuget install EWSoftware.SHFB -Version 2025.3.22 -ExcludeVersion
}
if (-not (Test-Path EWSoftware.SHFB.NET -PathType Container)) {
&$nuget install EWSoftware.SHFB.NET -Version 5.0.0.2 -ExcludeVersion
}
if (-not $NoBuildProj) {
MSBuild ..\src\$ProjectName\$ProjectName.csproj /v:minimal /p:Configuration=Release
}
MSBuild DbExtensions.shfbproj /v:minimal /p:ProjectName=$ProjectName
if (-not $XmlOnly) {
.\sandcastle-md\packages\restore.ps1
MSBuild sandcastle-md\sandcastle-md.sln /v:minimal
if (Test-Path ..\docs\api -PathType Container) {
rm ..\docs\api -Recurse
}
sandcastle-md\src\sandcastle-md\bin\Debug\sandcastle-md.exe api-docs\html ..\docs\api `
--remove-assembly-name `
--remove-assembly-version `
--exclude-icons
}
} finally {
Pop-Location
}
================================================
FILE: build/ensure-nuget.ps1
================================================
$ErrorActionPreference = "Stop"
Push-Location (Split-Path $script:MyInvocation.MyCommand.Path)
$nuget = "..\.nuget\nuget.exe"
try {
$nugetDir = Split-Path $nuget
if (-not (Test-Path $nugetDir -PathType Container)) {
md $nugetDir | Out-Null
}
if (-not (Test-Path $nuget -PathType Leaf)) {
Write-Host "Downloading NuGet..."
Invoke-WebRequest https://dist.nuget.org/win-x86-commandline/latest/nuget.exe -OutFile $nuget
}
Resolve-Path $nuget
} finally {
Pop-Location
}
================================================
FILE: build/release.ps1
================================================
param(
[Parameter(Mandatory=$true)][Version]$AssemblyVersion,
[Parameter(Mandatory=$true)][Version]$PackageVersion,
[Parameter()][string]$PreRelease
)
$ErrorActionPreference = "Stop"
Push-Location (Split-Path $script:MyInvocation.MyCommand.Path)
$solutionPath = Resolve-Path ..
$configuration = "Release"
function ProjectPath([string]$projName) {
Resolve-Path $solutionPath\src\$projName
}
function ProjectFile([string]$projName) {
$projPath = ProjectPath $projName
return "$projPath\$projName.csproj"
}
function BuildProj([string]$projName, [string]$target) {
$pack = $target -eq "Pack"
MSBuild $(ProjectFile($projName)) /t:$target /v:minimal `
/p:NoBuild=$pack `
/p:Configuration=$configuration `
/p:PackageOutputPath=$outputPath `
/p:AssemblyVersion=$AssemblyVersion `
/p:FileVersion=$PackageVersion `
/p:VersionPrefix=$PackageVersion `
/p:VersionSuffix=$PreRelease `
/p:ContinuousIntegrationBuild=true `
/p:GenerateDocumentationFile=$(-not $pack) `
/p:Authors=$($notice.authors) `
/p:Product=$($notice.work) `
/p:Copyright=$($notice.copyright) `
/p:Company=$($notice.website) `
/p:PackageLicenseExpression=$($notice.license.name) `
/p:PackageProjectUrl=$($notice.website) `
/p:PackageReleaseNotes="For a list of changes see $($notice.website)docs/7/changes.html" `
/p:RepositoryBranch=$(git branch --show-current)
}
function NuPack([string]$projName) {
BuildProj $projName "Build" | Out-Host
.\build-docs.ps1 -ProjectName $projName -NoBuildProj -XmlOnly | Out-Host
BuildProj $projName "Pack" | Out-Host
return Join-Path $outputPath "$projName.$pkgVer.nupkg"
}
function Prompt-Choices($Choices=("&Yes", "&No"), [string]$Title="Confirm", [string]$Message="Are you sure?", [int]$Default=0) {
$choicesArr = [Management.Automation.Host.ChoiceDescription[]] `
($Choices | % {New-Object Management.Automation.Host.ChoiceDescription $_})
return $host.ui.PromptForChoice($Title, $Message, $choicesArr, $Default)
}
try {
[xml]$noticeDoc = Get-Content $solutionPath\NOTICE.xml
$notice = $noticeDoc.DocumentElement
if (-not (Test-Path nupkg -PathType Container)) {
md nupkg | Out-Null
}
$outputPath = Resolve-Path nupkg
$pkgVer = $PackageVersion.ToString(3)
if ($PreRelease) {
$pkgVer = $pkgVer + "-" + $PreRelease
}
$newTag = "v$pkgVer"
MSBuild $solutionPath\DbExtensions.sln -t:Restore
$newPackages = (NuPack DbExtensions), (NuPack DbExtensions-QE)
if ((Prompt-Choices -Message "Create tag $newTag ?" -Default 1) -eq 0) {
git tag -a $newTag -m $newTag
Write-Warning "Created tag: $newTag"
if ((Prompt-Choices -Message "Push package(s) to gallery?" -Default 1) -eq 0) {
foreach ($pkgPath in $newPackages) {
dotnet nuget push $pkgPath --source nuget.org
}
}
if ((Prompt-Choices -Message "Push new tag $newTag to origin?" -Default 1) -eq 0) {
git push origin $newTag
}
}
} finally {
Pop-Location
}
================================================
FILE: docs/README.md
================================================
Documentation has moved [here](https://maxtoroq.github.io/DbExtensions/docs/7/).
================================================
FILE: docs/SqlBuilder.md
================================================
This page has moved [here](https://maxtoroq.github.io/DbExtensions/docs/7/SqlBuilder.html).
================================================
FILE: docs/SqlSet.md
================================================
This page has moved [here](https://maxtoroq.github.io/DbExtensions/docs/7/SqlSet.html).
================================================
FILE: docs/api/DbExtensions/AssociationAttribute/Name.md
================================================
AssociationAttribute.Name Property
==================================
Gets or sets the name of a constraint.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public string? Name { get; set; }
```
#### Property Value
[String][2]
See Also
--------
#### Reference
[AssociationAttribute Class][3]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: https://learn.microsoft.com/dotnet/api/system.string
[3]: README.md
================================================
FILE: docs/api/DbExtensions/AssociationAttribute/OtherKey.md
================================================
AssociationAttribute.OtherKey Property
======================================
Gets or sets one or more members of the target entity class as key values on the other side of the association.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public string? OtherKey { get; set; }
```
#### Property Value
[String][2]
See Also
--------
#### Reference
[AssociationAttribute Class][3]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: https://learn.microsoft.com/dotnet/api/system.string
[3]: README.md
================================================
FILE: docs/api/DbExtensions/AssociationAttribute/README.md
================================================
AssociationAttribute Class
==========================
Designates a property to represent a database association, such as a foreign key relationship.
Inheritance Hierarchy
---------------------
[System.Object][1]
[System.Attribute][2]
**DbExtensions.AssociationAttribute**
**Namespace:** [DbExtensions][3]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public sealed class AssociationAttribute : Attribute
```
The **AssociationAttribute** type exposes the following members.
Constructors
------------
| Name | Description |
| ------------------------- | ---------------------------------------------------------------- |
| [AssociationAttribute][4] | Initializes a new instance of the **AssociationAttribute** class |
Properties
----------
| Name | Description |
| ------------- | --------------------------------------------------------------------------------------------------------------- |
| [Name][5] | Gets or sets the name of a constraint. |
| [OtherKey][6] | Gets or sets one or more members of the target entity class as key values on the other side of the association. |
| [ThisKey][7] | Gets or sets members of this entity class to represent the key values on this side of the association. |
See Also
--------
#### Reference
[DbExtensions Namespace][3]
[1]: https://learn.microsoft.com/dotnet/api/system.object
[2]: https://learn.microsoft.com/dotnet/api/system.attribute
[3]: ../README.md
[4]: _ctor.md
[5]: Name.md
[6]: OtherKey.md
[7]: ThisKey.md
================================================
FILE: docs/api/DbExtensions/AssociationAttribute/ThisKey.md
================================================
AssociationAttribute.ThisKey Property
=====================================
Gets or sets members of this entity class to represent the key values on this side of the association.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public string? ThisKey { get; set; }
```
#### Property Value
[String][2]
See Also
--------
#### Reference
[AssociationAttribute Class][3]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: https://learn.microsoft.com/dotnet/api/system.string
[3]: README.md
================================================
FILE: docs/api/DbExtensions/AssociationAttribute/_ctor.md
================================================
AssociationAttribute Constructor
================================
Initializes a new instance of the [AssociationAttribute][1] class
**Namespace:** [DbExtensions][2]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public AssociationAttribute()
```
See Also
--------
#### Reference
[AssociationAttribute Class][1]
[DbExtensions Namespace][2]
[1]: README.md
[2]: ../README.md
================================================
FILE: docs/api/DbExtensions/AutoSync/README.md
================================================
AutoSync Enumeration
====================
Used to specify for during INSERT and UPDATE operations when a data member should be read back after the operation completes.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public enum AutoSync
```
Members
-------
| Member name | Value | Description |
| ----------- | ----- | ------------------------------------------------- |
| Default | 0 | Automatically selects the value. |
| Always | 1 | Always returns the value. |
| Never | 2 | Never returns the value. |
| OnInsert | 3 | Returns the value only after an INSERT operation. |
| OnUpdate | 4 | Returns the value only after an UPDATE operation. |
See Also
--------
#### Reference
[DbExtensions Namespace][1]
[1]: ../README.md
================================================
FILE: docs/api/DbExtensions/ChangeConflictException/README.md
================================================
ChangeConflictException Class
=============================
An exception that is thrown when a concurrency violation is encountered while saving to the database. A concurrency violation occurs when an unexpected number of rows are affected during save. This is usually because the data in the database has been modified since it was loaded into memory.
Inheritance Hierarchy
---------------------
[System.Object][1]
[System.Exception][2]
**DbExtensions.ChangeConflictException**
**Namespace:** [DbExtensions][3]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public sealed class ChangeConflictException : Exception
```
The **ChangeConflictException** type exposes the following members.
Constructors
------------
| Name | Description |
| ---------------------------- | --------------------------------------------------------------------------------------------------- |
| [ChangeConflictException][4] | Initializes a new instance of the **ChangeConflictException** class with a specified error message. |
See Also
--------
#### Reference
[DbExtensions Namespace][3]
[1]: https://learn.microsoft.com/dotnet/api/system.object
[2]: https://learn.microsoft.com/dotnet/api/system.exception
[3]: ../README.md
[4]: _ctor.md
================================================
FILE: docs/api/DbExtensions/ChangeConflictException/_ctor.md
================================================
ChangeConflictException Constructor
===================================
Initializes a new instance of the [ChangeConflictException][1] class with a specified error message.
**Namespace:** [DbExtensions][2]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public ChangeConflictException(
string message
)
```
#### Parameters
##### *message* [String][3]
The message that describes the error.
See Also
--------
#### Reference
[ChangeConflictException Class][1]
[DbExtensions Namespace][2]
[1]: README.md
[2]: ../README.md
[3]: https://learn.microsoft.com/dotnet/api/system.string
================================================
FILE: docs/api/DbExtensions/ColumnAttribute/AutoSync.md
================================================
ColumnAttribute.AutoSync Property
=================================
Gets or sets the [AutoSync][1] enumeration.
**Namespace:** [DbExtensions][2]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public AutoSync AutoSync { get; set; }
```
#### Property Value
[AutoSync][1]
See Also
--------
#### Reference
[ColumnAttribute Class][3]
[DbExtensions Namespace][2]
[1]: ../AutoSync/README.md
[2]: ../README.md
[3]: README.md
================================================
FILE: docs/api/DbExtensions/ColumnAttribute/ConvertTo.md
================================================
ColumnAttribute.ConvertTo Property
==================================
Gets or sets the type to convert this member to before sending to the database.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public Type? ConvertTo { get; set; }
```
#### Property Value
[Type][2]
See Also
--------
#### Reference
[ColumnAttribute Class][3]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: https://learn.microsoft.com/dotnet/api/system.type
[3]: README.md
================================================
FILE: docs/api/DbExtensions/ColumnAttribute/IsDbGenerated.md
================================================
ColumnAttribute.IsDbGenerated Property
======================================
Gets or sets whether a column contains values that the database auto-generates.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public bool IsDbGenerated { get; set; }
```
#### Property Value
[Boolean][2]
See Also
--------
#### Reference
[ColumnAttribute Class][3]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: https://learn.microsoft.com/dotnet/api/system.boolean
[3]: README.md
================================================
FILE: docs/api/DbExtensions/ColumnAttribute/IsPrimaryKey.md
================================================
ColumnAttribute.IsPrimaryKey Property
=====================================
Gets or sets whether this class member represents a column that is part or all of the primary key of the table.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public bool IsPrimaryKey { get; set; }
```
#### Property Value
[Boolean][2]
See Also
--------
#### Reference
[ColumnAttribute Class][3]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: https://learn.microsoft.com/dotnet/api/system.boolean
[3]: README.md
================================================
FILE: docs/api/DbExtensions/ColumnAttribute/IsVersion.md
================================================
ColumnAttribute.IsVersion Property
==================================
Gets or sets whether the column type of the member is a database timestamp or version number.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public bool IsVersion { get; set; }
```
#### Property Value
[Boolean][2]
See Also
--------
#### Reference
[ColumnAttribute Class][3]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: https://learn.microsoft.com/dotnet/api/system.boolean
[3]: README.md
================================================
FILE: docs/api/DbExtensions/ColumnAttribute/Name.md
================================================
ColumnAttribute.Name Property
=============================
Gets or sets the name of a column.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public string? Name { get; set; }
```
#### Property Value
[String][2]
See Also
--------
#### Reference
[ColumnAttribute Class][3]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: https://learn.microsoft.com/dotnet/api/system.string
[3]: README.md
================================================
FILE: docs/api/DbExtensions/ColumnAttribute/README.md
================================================
ColumnAttribute Class
=====================
Associates a property with a column in a database table.
Inheritance Hierarchy
---------------------
[System.Object][1]
[System.Attribute][2]
**DbExtensions.ColumnAttribute**
**Namespace:** [DbExtensions][3]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public sealed class ColumnAttribute : Attribute
```
The **ColumnAttribute** type exposes the following members.
Constructors
------------
| Name | Description |
| -------------------- | ----------------------------------------------------------- |
| [ColumnAttribute][4] | Initializes a new instance of the **ColumnAttribute** class |
Properties
----------
| Name | Description |
| ------------------ | --------------------------------------------------------------------------------------------------------------- |
| [AutoSync][5] | Gets or sets the [AutoSync][6] enumeration. |
| [ConvertTo][7] | Gets or sets the type to convert this member to before sending to the database. |
| [IsDbGenerated][8] | Gets or sets whether a column contains values that the database auto-generates. |
| [IsPrimaryKey][9] | Gets or sets whether this class member represents a column that is part or all of the primary key of the table. |
| [IsVersion][10] | Gets or sets whether the column type of the member is a database timestamp or version number. |
| [Name][11] | Gets or sets the name of a column. |
See Also
--------
#### Reference
[DbExtensions Namespace][3]
[1]: https://learn.microsoft.com/dotnet/api/system.object
[2]: https://learn.microsoft.com/dotnet/api/system.attribute
[3]: ../README.md
[4]: _ctor.md
[5]: AutoSync.md
[6]: ../AutoSync/README.md
[7]: ConvertTo.md
[8]: IsDbGenerated.md
[9]: IsPrimaryKey.md
[10]: IsVersion.md
[11]: Name.md
================================================
FILE: docs/api/DbExtensions/ColumnAttribute/_ctor.md
================================================
ColumnAttribute Constructor
===========================
Initializes a new instance of the [ColumnAttribute][1] class
**Namespace:** [DbExtensions][2]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public ColumnAttribute()
```
See Also
--------
#### Reference
[ColumnAttribute Class][1]
[DbExtensions Namespace][2]
[1]: README.md
[2]: ../README.md
================================================
FILE: docs/api/DbExtensions/ComplexPropertyAttribute/Name.md
================================================
ComplexPropertyAttribute.Name Property
======================================
The base name for the columns on the complex property. The default is the property name.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public string? Name { get; set; }
```
#### Property Value
[String][2]
See Also
--------
#### Reference
[ComplexPropertyAttribute Class][3]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: https://learn.microsoft.com/dotnet/api/system.string
[3]: README.md
================================================
FILE: docs/api/DbExtensions/ComplexPropertyAttribute/README.md
================================================
ComplexPropertyAttribute Class
==============================
Designates a property as a complex property that groups columns of a table that share the same base name.
Inheritance Hierarchy
---------------------
[System.Object][1]
[System.Attribute][2]
**DbExtensions.ComplexPropertyAttribute**
**Namespace:** [DbExtensions][3]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public sealed class ComplexPropertyAttribute : Attribute
```
The **ComplexPropertyAttribute** type exposes the following members.
Constructors
------------
| Name | Description |
| ----------------------------- | -------------------------------------------------------------------- |
| [ComplexPropertyAttribute][4] | Initializes a new instance of the **ComplexPropertyAttribute** class |
Properties
----------
| Name | Description |
| -------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [Name][5] | The base name for the columns on the complex property. The default is the property name. |
| [Separator][6] | The separator to use between the base name and the complex property's columns. The default is null, which means the separator is taken from [DatabaseConfiguration.DefaultComplexPropertySeparator][7]. To use no separator and override the default configuration, use an empty [String][8]. |
See Also
--------
#### Reference
[DbExtensions Namespace][3]
[1]: https://learn.microsoft.com/dotnet/api/system.object
[2]: https://learn.microsoft.com/dotnet/api/system.attribute
[3]: ../README.md
[4]: _ctor.md
[5]: Name.md
[6]: Separator.md
[7]: ../DatabaseConfiguration/DefaultComplexPropertySeparator.md
[8]: https://learn.microsoft.com/dotnet/api/system.string
================================================
FILE: docs/api/DbExtensions/ComplexPropertyAttribute/Separator.md
================================================
ComplexPropertyAttribute.Separator Property
===========================================
The separator to use between the base name and the complex property's columns. The default is null, which means the separator is taken from [DatabaseConfiguration.DefaultComplexPropertySeparator][1]. To use no separator and override the default configuration, use an empty [String][2].
**Namespace:** [DbExtensions][3]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public string? Separator { get; set; }
```
#### Property Value
[String][2]
See Also
--------
#### Reference
[ComplexPropertyAttribute Class][4]
[DbExtensions Namespace][3]
[1]: ../DatabaseConfiguration/DefaultComplexPropertySeparator.md
[2]: https://learn.microsoft.com/dotnet/api/system.string
[3]: ../README.md
[4]: README.md
================================================
FILE: docs/api/DbExtensions/ComplexPropertyAttribute/_ctor.md
================================================
ComplexPropertyAttribute Constructor
====================================
Initializes a new instance of the [ComplexPropertyAttribute][1] class
**Namespace:** [DbExtensions][2]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public ComplexPropertyAttribute()
```
See Also
--------
#### Reference
[ComplexPropertyAttribute Class][1]
[DbExtensions Namespace][2]
[1]: README.md
[2]: ../README.md
================================================
FILE: docs/api/DbExtensions/Database/Add.md
================================================
Database.Add Method
===================
Recursively executes INSERT commands for the specified *entity* and all its one-to-one and one-to-many associations.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public void Add(
Object entity
)
```
#### Parameters
##### *entity* [Object][2]
The object whose INSERT command is to be executed. This parameter is named entity for consistency with the other CRUD methods, but in this case it doesn't need to be an actual entity, which means it doesn't need to have a primary key.
Remarks
-------
This method is a shortcut for `db.Table(entity.GetType()).Add(entity)`.
See Also
--------
#### Reference
[Database Class][3]
[DbExtensions Namespace][1]
[SqlTable.Add(Object)][4]
[1]: ../README.md
[2]: https://learn.microsoft.com/dotnet/api/system.object
[3]: README.md
[4]: ../SqlTable/Add.md
================================================
FILE: docs/api/DbExtensions/Database/AddAsync.md
================================================
Database.AddAsync Method
========================
Recursively executes INSERT commands for the specified *entity* and all its one-to-one and one-to-many associations.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public ValueTask AddAsync(
Object entity,
CancellationToken cancellationToken = default
)
```
#### Parameters
##### *entity* [Object][2]
The object whose INSERT command is to be executed. This parameter is named entity for consistency with the other CRUD methods, but in this case it doesn't need to be an actual entity, which means it doesn't need to have a primary key.
##### *cancellationToken* [CancellationToken][3] (Optional)
The [CancellationToken][3] to monitor for cancellation requests. The default is [None][4].
#### Return Value
[ValueTask][5]
Remarks
-------
This method is a shortcut for `await db.Table(entity.GetType()).AddAsync(entity, cancellationToken)`.
See Also
--------
#### Reference
[Database Class][6]
[DbExtensions Namespace][1]
[SqlTable.AddAsync(Object, CancellationToken)][7]
[1]: ../README.md
[2]: https://learn.microsoft.com/dotnet/api/system.object
[3]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken
[4]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken.none
[5]: https://learn.microsoft.com/dotnet/api/system.threading.tasks.valuetask
[6]: README.md
[7]: ../SqlTable/AddAsync.md
================================================
FILE: docs/api/DbExtensions/Database/AsyncMap.md
================================================
Database.AsyncMap(SqlBuilder) Method
====================================
Maps the results of the *query* to dynamic objects. The query is deferred-executed.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| --------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- |
| **AsyncMap(SqlBuilder)** | Maps the results of the *query* to dynamic objects. The query is deferred-executed. |
| [AsyncMap(SqlBuilder, Type)][2] | Maps the results of the *query* to objects of type specified by the *resultType* parameter. The query is deferred-executed. |
| [AsyncMap<TResult>(SqlBuilder)][3] | Maps the results of the *query* to TResult objects. The query is deferred-executed. |
| [AsyncMap<TResult>(SqlBuilder, Func<DbDataReader, TResult>)][4] | Maps the results of the *query* to TResult objects, using the provided *mapper* delegate. |
Syntax
------
```csharp
public IAsyncEnumerable AsyncMap(
SqlBuilder query
)
```
#### Parameters
##### *query* [SqlBuilder][5]
The query.
#### Return Value
[IAsyncEnumerable][6]<[Object][7]>
The results of the query as dynamic objects.
See Also
--------
#### Reference
[Database Class][8]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: AsyncMap_1.md
[3]: AsyncMap__1.md
[4]: AsyncMap__1_1.md
[5]: ../SqlBuilder/README.md
[6]: https://learn.microsoft.com/dotnet/api/system.collections.generic.iasyncenumerable-1
[7]: https://learn.microsoft.com/dotnet/api/system.object
[8]: README.md
================================================
FILE: docs/api/DbExtensions/Database/AsyncMap_1.md
================================================
Database.AsyncMap(SqlBuilder, Type) Method
==========================================
Maps the results of the *query* to objects of type specified by the *resultType* parameter. The query is deferred-executed.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| --------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- |
| [AsyncMap(SqlBuilder)][2] | Maps the results of the *query* to dynamic objects. The query is deferred-executed. |
| **AsyncMap(SqlBuilder, Type)** | Maps the results of the *query* to objects of type specified by the *resultType* parameter. The query is deferred-executed. |
| [AsyncMap<TResult>(SqlBuilder)][3] | Maps the results of the *query* to TResult objects. The query is deferred-executed. |
| [AsyncMap<TResult>(SqlBuilder, Func<DbDataReader, TResult>)][4] | Maps the results of the *query* to TResult objects, using the provided *mapper* delegate. |
Syntax
------
```csharp
public IAsyncEnumerable AsyncMap(
SqlBuilder query,
Type resultType
)
```
#### Parameters
##### *query* [SqlBuilder][5]
The query.
##### *resultType* [Type][6]
The type of objects to map the results to.
#### Return Value
[IAsyncEnumerable][7]<[Object][8]>
The results of the query as objects of type specified by the *resultType* parameter.
See Also
--------
#### Reference
[Database Class][9]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: AsyncMap.md
[3]: AsyncMap__1.md
[4]: AsyncMap__1_1.md
[5]: ../SqlBuilder/README.md
[6]: https://learn.microsoft.com/dotnet/api/system.type
[7]: https://learn.microsoft.com/dotnet/api/system.collections.generic.iasyncenumerable-1
[8]: https://learn.microsoft.com/dotnet/api/system.object
[9]: README.md
================================================
FILE: docs/api/DbExtensions/Database/AsyncMap__1.md
================================================
Database.AsyncMap<TResult>(SqlBuilder) Method
================================================
Maps the results of the *query* to TResult objects. The query is deferred-executed.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| --------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- |
| [AsyncMap(SqlBuilder)][2] | Maps the results of the *query* to dynamic objects. The query is deferred-executed. |
| [AsyncMap(SqlBuilder, Type)][3] | Maps the results of the *query* to objects of type specified by the *resultType* parameter. The query is deferred-executed. |
| **AsyncMap<TResult>(SqlBuilder)** | Maps the results of the *query* to TResult objects. The query is deferred-executed. |
| [AsyncMap<TResult>(SqlBuilder, Func<DbDataReader, TResult>)][4] | Maps the results of the *query* to TResult objects, using the provided *mapper* delegate. |
Syntax
------
```csharp
public IAsyncEnumerable AsyncMap(
SqlBuilder query
)
```
#### Parameters
##### *query* [SqlBuilder][5]
The query.
#### Type Parameters
##### *TResult*
The type of objects to map the results to.
#### Return Value
[IAsyncEnumerable][6]<**TResult**>
The results of the query as TResult objects.
See Also
--------
#### Reference
[Database Class][7]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: AsyncMap.md
[3]: AsyncMap_1.md
[4]: AsyncMap__1_1.md
[5]: ../SqlBuilder/README.md
[6]: https://learn.microsoft.com/dotnet/api/system.collections.generic.iasyncenumerable-1
[7]: README.md
================================================
FILE: docs/api/DbExtensions/Database/AsyncMap__1_1.md
================================================
Database.AsyncMap<TResult>(SqlBuilder, Func<DbDataReader, TResult>) Method
================================================================================
Maps the results of the *query* to TResult objects, using the provided *mapper* delegate.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| -------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- |
| [AsyncMap(SqlBuilder)][2] | Maps the results of the *query* to dynamic objects. The query is deferred-executed. |
| [AsyncMap(SqlBuilder, Type)][3] | Maps the results of the *query* to objects of type specified by the *resultType* parameter. The query is deferred-executed. |
| [AsyncMap<TResult>(SqlBuilder)][4] | Maps the results of the *query* to TResult objects. The query is deferred-executed. |
| **AsyncMap<TResult>(SqlBuilder, Func<DbDataReader, TResult>)** | Maps the results of the *query* to TResult objects, using the provided *mapper* delegate. |
Syntax
------
```csharp
public IAsyncEnumerable AsyncMap(
SqlBuilder query,
Func mapper
)
```
#### Parameters
##### *query* [SqlBuilder][5]
The query.
##### *mapper* [Func][6]<[DbDataReader][7], **TResult**>
The delegate for creating TResult objects from an [DbDataReader][7] object.
#### Type Parameters
##### *TResult*
The type of objects to map the results to.
#### Return Value
[IAsyncEnumerable][8]<**TResult**>
The results of the query as TResult objects.
See Also
--------
#### Reference
[Database Class][9]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: AsyncMap.md
[3]: AsyncMap_1.md
[4]: AsyncMap__1.md
[5]: ../SqlBuilder/README.md
[6]: https://learn.microsoft.com/dotnet/api/system.func-2
[7]: https://learn.microsoft.com/dotnet/api/system.data.common.dbdatareader
[8]: https://learn.microsoft.com/dotnet/api/system.collections.generic.iasyncenumerable-1
[9]: README.md
================================================
FILE: docs/api/DbExtensions/Database/Configuration.md
================================================
Database.Configuration Property
===============================
Provides access to configuration options for this instance.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public DatabaseConfiguration Configuration { get; }
```
#### Property Value
[DatabaseConfiguration][2]
See Also
--------
#### Reference
[Database Class][3]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: ../DatabaseConfiguration/README.md
[3]: README.md
================================================
FILE: docs/api/DbExtensions/Database/Connection.md
================================================
Database.Connection Property
============================
Gets the connection to associate with new commands.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public DbConnection Connection { get; }
```
#### Property Value
[DbConnection][2]
See Also
--------
#### Reference
[Database Class][3]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: https://learn.microsoft.com/dotnet/api/system.data.common.dbconnection
[3]: README.md
================================================
FILE: docs/api/DbExtensions/Database/CreateCommand.md
================================================
Database.CreateCommand Method
=============================
Creates and returns a [DbCommand][1] object from the specified *sqlBuilder*.
**Namespace:** [DbExtensions][2]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public virtual DbCommand CreateCommand(
SqlBuilder sqlBuilder
)
```
#### Parameters
##### *sqlBuilder* [SqlBuilder][3]
The [SqlBuilder][3] that provides the command's text and parameters.
#### Return Value
[DbCommand][1]
A new [DbCommand][1] object with its [CommandText][4] property initialized with the *sqlBuilder*'s string representation, and its [Parameters][5] property is initialized with the values from the [ParameterValues][6] property of the *sqlBuilder* parameter.
See Also
--------
#### Reference
[Database Class][7]
[DbExtensions Namespace][2]
[1]: https://learn.microsoft.com/dotnet/api/system.data.common.dbcommand
[2]: ../README.md
[3]: ../SqlBuilder/README.md
[4]: https://learn.microsoft.com/dotnet/api/system.data.common.dbcommand.commandtext
[5]: https://learn.microsoft.com/dotnet/api/system.data.common.dbcommand.parameters
[6]: ../SqlBuilder/ParameterValues.md
[7]: README.md
================================================
FILE: docs/api/DbExtensions/Database/Dispose.md
================================================
Database.Dispose Method
=======================
Releases all resources used by the current instance of the [Database][1] class.
**Namespace:** [DbExtensions][2]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| --------------------- | ------------------------------------------------------------------------------- |
| **Dispose()** | Releases all resources used by the current instance of the [Database][1] class. |
| [Dispose(Boolean)][3] | Releases the resources used by this [Database][1] instance. |
Syntax
------
```csharp
public void Dispose()
```
#### Implements
[IDisposable.Dispose()][4]
See Also
--------
#### Reference
[Database Class][1]
[DbExtensions Namespace][2]
[1]: README.md
[2]: ../README.md
[3]: Dispose_1.md
[4]: https://learn.microsoft.com/dotnet/api/system.idisposable.dispose
================================================
FILE: docs/api/DbExtensions/Database/Dispose_1.md
================================================
Database.Dispose(Boolean) Method
================================
Releases the resources used by this [Database][1] instance.
**Namespace:** [DbExtensions][2]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| -------------------- | ------------------------------------------------------------------------------- |
| [Dispose()][3] | Releases all resources used by the current instance of the [Database][1] class. |
| **Dispose(Boolean)** | Releases the resources used by this [Database][1] instance. |
Syntax
------
```csharp
protected virtual void Dispose(
bool disposing
)
```
#### Parameters
##### *disposing* [Boolean][4]
`true` if this method is being called due to a call to [Dispose()][3]; otherwise, `false`.
See Also
--------
#### Reference
[Database Class][1]
[DbExtensions Namespace][2]
[1]: README.md
[2]: ../README.md
[3]: Dispose.md
[4]: https://learn.microsoft.com/dotnet/api/system.boolean
================================================
FILE: docs/api/DbExtensions/Database/EnsureConnectionOpen.md
================================================
Database.EnsureConnectionOpen Method
====================================
Opens [Connection][1] (if it's not open) and returns an [IDisposable][2] object you can use to close it (if it wasn't open).
**Namespace:** [DbExtensions][3]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public IDisposable EnsureConnectionOpen()
```
#### Return Value
[IDisposable][2]
An [IDisposable][2] object to close the connection.
Remarks
-------
Use this method with the `using` statement in C# or Visual Basic to ensure that a block of code is always executed with an open connection.
Example
-------
```csharp
using (db.EnsureConnectionOpen()) {
// Execute commands.
}
```
See Also
--------
#### Reference
[Database Class][4]
[DbExtensions Namespace][3]
[1]: Connection.md
[2]: https://learn.microsoft.com/dotnet/api/system.idisposable
[3]: ../README.md
[4]: README.md
================================================
FILE: docs/api/DbExtensions/Database/EnsureConnectionOpenAsync.md
================================================
Database.EnsureConnectionOpenAsync Method
=========================================
Opens [Connection][1] (if it's not open) and returns an [IAsyncDisposable][2] object you can use to close it (if it wasn't open).
**Namespace:** [DbExtensions][3]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public ValueTask EnsureConnectionOpenAsync(
CancellationToken cancellationToken = default
)
```
#### Parameters
##### *cancellationToken* [CancellationToken][4] (Optional)
The [CancellationToken][4] to monitor for cancellation requests. The default is [None][5].
#### Return Value
[ValueTask][6]<[IAsyncDisposable][2]>
An [IAsyncDisposable][2] object to close the connection.
Remarks
-------
Use this method with the `using` statement in C# or Visual Basic to ensure that a block of code is always executed with an open connection.
Example
-------
```csharp
await using (await db.EnsureConnectionOpenAsync()) {
// Execute commands.
}
```
See Also
--------
#### Reference
[Database Class][7]
[DbExtensions Namespace][3]
[1]: Connection.md
[2]: https://learn.microsoft.com/dotnet/api/system.iasyncdisposable
[3]: ../README.md
[4]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken
[5]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken.none
[6]: https://learn.microsoft.com/dotnet/api/system.threading.tasks.valuetask-1
[7]: README.md
================================================
FILE: docs/api/DbExtensions/Database/EnsureInTransaction.md
================================================
Database.EnsureInTransaction Method
===================================
Returns a virtual transaction that you can use to ensure a code block is always executed in a transaction, new or existing.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ---------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- |
| **EnsureInTransaction()** | Returns a virtual transaction that you can use to ensure a code block is always executed in a transaction, new or existing. |
| [EnsureInTransaction(IsolationLevel)][2] | Returns a virtual transaction that you can use to ensure a code block is always executed in a transaction, new or existing. |
Syntax
------
```csharp
public DbTransaction EnsureInTransaction()
```
#### Return Value
[DbTransaction][3]
A virtual transaction you can use to ensure a code block is always executed in a transaction, new or existing.
Remarks
-------
This method returns a virtual transaction that wraps an existing or new transaction. By calling [Commit()][4] on the returned object, this object will then call [Commit()][4] on the wrapped transaction if the transaction was just created, or do nothing if it was previously created.
Example
-------
Calls to this method can be nested, like in the following example:
```csharp
void DoSomething() {
using (var tx = this.db.EnsureInTransaction()) {
// Execute commands
DoSomethingElse();
tx.Commit();
}
}
void DoSomethingElse() {
using (var tx = this.db.EnsureInTransaction()) {
// Execute commands
tx.Commit();
}
}
```
See Also
--------
#### Reference
[Database Class][5]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: EnsureInTransaction_1.md
[3]: https://learn.microsoft.com/dotnet/api/system.data.common.dbtransaction
[4]: https://learn.microsoft.com/dotnet/api/system.data.common.dbtransaction.commit
[5]: README.md
================================================
FILE: docs/api/DbExtensions/Database/EnsureInTransactionAsync.md
================================================
Database.EnsureInTransactionAsync(IsolationLevel, CancellationToken) Method
===========================================================================
Returns a virtual transaction that you can use to ensure a code block is always executed in a transaction, new or existing.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| --------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- |
| [EnsureInTransactionAsync(CancellationToken)][2] | Returns a virtual transaction that you can use to ensure a code block is always executed in a transaction, new or existing. |
| **EnsureInTransactionAsync(IsolationLevel, CancellationToken)** | Returns a virtual transaction that you can use to ensure a code block is always executed in a transaction, new or existing. |
Syntax
------
```csharp
public virtual ValueTask EnsureInTransactionAsync(
IsolationLevel isolationLevel,
CancellationToken cancellationToken = default
)
```
#### Parameters
##### *isolationLevel* [IsolationLevel][3]
Specifies the isolation level for the transaction. This parameter is ignored when using an existing transaction.
##### *cancellationToken* [CancellationToken][4] (Optional)
The [CancellationToken][4] to monitor for cancellation requests. The default is [None][5].
#### Return Value
[ValueTask][6]<[DbTransaction][7]>
A virtual transaction you can use to ensure a code block is always executed in a transaction, new or existing.
Remarks
-------
This method returns a virtual transaction that wraps an existing or new transaction. By calling [Commit()][8] on the returned object, this object will then call [Commit()][8] on the wrapped transaction if the transaction was just created, or do nothing if it was previously created.
Example
-------
Calls to this method can be nested, like in the following example:
```csharp
async Task DoSomething() {
await using (var tx = await this.db.EnsureInTransactionAsync()) {
// Execute commands
await DoSomethingElse();
await tx.CommitAsync();
}
}
async Task DoSomethingElse() {
await using (var tx = await this.db.EnsureInTransactionAsync()) {
// Execute commands
await tx.CommitAsync();
}
}
```
See Also
--------
#### Reference
[Database Class][9]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: EnsureInTransactionAsync_1.md
[3]: https://learn.microsoft.com/dotnet/api/system.data.isolationlevel
[4]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken
[5]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken.none
[6]: https://learn.microsoft.com/dotnet/api/system.threading.tasks.valuetask-1
[7]: https://learn.microsoft.com/dotnet/api/system.data.common.dbtransaction
[8]: https://learn.microsoft.com/dotnet/api/system.data.common.dbtransaction.commit
[9]: README.md
================================================
FILE: docs/api/DbExtensions/Database/EnsureInTransactionAsync_1.md
================================================
Database.EnsureInTransactionAsync(CancellationToken) Method
===========================================================
Returns a virtual transaction that you can use to ensure a code block is always executed in a transaction, new or existing.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ---------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- |
| **EnsureInTransactionAsync(CancellationToken)** | Returns a virtual transaction that you can use to ensure a code block is always executed in a transaction, new or existing. |
| [EnsureInTransactionAsync(IsolationLevel, CancellationToken)][2] | Returns a virtual transaction that you can use to ensure a code block is always executed in a transaction, new or existing. |
Syntax
------
```csharp
public ValueTask EnsureInTransactionAsync(
CancellationToken cancellationToken = default
)
```
#### Parameters
##### *cancellationToken* [CancellationToken][3] (Optional)
The [CancellationToken][3] to monitor for cancellation requests. The default is [None][4].
#### Return Value
[ValueTask][5]<[DbTransaction][6]>
A virtual transaction you can use to ensure a code block is always executed in a transaction, new or existing.
Remarks
-------
This method returns a virtual transaction that wraps an existing or new transaction. By calling [Commit()][7] on the returned object, this object will then call [Commit()][7] on the wrapped transaction if the transaction was just created, or do nothing if it was previously created.
Example
-------
Calls to this method can be nested, like in the following example:
```csharp
async Task DoSomething() {
await using (var tx = await this.db.EnsureInTransactionAsync()) {
// Execute commands
await DoSomethingElse();
await tx.CommitAsync();
}
}
async Task DoSomethingElse() {
await using (var tx = await this.db.EnsureInTransactionAsync()) {
// Execute commands
await tx.CommitAsync();
}
}
```
See Also
--------
#### Reference
[Database Class][8]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: EnsureInTransactionAsync.md
[3]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken
[4]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken.none
[5]: https://learn.microsoft.com/dotnet/api/system.threading.tasks.valuetask-1
[6]: https://learn.microsoft.com/dotnet/api/system.data.common.dbtransaction
[7]: https://learn.microsoft.com/dotnet/api/system.data.common.dbtransaction.commit
[8]: README.md
================================================
FILE: docs/api/DbExtensions/Database/EnsureInTransaction_1.md
================================================
Database.EnsureInTransaction(IsolationLevel) Method
===================================================
Returns a virtual transaction that you can use to ensure a code block is always executed in a transaction, new or existing.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| --------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- |
| [EnsureInTransaction()][2] | Returns a virtual transaction that you can use to ensure a code block is always executed in a transaction, new or existing. |
| **EnsureInTransaction(IsolationLevel)** | Returns a virtual transaction that you can use to ensure a code block is always executed in a transaction, new or existing. |
Syntax
------
```csharp
public virtual DbTransaction EnsureInTransaction(
IsolationLevel isolationLevel
)
```
#### Parameters
##### *isolationLevel* [IsolationLevel][3]
Specifies the isolation level for the transaction. This parameter is ignored when using an existing transaction.
#### Return Value
[DbTransaction][4]
A virtual transaction you can use to ensure a code block is always executed in a transaction, new or existing.
Remarks
-------
This method returns a virtual transaction that wraps an existing or new transaction. By calling [Commit()][5] on the returned object, this object will then call [Commit()][5] on the wrapped transaction if the transaction was just created, or do nothing if it was previously created.
Example
-------
Calls to this method can be nested, like in the following example:
```csharp
void DoSomething() {
using (var tx = this.db.EnsureInTransaction()) {
// Execute commands
DoSomethingElse();
tx.Commit();
}
}
void DoSomethingElse() {
using (var tx = this.db.EnsureInTransaction()) {
// Execute commands
tx.Commit();
}
}
```
See Also
--------
#### Reference
[Database Class][6]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: EnsureInTransaction.md
[3]: https://learn.microsoft.com/dotnet/api/system.data.isolationlevel
[4]: https://learn.microsoft.com/dotnet/api/system.data.common.dbtransaction
[5]: https://learn.microsoft.com/dotnet/api/system.data.common.dbtransaction.commit
[6]: README.md
================================================
FILE: docs/api/DbExtensions/Database/Execute.md
================================================
Database.Execute Method
=======================
Executes the *nonQuery* command. Optionally uses a transaction and validates affected records value before committing.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public int Execute(
SqlBuilder nonQuery,
int affect = -1,
bool exact = false
)
```
#### Parameters
##### *nonQuery* [SqlBuilder][2]
The non-query command to execute.
##### *affect* [Int32][3] (Optional)
The number of records the command should affect. This value is ignored if less or equal to -1.
##### *exact* [Boolean][4] (Optional)
`true` if the number of affected records should exactly match *affect*; `false` if a lower number is acceptable.
#### Return Value
[Int32][3]
The number of affected records.
Exceptions
----------
| Exception | Condition |
| ---------------------------- | -------------------------------------------------------- |
| [ChangeConflictException][5] | The number of affected records is not equal to *affect*. |
See Also
--------
#### Reference
[Database Class][6]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: ../SqlBuilder/README.md
[3]: https://learn.microsoft.com/dotnet/api/system.int32
[4]: https://learn.microsoft.com/dotnet/api/system.boolean
[5]: ../ChangeConflictException/README.md
[6]: README.md
================================================
FILE: docs/api/DbExtensions/Database/ExecuteAsync.md
================================================
Database.ExecuteAsync Method
============================
Executes the *nonQuery* command. Optionally uses a transaction and validates affected records value before committing.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public ValueTask ExecuteAsync(
SqlBuilder nonQuery,
int affect = -1,
bool exact = false,
CancellationToken cancellationToken = default
)
```
#### Parameters
##### *nonQuery* [SqlBuilder][2]
The non-query command to execute.
##### *affect* [Int32][3] (Optional)
The number of records the command should affect. This value is ignored if less or equal to -1.
##### *exact* [Boolean][4] (Optional)
`true` if the number of affected records should exactly match *affect*; `false` if a lower number is acceptable.
##### *cancellationToken* [CancellationToken][5] (Optional)
The [CancellationToken][5] to monitor for cancellation requests. The default is [None][6].
#### Return Value
[ValueTask][7]<[Int32][3]>
The number of affected records.
Exceptions
----------
| Exception | Condition |
| ---------------------------- | -------------------------------------------------------- |
| [ChangeConflictException][8] | The number of affected records is not equal to *affect*. |
See Also
--------
#### Reference
[Database Class][9]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: ../SqlBuilder/README.md
[3]: https://learn.microsoft.com/dotnet/api/system.int32
[4]: https://learn.microsoft.com/dotnet/api/system.boolean
[5]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken
[6]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken.none
[7]: https://learn.microsoft.com/dotnet/api/system.threading.tasks.valuetask-1
[8]: ../ChangeConflictException/README.md
[9]: README.md
================================================
FILE: docs/api/DbExtensions/Database/FindAsync__1.md
================================================
Database.FindAsync<TEntity> Method
=====================================
Gets the entity whose primary key matches the *id* parameter.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public ValueTask FindAsync(
Object id,
CancellationToken cancellationToken = default
)
where TEntity : class
```
#### Parameters
##### *id* [Object][2]
The primary key value.
##### *cancellationToken* [CancellationToken][3] (Optional)
The [CancellationToken][3] to monitor for cancellation requests. The default is [None][4].
#### Type Parameters
##### *TEntity*
The type of the entity.
#### Return Value
[ValueTask][5]<**TEntity**>
The entity whose primary key matches the *id* parameter, or null if the *id* does not exist.
Remarks
-------
This method is a shortcut for `await db.Table().FindAsync(id, cancellationToken)`.
See Also
--------
#### Reference
[Database Class][6]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: https://learn.microsoft.com/dotnet/api/system.object
[3]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken
[4]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken.none
[5]: https://learn.microsoft.com/dotnet/api/system.threading.tasks.valuetask-1
[6]: README.md
================================================
FILE: docs/api/DbExtensions/Database/Find__1.md
================================================
Database.Find<TEntity> Method
================================
Gets the entity whose primary key matches the *id* parameter.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public TEntity Find(
Object id
)
where TEntity : class
```
#### Parameters
##### *id* [Object][2]
The primary key value.
#### Type Parameters
##### *TEntity*
The type of the entity.
#### Return Value
**TEntity**
The entity whose primary key matches the *id* parameter, or null if the *id* does not exist.
Remarks
-------
This method is a shortcut for `db.Table().Find(id)`.
See Also
--------
#### Reference
[Database Class][3]
[DbExtensions Namespace][1]
[SqlSet<TResult>.Find(Object)][4]
[1]: ../README.md
[2]: https://learn.microsoft.com/dotnet/api/system.object
[3]: README.md
[4]: ../SqlSet_1/Find.md
================================================
FILE: docs/api/DbExtensions/Database/From.md
================================================
Database.From(String) Method
============================
Creates and returns a new [SqlSet][1] using the provided table name.
**Namespace:** [DbExtensions][2]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ----------------------------- | -------------------------------------------------------------------------------- |
| **From(String)** | Creates and returns a new [SqlSet][1] using the provided table name. |
| [From(String, Type)][3] | Creates and returns a new [SqlSet][1] using the provided table name. |
| [From<TResult>(String)][4] | Creates and returns a new [SqlSet<TResult>][5] using the provided table name. |
Syntax
------
```csharp
public SqlSet From(
string tableName
)
```
#### Parameters
##### *tableName* [String][6]
The name of the table that will be the source of data for the set.
#### Return Value
[SqlSet][1]
A new [SqlSet][1] object.
See Also
--------
#### Reference
[Database Class][7]
[DbExtensions Namespace][2]
[1]: ../SqlSet/README.md
[2]: ../README.md
[3]: From_1.md
[4]: From__1.md
[5]: ../SqlSet_1/README.md
[6]: https://learn.microsoft.com/dotnet/api/system.string
[7]: README.md
================================================
FILE: docs/api/DbExtensions/Database/FromQuery.md
================================================
Database.FromQuery(SqlBuilder) Method
=====================================
Creates and returns a new [SqlSet][1] using the provided defining query.
**Namespace:** [DbExtensions][2]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ---------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- |
| **FromQuery(SqlBuilder)** | Creates and returns a new [SqlSet][1] using the provided defining query. |
| [FromQuery(SqlBuilder, Type)][3] | Creates and returns a new [SqlSet][1] using the provided defining query. |
| [FromQuery<TResult>(SqlBuilder)][4] | Creates and returns a new [SqlSet<TResult>][5] using the provided defining query. |
| [FromQuery<TResult>(SqlBuilder, Func<DbDataReader, TResult>)][6] | Creates and returns a new [SqlSet<TResult>][5] using the provided defining query and mapper. |
Syntax
------
```csharp
public SqlSet FromQuery(
SqlBuilder definingQuery
)
```
#### Parameters
##### *definingQuery* [SqlBuilder][7]
The SQL query that will be the source of data for the set.
#### Return Value
[SqlSet][1]
A new [SqlSet][1] object.
See Also
--------
#### Reference
[Database Class][8]
[DbExtensions Namespace][2]
[1]: ../SqlSet/README.md
[2]: ../README.md
[3]: FromQuery_1.md
[4]: FromQuery__1.md
[5]: ../SqlSet_1/README.md
[6]: FromQuery__1_1.md
[7]: ../SqlBuilder/README.md
[8]: README.md
================================================
FILE: docs/api/DbExtensions/Database/FromQuery_1.md
================================================
Database.FromQuery(SqlBuilder, Type) Method
===========================================
Creates and returns a new [SqlSet][1] using the provided defining query.
**Namespace:** [DbExtensions][2]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ---------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- |
| [FromQuery(SqlBuilder)][3] | Creates and returns a new [SqlSet][1] using the provided defining query. |
| **FromQuery(SqlBuilder, Type)** | Creates and returns a new [SqlSet][1] using the provided defining query. |
| [FromQuery<TResult>(SqlBuilder)][4] | Creates and returns a new [SqlSet<TResult>][5] using the provided defining query. |
| [FromQuery<TResult>(SqlBuilder, Func<DbDataReader, TResult>)][6] | Creates and returns a new [SqlSet<TResult>][5] using the provided defining query and mapper. |
Syntax
------
```csharp
public SqlSet FromQuery(
SqlBuilder definingQuery,
Type? resultType
)
```
#### Parameters
##### *definingQuery* [SqlBuilder][7]
The SQL query that will be the source of data for the set.
##### *resultType* [Type][8]
The type of objects to map the results to.
#### Return Value
[SqlSet][1]
A new [SqlSet][1] object.
See Also
--------
#### Reference
[Database Class][9]
[DbExtensions Namespace][2]
[1]: ../SqlSet/README.md
[2]: ../README.md
[3]: FromQuery.md
[4]: FromQuery__1.md
[5]: ../SqlSet_1/README.md
[6]: FromQuery__1_1.md
[7]: ../SqlBuilder/README.md
[8]: https://learn.microsoft.com/dotnet/api/system.type
[9]: README.md
================================================
FILE: docs/api/DbExtensions/Database/FromQuery__1.md
================================================
Database.FromQuery<TResult>(SqlBuilder) Method
=================================================
Creates and returns a new [SqlSet<TResult>][1] using the provided defining query.
**Namespace:** [DbExtensions][2]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ---------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- |
| [FromQuery(SqlBuilder)][3] | Creates and returns a new [SqlSet][4] using the provided defining query. |
| [FromQuery(SqlBuilder, Type)][5] | Creates and returns a new [SqlSet][4] using the provided defining query. |
| **FromQuery<TResult>(SqlBuilder)** | Creates and returns a new [SqlSet<TResult>][1] using the provided defining query. |
| [FromQuery<TResult>(SqlBuilder, Func<DbDataReader, TResult>)][6] | Creates and returns a new [SqlSet<TResult>][1] using the provided defining query and mapper. |
Syntax
------
```csharp
public SqlSet FromQuery(
SqlBuilder definingQuery
)
```
#### Parameters
##### *definingQuery* [SqlBuilder][7]
The SQL query that will be the source of data for the set.
#### Type Parameters
##### *TResult*
The type of objects to map the results to.
#### Return Value
[SqlSet][1]<**TResult**>
A new [SqlSet<TResult>][1] object.
See Also
--------
#### Reference
[Database Class][8]
[DbExtensions Namespace][2]
[1]: ../SqlSet_1/README.md
[2]: ../README.md
[3]: FromQuery.md
[4]: ../SqlSet/README.md
[5]: FromQuery_1.md
[6]: FromQuery__1_1.md
[7]: ../SqlBuilder/README.md
[8]: README.md
================================================
FILE: docs/api/DbExtensions/Database/FromQuery__1_1.md
================================================
Database.FromQuery<TResult>(SqlBuilder, Func<DbDataReader, TResult>) Method
=================================================================================
Creates and returns a new [SqlSet<TResult>][1] using the provided defining query and mapper.
**Namespace:** [DbExtensions][2]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| --------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- |
| [FromQuery(SqlBuilder)][3] | Creates and returns a new [SqlSet][4] using the provided defining query. |
| [FromQuery(SqlBuilder, Type)][5] | Creates and returns a new [SqlSet][4] using the provided defining query. |
| [FromQuery<TResult>(SqlBuilder)][6] | Creates and returns a new [SqlSet<TResult>][1] using the provided defining query. |
| **FromQuery<TResult>(SqlBuilder, Func<DbDataReader, TResult>)** | Creates and returns a new [SqlSet<TResult>][1] using the provided defining query and mapper. |
Syntax
------
```csharp
public SqlSet FromQuery(
SqlBuilder definingQuery,
Func mapper
)
```
#### Parameters
##### *definingQuery* [SqlBuilder][7]
The SQL query that will be the source of data for the set.
##### *mapper* [Func][8]<[DbDataReader][9], **TResult**>
A custom mapper function that creates TResult instances from the rows in the set.
#### Type Parameters
##### *TResult*
The type of objects to map the results to.
#### Return Value
[SqlSet][1]<**TResult**>
A new [SqlSet<TResult>][1] object.
See Also
--------
#### Reference
[Database Class][10]
[DbExtensions Namespace][2]
[1]: ../SqlSet_1/README.md
[2]: ../README.md
[3]: FromQuery.md
[4]: ../SqlSet/README.md
[5]: FromQuery_1.md
[6]: FromQuery__1.md
[7]: ../SqlBuilder/README.md
[8]: https://learn.microsoft.com/dotnet/api/system.func-2
[9]: https://learn.microsoft.com/dotnet/api/system.data.common.dbdatareader
[10]: README.md
================================================
FILE: docs/api/DbExtensions/Database/From_1.md
================================================
Database.From(String, Type) Method
==================================
Creates and returns a new [SqlSet][1] using the provided table name.
**Namespace:** [DbExtensions][2]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ----------------------------- | -------------------------------------------------------------------------------- |
| [From(String)][3] | Creates and returns a new [SqlSet][1] using the provided table name. |
| **From(String, Type)** | Creates and returns a new [SqlSet][1] using the provided table name. |
| [From<TResult>(String)][4] | Creates and returns a new [SqlSet<TResult>][5] using the provided table name. |
Syntax
------
```csharp
public SqlSet From(
string tableName,
Type? resultType
)
```
#### Parameters
##### *tableName* [String][6]
The name of the table that will be the source of data for the set.
##### *resultType* [Type][7]
The type of objects to map the results to.
#### Return Value
[SqlSet][1]
A new [SqlSet][1] object.
See Also
--------
#### Reference
[Database Class][8]
[DbExtensions Namespace][2]
[1]: ../SqlSet/README.md
[2]: ../README.md
[3]: From.md
[4]: From__1.md
[5]: ../SqlSet_1/README.md
[6]: https://learn.microsoft.com/dotnet/api/system.string
[7]: https://learn.microsoft.com/dotnet/api/system.type
[8]: README.md
================================================
FILE: docs/api/DbExtensions/Database/From__1.md
================================================
Database.From<TResult>(String) Method
========================================
Creates and returns a new [SqlSet<TResult>][1] using the provided table name.
**Namespace:** [DbExtensions][2]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ---------------------------- | -------------------------------------------------------------------------------- |
| [From(String)][3] | Creates and returns a new [SqlSet][4] using the provided table name. |
| [From(String, Type)][5] | Creates and returns a new [SqlSet][4] using the provided table name. |
| **From<TResult>(String)** | Creates and returns a new [SqlSet<TResult>][1] using the provided table name. |
Syntax
------
```csharp
public SqlSet From(
string tableName
)
```
#### Parameters
##### *tableName* [String][6]
The name of the table that will be the source of data for the set.
#### Type Parameters
##### *TResult*
The type of objects to map the results to.
#### Return Value
[SqlSet][1]<**TResult**>
A new [SqlSet<TResult>][1] object.
See Also
--------
#### Reference
[Database Class][7]
[DbExtensions Namespace][2]
[1]: ../SqlSet_1/README.md
[2]: ../README.md
[3]: From.md
[4]: ../SqlSet/README.md
[5]: From_1.md
[6]: https://learn.microsoft.com/dotnet/api/system.string
[7]: README.md
================================================
FILE: docs/api/DbExtensions/Database/LastInsertId.md
================================================
Database.LastInsertId Method
============================
Gets the identity value of the last inserted record.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public virtual Object? LastInsertId()
```
#### Return Value
[Object][2]
The identity value of the last inserted record.
Remarks
-------
It is very important to keep the connection open between the last command and this one, or else you might get the wrong value.
See Also
--------
#### Reference
[Database Class][3]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: https://learn.microsoft.com/dotnet/api/system.object
[3]: README.md
================================================
FILE: docs/api/DbExtensions/Database/LastInsertIdAsync.md
================================================
Database.LastInsertIdAsync Method
=================================
Gets the identity value of the last inserted record.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public virtual ValueTask LastInsertIdAsync(
CancellationToken cancellationToken = default
)
```
#### Parameters
##### *cancellationToken* [CancellationToken][2] (Optional)
The [CancellationToken][2] to monitor for cancellation requests. The default is [None][3].
#### Return Value
[ValueTask][4]<[Object][5]>
The identity value of the last inserted record.
Remarks
-------
It is very important to keep the connection open between the last command and this one, or else you might get the wrong value.
See Also
--------
#### Reference
[Database Class][6]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken
[3]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken.none
[4]: https://learn.microsoft.com/dotnet/api/system.threading.tasks.valuetask-1
[5]: https://learn.microsoft.com/dotnet/api/system.object
[6]: README.md
================================================
FILE: docs/api/DbExtensions/Database/Map.md
================================================
Database.Map(SqlBuilder) Method
===============================
Maps the results of the *query* to dynamic objects. The query is deferred-executed.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ---------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- |
| **Map(SqlBuilder)** | Maps the results of the *query* to dynamic objects. The query is deferred-executed. |
| [Map(SqlBuilder, Type)][2] | Maps the results of the *query* to objects of type specified by the *resultType* parameter. The query is deferred-executed. |
| [Map<TResult>(SqlBuilder)][3] | Maps the results of the *query* to TResult objects. The query is deferred-executed. |
| [Map<TResult>(SqlBuilder, Func<DbDataReader, TResult>)][4] | Maps the results of the *query* to TResult objects, using the provided *mapper* delegate. |
Syntax
------
```csharp
public IEnumerable Map(
SqlBuilder query
)
```
#### Parameters
##### *query* [SqlBuilder][5]
The query.
#### Return Value
[IEnumerable][6]<[Object][7]>
The results of the query as dynamic objects.
See Also
--------
#### Reference
[Database Class][8]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: Map_1.md
[3]: Map__1.md
[4]: Map__1_1.md
[5]: ../SqlBuilder/README.md
[6]: https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1
[7]: https://learn.microsoft.com/dotnet/api/system.object
[8]: README.md
================================================
FILE: docs/api/DbExtensions/Database/Map_1.md
================================================
Database.Map(SqlBuilder, Type) Method
=====================================
Maps the results of the *query* to objects of type specified by the *resultType* parameter. The query is deferred-executed.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ---------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- |
| [Map(SqlBuilder)][2] | Maps the results of the *query* to dynamic objects. The query is deferred-executed. |
| **Map(SqlBuilder, Type)** | Maps the results of the *query* to objects of type specified by the *resultType* parameter. The query is deferred-executed. |
| [Map<TResult>(SqlBuilder)][3] | Maps the results of the *query* to TResult objects. The query is deferred-executed. |
| [Map<TResult>(SqlBuilder, Func<DbDataReader, TResult>)][4] | Maps the results of the *query* to TResult objects, using the provided *mapper* delegate. |
Syntax
------
```csharp
public IEnumerable Map(
SqlBuilder query,
Type resultType
)
```
#### Parameters
##### *query* [SqlBuilder][5]
The query.
##### *resultType* [Type][6]
The type of objects to map the results to.
#### Return Value
[IEnumerable][7]<[Object][8]>
The results of the query as objects of type specified by the *resultType* parameter.
See Also
--------
#### Reference
[Database Class][9]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: Map.md
[3]: Map__1.md
[4]: Map__1_1.md
[5]: ../SqlBuilder/README.md
[6]: https://learn.microsoft.com/dotnet/api/system.type
[7]: https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1
[8]: https://learn.microsoft.com/dotnet/api/system.object
[9]: README.md
================================================
FILE: docs/api/DbExtensions/Database/Map__1.md
================================================
Database.Map<TResult>(SqlBuilder) Method
===========================================
Maps the results of the *query* to TResult objects. The query is deferred-executed.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ---------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- |
| [Map(SqlBuilder)][2] | Maps the results of the *query* to dynamic objects. The query is deferred-executed. |
| [Map(SqlBuilder, Type)][3] | Maps the results of the *query* to objects of type specified by the *resultType* parameter. The query is deferred-executed. |
| **Map<TResult>(SqlBuilder)** | Maps the results of the *query* to TResult objects. The query is deferred-executed. |
| [Map<TResult>(SqlBuilder, Func<DbDataReader, TResult>)][4] | Maps the results of the *query* to TResult objects, using the provided *mapper* delegate. |
Syntax
------
```csharp
public IEnumerable Map(
SqlBuilder query
)
```
#### Parameters
##### *query* [SqlBuilder][5]
The query.
#### Type Parameters
##### *TResult*
The type of objects to map the results to.
#### Return Value
[IEnumerable][6]<**TResult**>
The results of the query as TResult objects.
See Also
--------
#### Reference
[Database Class][7]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: Map.md
[3]: Map_1.md
[4]: Map__1_1.md
[5]: ../SqlBuilder/README.md
[6]: https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1
[7]: README.md
================================================
FILE: docs/api/DbExtensions/Database/Map__1_1.md
================================================
Database.Map<TResult>(SqlBuilder, Func<DbDataReader, TResult>) Method
===========================================================================
Maps the results of the *query* to TResult objects, using the provided *mapper* delegate.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| --------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- |
| [Map(SqlBuilder)][2] | Maps the results of the *query* to dynamic objects. The query is deferred-executed. |
| [Map(SqlBuilder, Type)][3] | Maps the results of the *query* to objects of type specified by the *resultType* parameter. The query is deferred-executed. |
| [Map<TResult>(SqlBuilder)][4] | Maps the results of the *query* to TResult objects. The query is deferred-executed. |
| **Map<TResult>(SqlBuilder, Func<DbDataReader, TResult>)** | Maps the results of the *query* to TResult objects, using the provided *mapper* delegate. |
Syntax
------
```csharp
public IEnumerable Map(
SqlBuilder query,
Func mapper
)
```
#### Parameters
##### *query* [SqlBuilder][5]
The query.
##### *mapper* [Func][6]<[DbDataReader][7], **TResult**>
The delegate for creating TResult objects from an [DbDataReader][7] object.
#### Type Parameters
##### *TResult*
The type of objects to map the results to.
#### Return Value
[IEnumerable][8]<**TResult**>
The results of the query as TResult objects.
See Also
--------
#### Reference
[Database Class][9]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: Map.md
[3]: Map_1.md
[4]: Map__1.md
[5]: ../SqlBuilder/README.md
[6]: https://learn.microsoft.com/dotnet/api/system.func-2
[7]: https://learn.microsoft.com/dotnet/api/system.data.common.dbdatareader
[8]: https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1
[9]: README.md
================================================
FILE: docs/api/DbExtensions/Database/QuoteIdentifier.md
================================================
Database.QuoteIdentifier Method
===============================
Given an unquoted identifier in the correct catalog case, returns the correct quoted form of that identifier.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public string QuoteIdentifier(
string identifier
)
```
#### Parameters
##### *identifier* [String][2]
The original identifier.
#### Return Value
[String][2]
The quoted version of the identifier. If the indentifier is already quoted it's returned unchanged.
See Also
--------
#### Reference
[Database Class][3]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: https://learn.microsoft.com/dotnet/api/system.string
[3]: README.md
================================================
FILE: docs/api/DbExtensions/Database/README.md
================================================
Database Class
==============
Provides simple data access using [SqlSet][1], [SqlBuilder][2] and [SqlTable<TEntity>][3].
Inheritance Hierarchy
---------------------
[System.Object][4]
**DbExtensions.Database**
**Namespace:** [DbExtensions][5]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public class Database : IDisposable
```
The **Database** type exposes the following members.
Constructors
------------
| Name | Description |
| ----------------------------- | ------------------------------------------------------------------------------------------------------------------------ |
| [Database(DbConnection)][6] | Initializes a new instance of the **Database** class using the provided connection. |
| [Database(String, String)][7] | Initializes a new instance of the **Database** class using the provided connection string and provider's invariant name. |
Properties
----------
| Name | Description |
| ------------------ | ----------------------------------------------------------- |
| [Configuration][8] | Provides access to configuration options for this instance. |
| [Connection][9] | Gets the connection to associate with new commands. |
| [Transaction][10] | Gets or sets a transaction to associate with new commands. |
Methods
-------
| Name | Description |
| ----------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- |
| [Add][11] | Recursively executes INSERT commands for the specified *entity* and all its one-to-one and one-to-many associations. |
| [AddAsync][12] | Recursively executes INSERT commands for the specified *entity* and all its one-to-one and one-to-many associations. |
| [AsyncMap(SqlBuilder)][13] | Maps the results of the *query* to dynamic objects. The query is deferred-executed. |
| [AsyncMap(SqlBuilder, Type)][14] | Maps the results of the *query* to objects of type specified by the *resultType* parameter. The query is deferred-executed. |
| [AsyncMap<TResult>(SqlBuilder)][15] | Maps the results of the *query* to TResult objects. The query is deferred-executed. |
| [AsyncMap<TResult>(SqlBuilder, Func<DbDataReader, TResult>)][16] | Maps the results of the *query* to TResult objects, using the provided *mapper* delegate. |
| [CreateCommand][17] | Creates and returns a [DbCommand][18] object from the specified *sqlBuilder*. |
| [Dispose()][19] | Releases all resources used by the current instance of the **Database** class. |
| [Dispose(Boolean)][20] | Releases the resources used by this **Database** instance. |
| [EnsureConnectionOpen][21] | Opens [Connection][9] (if it's not open) and returns an [IDisposable][22] object you can use to close it (if it wasn't open). |
| [EnsureConnectionOpenAsync][23] | Opens [Connection][9] (if it's not open) and returns an [IAsyncDisposable][24] object you can use to close it (if it wasn't open). |
| [EnsureInTransaction()][25] | Returns a virtual transaction that you can use to ensure a code block is always executed in a transaction, new or existing. |
| [EnsureInTransaction(IsolationLevel)][26] | Returns a virtual transaction that you can use to ensure a code block is always executed in a transaction, new or existing. |
| [EnsureInTransactionAsync(CancellationToken)][27] | Returns a virtual transaction that you can use to ensure a code block is always executed in a transaction, new or existing. |
| [EnsureInTransactionAsync(IsolationLevel, CancellationToken)][28] | Returns a virtual transaction that you can use to ensure a code block is always executed in a transaction, new or existing. |
| [Execute][29] | Executes the *nonQuery* command. Optionally uses a transaction and validates affected records value before committing. |
| [ExecuteAsync][30] | Executes the *nonQuery* command. Optionally uses a transaction and validates affected records value before committing. |
| [Find<TEntity>][31] | Gets the entity whose primary key matches the *id* parameter. |
| [FindAsync<TEntity>][32] | Gets the entity whose primary key matches the *id* parameter. |
| [From(String)][33] | Creates and returns a new [SqlSet][1] using the provided table name. |
| [From(String, Type)][34] | Creates and returns a new [SqlSet][1] using the provided table name. |
| [From<TResult>(String)][35] | Creates and returns a new [SqlSet<TResult>][36] using the provided table name. |
| [FromQuery(SqlBuilder)][37] | Creates and returns a new [SqlSet][1] using the provided defining query. |
| [FromQuery(SqlBuilder, Type)][38] | Creates and returns a new [SqlSet][1] using the provided defining query. |
| [FromQuery<TResult>(SqlBuilder)][39] | Creates and returns a new [SqlSet<TResult>][36] using the provided defining query. |
| [FromQuery<TResult>(SqlBuilder, Func<DbDataReader, TResult>)][40] | Creates and returns a new [SqlSet<TResult>][36] using the provided defining query and mapper. |
| [LastInsertId][41] | Gets the identity value of the last inserted record. |
| [LastInsertIdAsync][42] | Gets the identity value of the last inserted record. |
| [Map(SqlBuilder)][43] | Maps the results of the *query* to dynamic objects. The query is deferred-executed. |
| [Map(SqlBuilder, Type)][44] | Maps the results of the *query* to objects of type specified by the *resultType* parameter. The query is deferred-executed. |
| [Map<TResult>(SqlBuilder)][45] | Maps the results of the *query* to TResult objects. The query is deferred-executed. |
| [Map<TResult>(SqlBuilder, Func<DbDataReader, TResult>)][46] | Maps the results of the *query* to TResult objects, using the provided *mapper* delegate. |
| [QuoteIdentifier][47] | Given an unquoted identifier in the correct catalog case, returns the correct quoted form of that identifier. |
| [Remove][48] | Executes a DELETE command for the specified *entity*. |
| [RemoveAsync][49] | Executes a DELETE command for the specified *entity*. |
| [Table(Type)][50] | Returns the [SqlTable][51] instance for the specified *entityType*. |
| [Table<TEntity>()][52] | Returns the [SqlTable<TEntity>][3] instance for the specified TEntity. |
| [Update(Object)][53] | Executes an UPDATE command for the specified *entity*. |
| [Update(Object, Object)][54] | Executes an UPDATE command for the specified *entity*. |
| [UpdateAsync(Object, CancellationToken)][55] | Executes an UPDATE command for the specified *entity*. |
| [UpdateAsync(Object, Object, CancellationToken)][56] | Executes an UPDATE command for the specified *entity*. |
See Also
--------
#### Reference
[DbExtensions Namespace][5]
[1]: ../SqlSet/README.md
[2]: ../SqlBuilder/README.md
[3]: ../SqlTable_1/README.md
[4]: https://learn.microsoft.com/dotnet/api/system.object
[5]: ../README.md
[6]: _ctor.md
[7]: _ctor_1.md
[8]: Configuration.md
[9]: Connection.md
[10]: Transaction.md
[11]: Add.md
[12]: AddAsync.md
[13]: AsyncMap.md
[14]: AsyncMap_1.md
[15]: AsyncMap__1.md
[16]: AsyncMap__1_1.md
[17]: CreateCommand.md
[18]: https://learn.microsoft.com/dotnet/api/system.data.common.dbcommand
[19]: Dispose.md
[20]: Dispose_1.md
[21]: EnsureConnectionOpen.md
[22]: https://learn.microsoft.com/dotnet/api/system.idisposable
[23]: EnsureConnectionOpenAsync.md
[24]: https://learn.microsoft.com/dotnet/api/system.iasyncdisposable
[25]: EnsureInTransaction.md
[26]: EnsureInTransaction_1.md
[27]: EnsureInTransactionAsync_1.md
[28]: EnsureInTransactionAsync.md
[29]: Execute.md
[30]: ExecuteAsync.md
[31]: Find__1.md
[32]: FindAsync__1.md
[33]: From.md
[34]: From_1.md
[35]: From__1.md
[36]: ../SqlSet_1/README.md
[37]: FromQuery.md
[38]: FromQuery_1.md
[39]: FromQuery__1.md
[40]: FromQuery__1_1.md
[41]: LastInsertId.md
[42]: LastInsertIdAsync.md
[43]: Map.md
[44]: Map_1.md
[45]: Map__1.md
[46]: Map__1_1.md
[47]: QuoteIdentifier.md
[48]: Remove.md
[49]: RemoveAsync.md
[50]: Table.md
[51]: ../SqlTable/README.md
[52]: Table__1.md
[53]: Update.md
[54]: Update_1.md
[55]: UpdateAsync_1.md
[56]: UpdateAsync.md
================================================
FILE: docs/api/DbExtensions/Database/Remove.md
================================================
Database.Remove Method
======================
Executes a DELETE command for the specified *entity*.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public bool Remove(
Object entity
)
```
#### Parameters
##### *entity* [Object][2]
The entity whose DELETE command is to be executed.
#### Return Value
[Boolean][3]
`true` if *entity* is deleted; otherwise, `false`.
Remarks
-------
This method is a shortcut for `db.Table(entity.GetType()).Remove(entity)`.
See Also
--------
#### Reference
[Database Class][4]
[DbExtensions Namespace][1]
[SqlTable.Remove(Object)][5]
[1]: ../README.md
[2]: https://learn.microsoft.com/dotnet/api/system.object
[3]: https://learn.microsoft.com/dotnet/api/system.boolean
[4]: README.md
[5]: ../SqlTable/Remove.md
================================================
FILE: docs/api/DbExtensions/Database/RemoveAsync.md
================================================
Database.RemoveAsync Method
===========================
Executes a DELETE command for the specified *entity*.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public ValueTask RemoveAsync(
Object entity,
CancellationToken cancellationToken = default
)
```
#### Parameters
##### *entity* [Object][2]
The entity whose DELETE command is to be executed.
##### *cancellationToken* [CancellationToken][3] (Optional)
The [CancellationToken][3] to monitor for cancellation requests. The default is [None][4].
#### Return Value
[ValueTask][5]<[Boolean][6]>
`true` if *entity* is deleted; otherwise, `false`.
Remarks
-------
This method is a shortcut for `await db.Table(entity.GetType()).RemoveAsync(entity, cancellationToken)`.
See Also
--------
#### Reference
[Database Class][7]
[DbExtensions Namespace][1]
[SqlTable.RemoveAsync(Object, CancellationToken)][8]
[1]: ../README.md
[2]: https://learn.microsoft.com/dotnet/api/system.object
[3]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken
[4]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken.none
[5]: https://learn.microsoft.com/dotnet/api/system.threading.tasks.valuetask-1
[6]: https://learn.microsoft.com/dotnet/api/system.boolean
[7]: README.md
[8]: ../SqlTable/RemoveAsync.md
================================================
FILE: docs/api/DbExtensions/Database/Table.md
================================================
Database.Table(Type) Method
===========================
Returns the [SqlTable][1] instance for the specified *entityType*.
**Namespace:** [DbExtensions][2]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ------------------------ | ------------------------------------------------------------------------- |
| **Table(Type)** | Returns the [SqlTable][1] instance for the specified *entityType*. |
| [Table<TEntity>()][3] | Returns the [SqlTable<TEntity>][4] instance for the specified TEntity. |
Syntax
------
```csharp
public SqlTable Table(
Type entityType
)
```
#### Parameters
##### *entityType* [Type][5]
The type of the entity.
#### Return Value
[SqlTable][1]
The [SqlTable][1] instance for *entityType*.
See Also
--------
#### Reference
[Database Class][6]
[DbExtensions Namespace][2]
[1]: ../SqlTable/README.md
[2]: ../README.md
[3]: Table__1.md
[4]: ../SqlTable_1/README.md
[5]: https://learn.microsoft.com/dotnet/api/system.type
[6]: README.md
================================================
FILE: docs/api/DbExtensions/Database/Table__1.md
================================================
Database.Table<TEntity> Method
=================================
Returns the [SqlTable<TEntity>][1] instance for the specified TEntity.
**Namespace:** [DbExtensions][2]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ----------------------- | ------------------------------------------------------------------------- |
| [Table(Type)][3] | Returns the [SqlTable][4] instance for the specified *entityType*. |
| **Table<TEntity>()** | Returns the [SqlTable<TEntity>][1] instance for the specified TEntity. |
Syntax
------
```csharp
public SqlTable Table()
where TEntity : class
```
#### Type Parameters
##### *TEntity*
The type of the entity.
#### Return Value
[SqlTable][1]<**TEntity**>
The [SqlTable<TEntity>][1] instance for TEntity.
See Also
--------
#### Reference
[Database Class][5]
[DbExtensions Namespace][2]
[1]: ../SqlTable_1/README.md
[2]: ../README.md
[3]: Table.md
[4]: ../SqlTable/README.md
[5]: README.md
================================================
FILE: docs/api/DbExtensions/Database/Transaction.md
================================================
Database.Transaction Property
=============================
Gets or sets a transaction to associate with new commands.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public DbTransaction? Transaction { get; set; }
```
#### Property Value
[DbTransaction][2]
See Also
--------
#### Reference
[Database Class][3]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: https://learn.microsoft.com/dotnet/api/system.data.common.dbtransaction
[3]: README.md
================================================
FILE: docs/api/DbExtensions/Database/Update.md
================================================
Database.Update(Object) Method
==============================
Executes an UPDATE command for the specified *entity*.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| --------------------------- | ------------------------------------------------------ |
| **Update(Object)** | Executes an UPDATE command for the specified *entity*. |
| [Update(Object, Object)][2] | Executes an UPDATE command for the specified *entity*. |
Syntax
------
```csharp
public void Update(
Object entity
)
```
#### Parameters
##### *entity* [Object][3]
The entity whose UPDATE command is to be executed.
Remarks
-------
This method is a shortcut for `db.Table(entity.GetType()).Update(entity)`.
See Also
--------
#### Reference
[Database Class][4]
[DbExtensions Namespace][1]
[SqlTable.Update(Object)][5]
[1]: ../README.md
[2]: Update_1.md
[3]: https://learn.microsoft.com/dotnet/api/system.object
[4]: README.md
[5]: ../SqlTable/Update.md
================================================
FILE: docs/api/DbExtensions/Database/UpdateAsync.md
================================================
Database.UpdateAsync(Object, Object, CancellationToken) Method
==============================================================
Executes an UPDATE command for the specified *entity*.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| -------------------------------------------------- | ------------------------------------------------------ |
| [UpdateAsync(Object, CancellationToken)][2] | Executes an UPDATE command for the specified *entity*. |
| **UpdateAsync(Object, Object, CancellationToken)** | Executes an UPDATE command for the specified *entity*. |
Syntax
------
```csharp
public ValueTask UpdateAsync(
Object entity,
Object? originalId,
CancellationToken cancellationToken = default
)
```
#### Parameters
##### *entity* [Object][3]
The entity whose UPDATE command is to be executed.
##### *originalId* [Object][3]
The original primary key value.
##### *cancellationToken* [CancellationToken][4] (Optional)
The [CancellationToken][4] to monitor for cancellation requests. The default is [None][5].
#### Return Value
[ValueTask][6]
Remarks
-------
This method is a shortcut for `await db.Table(entity.GetType()).UpdateAsync(entity, originalId, cancellationToken)`.
See Also
--------
#### Reference
[Database Class][7]
[DbExtensions Namespace][1]
[SqlTable.UpdateAsync(Object, Object, CancellationToken)][8]
[1]: ../README.md
[2]: UpdateAsync_1.md
[3]: https://learn.microsoft.com/dotnet/api/system.object
[4]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken
[5]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken.none
[6]: https://learn.microsoft.com/dotnet/api/system.threading.tasks.valuetask
[7]: README.md
[8]: ../SqlTable/UpdateAsync.md
================================================
FILE: docs/api/DbExtensions/Database/UpdateAsync_1.md
================================================
Database.UpdateAsync(Object, CancellationToken) Method
======================================================
Executes an UPDATE command for the specified *entity*.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| --------------------------------------------------- | ------------------------------------------------------ |
| **UpdateAsync(Object, CancellationToken)** | Executes an UPDATE command for the specified *entity*. |
| [UpdateAsync(Object, Object, CancellationToken)][2] | Executes an UPDATE command for the specified *entity*. |
Syntax
------
```csharp
public ValueTask UpdateAsync(
Object entity,
CancellationToken cancellationToken = default
)
```
#### Parameters
##### *entity* [Object][3]
The entity whose UPDATE command is to be executed.
##### *cancellationToken* [CancellationToken][4] (Optional)
The [CancellationToken][4] to monitor for cancellation requests. The default is [None][5].
#### Return Value
[ValueTask][6]
Remarks
-------
This method is a shortcut for `await db.Table(entity.GetType()).UpdateAsync(entity, cancellationToken)`.
See Also
--------
#### Reference
[Database Class][7]
[DbExtensions Namespace][1]
[SqlTable.UpdateAsync(Object, CancellationToken)][8]
[1]: ../README.md
[2]: UpdateAsync.md
[3]: https://learn.microsoft.com/dotnet/api/system.object
[4]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken
[5]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken.none
[6]: https://learn.microsoft.com/dotnet/api/system.threading.tasks.valuetask
[7]: README.md
[8]: ../SqlTable/UpdateAsync_1.md
================================================
FILE: docs/api/DbExtensions/Database/Update_1.md
================================================
Database.Update(Object, Object) Method
======================================
Executes an UPDATE command for the specified *entity*.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| -------------------------- | ------------------------------------------------------ |
| [Update(Object)][2] | Executes an UPDATE command for the specified *entity*. |
| **Update(Object, Object)** | Executes an UPDATE command for the specified *entity*. |
Syntax
------
```csharp
public void Update(
Object entity,
Object? originalId
)
```
#### Parameters
##### *entity* [Object][3]
The entity whose UPDATE command is to be executed.
##### *originalId* [Object][3]
The original primary key value.
Remarks
-------
This method is a shortcut for `db.Table(entity.GetType()).Update(entity, originalId)`.
See Also
--------
#### Reference
[Database Class][4]
[DbExtensions Namespace][1]
[SqlTable.Update(Object, Object)][5]
[1]: ../README.md
[2]: Update.md
[3]: https://learn.microsoft.com/dotnet/api/system.object
[4]: README.md
[5]: ../SqlTable/Update_1.md
================================================
FILE: docs/api/DbExtensions/Database/_ctor.md
================================================
Database(DbConnection) Constructor
==================================
Initializes a new instance of the [Database][1] class using the provided connection.
**Namespace:** [DbExtensions][2]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ----------------------------- | ------------------------------------------------------------------------------------------------------------------------- |
| **Database(DbConnection)** | Initializes a new instance of the [Database][1] class using the provided connection. |
| [Database(String, String)][3] | Initializes a new instance of the [Database][1] class using the provided connection string and provider's invariant name. |
Syntax
------
```csharp
public Database(
DbConnection connection
)
```
#### Parameters
##### *connection* [DbConnection][4]
The connection.
See Also
--------
#### Reference
[Database Class][1]
[DbExtensions Namespace][2]
[1]: README.md
[2]: ../README.md
[3]: _ctor_1.md
[4]: https://learn.microsoft.com/dotnet/api/system.data.common.dbconnection
================================================
FILE: docs/api/DbExtensions/Database/_ctor_1.md
================================================
Database(String, String) Constructor
====================================
Initializes a new instance of the [Database][1] class using the provided connection string and provider's invariant name.
**Namespace:** [DbExtensions][2]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ---------------------------- | ------------------------------------------------------------------------------------------------------------------------- |
| [Database(DbConnection)][3] | Initializes a new instance of the [Database][1] class using the provided connection. |
| **Database(String, String)** | Initializes a new instance of the [Database][1] class using the provided connection string and provider's invariant name. |
Syntax
------
```csharp
public Database(
string connectionString,
string providerInvariantName
)
```
#### Parameters
##### *connectionString* [String][4]
The connection string.
##### *providerInvariantName* [String][4]
The provider's invariant name.
See Also
--------
#### Reference
[Database Class][1]
[DbExtensions Namespace][2]
[1]: README.md
[2]: ../README.md
[3]: _ctor.md
[4]: https://learn.microsoft.com/dotnet/api/system.string
================================================
FILE: docs/api/DbExtensions/DatabaseConfiguration/CommandTimeout.md
================================================
DatabaseConfiguration.CommandTimeout Property
=============================================
Specifies a timeout to assign to commands. This setting is ignored if less or equal to -1. The default is -1.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public int CommandTimeout { get; set; }
```
#### Property Value
[Int32][2]
See Also
--------
#### Reference
[DatabaseConfiguration Class][3]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: https://learn.microsoft.com/dotnet/api/system.int32
[3]: README.md
================================================
FILE: docs/api/DbExtensions/DatabaseConfiguration/DefaultComplexPropertySeparator.md
================================================
DatabaseConfiguration.DefaultComplexPropertySeparator Property
==============================================================
The default separator to use when mapping complex properties. The default value is null, which means no separator is used, unless an explicit separator is specified on [ComplexPropertyAttribute.Separator][1].
**Namespace:** [DbExtensions][2]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public string? DefaultComplexPropertySeparator { get; set; }
```
#### Property Value
[String][3]
See Also
--------
#### Reference
[DatabaseConfiguration Class][4]
[DbExtensions Namespace][2]
[1]: ../ComplexPropertyAttribute/Separator.md
[2]: ../README.md
[3]: https://learn.microsoft.com/dotnet/api/system.string
[4]: README.md
================================================
FILE: docs/api/DbExtensions/DatabaseConfiguration/EnableBatchCommands.md
================================================
DatabaseConfiguration.EnableBatchCommands Property
==================================================
`true` to execute batch commands when possible; otherwise, `false`. The default is `true`.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public bool EnableBatchCommands { get; set; }
```
#### Property Value
[Boolean][2]
Remarks
-------
This setting affects the behavior of [AddRange(TEntity[])][3], [UpdateRange(TEntity[])][4] and [RemoveRange(TEntity[])][5].
See Also
--------
#### Reference
[DatabaseConfiguration Class][6]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: https://learn.microsoft.com/dotnet/api/system.boolean
[3]: ../SqlTable_1/AddRange_1.md
[4]: ../SqlTable_1/UpdateRange_1.md
[5]: ../SqlTable_1/RemoveRange_1.md
[6]: README.md
================================================
FILE: docs/api/DbExtensions/DatabaseConfiguration/LastInsertIdCommand.md
================================================
DatabaseConfiguration.LastInsertIdCommand Property
==================================================
Gets or sets the SQL command that returns the last identity value generated on the database.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public string LastInsertIdCommand { get; set; }
```
#### Property Value
[String][2]
See Also
--------
#### Reference
[DatabaseConfiguration Class][3]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: https://learn.microsoft.com/dotnet/api/system.string
[3]: README.md
================================================
FILE: docs/api/DbExtensions/DatabaseConfiguration/Log.md
================================================
DatabaseConfiguration.Log Property
==================================
Specifies the destination to write the SQL query or command.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public TextWriter? Log { get; set; }
```
#### Property Value
[TextWriter][2]
See Also
--------
#### Reference
[DatabaseConfiguration Class][3]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: https://learn.microsoft.com/dotnet/api/system.io.textwriter
[3]: README.md
================================================
FILE: docs/api/DbExtensions/DatabaseConfiguration/ParameterNameBuilder.md
================================================
DatabaseConfiguration.ParameterNameBuilder Property
===================================================
Specifies a function that prepares a parameter name to be used on [DbParameter.ParameterName][1].
**Namespace:** [DbExtensions][2]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public Func ParameterNameBuilder { get; set; }
```
#### Property Value
[Func][3]<[String][4], [String][4]>
See Also
--------
#### Reference
[DatabaseConfiguration Class][5]
[DbExtensions Namespace][2]
[1]: https://learn.microsoft.com/dotnet/api/system.data.common.dbparameter.parametername
[2]: ../README.md
[3]: https://learn.microsoft.com/dotnet/api/system.func-2
[4]: https://learn.microsoft.com/dotnet/api/system.string
[5]: README.md
================================================
FILE: docs/api/DbExtensions/DatabaseConfiguration/ParameterPlaceholderBuilder.md
================================================
DatabaseConfiguration.ParameterPlaceholderBuilder Property
==========================================================
Specifies a function that builds a parameter placeholder to be used in SQL statements.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public Func ParameterPlaceholderBuilder { get; set; }
```
#### Property Value
[Func][2]<[String][3], [String][3]>
See Also
--------
#### Reference
[DatabaseConfiguration Class][4]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: https://learn.microsoft.com/dotnet/api/system.func-2
[3]: https://learn.microsoft.com/dotnet/api/system.string
[4]: README.md
================================================
FILE: docs/api/DbExtensions/DatabaseConfiguration/QuotePrefix.md
================================================
DatabaseConfiguration.QuotePrefix Property
==========================================
Gets or sets the beginning character or characters to use when specifying database objects (for example, tables or columns) whose names contain characters such as spaces or reserved tokens.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public string QuotePrefix { get; set; }
```
#### Property Value
[String][2]
See Also
--------
#### Reference
[DatabaseConfiguration Class][3]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: https://learn.microsoft.com/dotnet/api/system.string
[3]: README.md
================================================
FILE: docs/api/DbExtensions/DatabaseConfiguration/QuoteSuffix.md
================================================
DatabaseConfiguration.QuoteSuffix Property
==========================================
Gets or sets the ending character or characters to use when specifying database objects (for example, tables or columns) whose names contain characters such as spaces or reserved tokens.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public string QuoteSuffix { get; set; }
```
#### Property Value
[String][2]
See Also
--------
#### Reference
[DatabaseConfiguration Class][3]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: https://learn.microsoft.com/dotnet/api/system.string
[3]: README.md
================================================
FILE: docs/api/DbExtensions/DatabaseConfiguration/README.md
================================================
DatabaseConfiguration Class
===========================
Holds configuration options that customize the behavior of [Database][1]. This class cannot be instantiated, to get an instance use the [Configuration][2] property.
Inheritance Hierarchy
---------------------
[System.Object][3]
**DbExtensions.DatabaseConfiguration**
**Namespace:** [DbExtensions][4]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public sealed class DatabaseConfiguration
```
The **DatabaseConfiguration** type exposes the following members.
Properties
----------
| Name | Description |
| ------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [CommandTimeout][5] | Specifies a timeout to assign to commands. This setting is ignored if less or equal to -1. The default is -1. |
| [DefaultComplexPropertySeparator][6] | The default separator to use when mapping complex properties. The default value is null, which means no separator is used, unless an explicit separator is specified on [ComplexPropertyAttribute.Separator][7]. |
| [EnableBatchCommands][8] | `true` to execute batch commands when possible; otherwise, `false`. The default is `true`. |
| [LastInsertIdCommand][9] | Gets or sets the SQL command that returns the last identity value generated on the database. |
| [Log][10] | Specifies the destination to write the SQL query or command. |
| [ParameterNameBuilder][11] | Specifies a function that prepares a parameter name to be used on [DbParameter.ParameterName][12]. |
| [ParameterPlaceholderBuilder][13] | Specifies a function that builds a parameter placeholder to be used in SQL statements. |
| [QuotePrefix][14] | Gets or sets the beginning character or characters to use when specifying database objects (for example, tables or columns) whose names contain characters such as spaces or reserved tokens. |
| [QuoteSuffix][15] | Gets or sets the ending character or characters to use when specifying database objects (for example, tables or columns) whose names contain characters such as spaces or reserved tokens. |
| [UseVersionMember][16] | `true` to include version column check in SQL statements' predicates; otherwise, `false`. The default is `true`. |
See Also
--------
#### Reference
[DbExtensions Namespace][4]
[1]: ../Database/README.md
[2]: ../Database/Configuration.md
[3]: https://learn.microsoft.com/dotnet/api/system.object
[4]: ../README.md
[5]: CommandTimeout.md
[6]: DefaultComplexPropertySeparator.md
[7]: ../ComplexPropertyAttribute/Separator.md
[8]: EnableBatchCommands.md
[9]: LastInsertIdCommand.md
[10]: Log.md
[11]: ParameterNameBuilder.md
[12]: https://learn.microsoft.com/dotnet/api/system.data.common.dbparameter.parametername
[13]: ParameterPlaceholderBuilder.md
[14]: QuotePrefix.md
[15]: QuoteSuffix.md
[16]: UseVersionMember.md
================================================
FILE: docs/api/DbExtensions/DatabaseConfiguration/UseVersionMember.md
================================================
DatabaseConfiguration.UseVersionMember Property
===============================================
`true` to include version column check in SQL statements' predicates; otherwise, `false`. The default is `true`.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public bool UseVersionMember { get; set; }
```
#### Property Value
[Boolean][2]
See Also
--------
#### Reference
[DatabaseConfiguration Class][3]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: https://learn.microsoft.com/dotnet/api/system.boolean
[3]: README.md
================================================
FILE: docs/api/DbExtensions/Extensions/GetBoolean.md
================================================
Extensions.GetBoolean Method
============================
Gets the value of the specified column as a [Boolean][1].
**Namespace:** [DbExtensions][2]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public static bool GetBoolean(
this DbDataReader reader,
string name
)
```
#### Parameters
##### *reader* [DbDataReader][3]
The data reader.
##### *name* [String][4]
The name of the column to find.
#### Return Value
[Boolean][1]
The value of the column.
#### Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type [DbDataReader][3]. When you use instance method syntax to call this method, omit the first parameter. For more information, see [Extension Methods (Visual Basic)][5] or [Extension Methods (C# Programming Guide)][6].
See Also
--------
#### Reference
[Extensions Class][7]
[DbExtensions Namespace][2]
[1]: https://learn.microsoft.com/dotnet/api/system.boolean
[2]: ../README.md
[3]: https://learn.microsoft.com/dotnet/api/system.data.common.dbdatareader
[4]: https://learn.microsoft.com/dotnet/api/system.string
[5]: https://docs.microsoft.com/dotnet/visual-basic/programming-guide/language-features/procedures/extension-methods
[6]: https://docs.microsoft.com/dotnet/csharp/programming-guide/classes-and-structs/extension-methods
[7]: README.md
================================================
FILE: docs/api/DbExtensions/Extensions/GetByte.md
================================================
Extensions.GetByte Method
=========================
Gets the value of the specified column as a [Byte][1].
**Namespace:** [DbExtensions][2]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public static byte GetByte(
this DbDataReader reader,
string name
)
```
#### Parameters
##### *reader* [DbDataReader][3]
The data reader.
##### *name* [String][4]
The name of the column to find.
#### Return Value
[Byte][1]
The value of the column.
#### Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type [DbDataReader][3]. When you use instance method syntax to call this method, omit the first parameter. For more information, see [Extension Methods (Visual Basic)][5] or [Extension Methods (C# Programming Guide)][6].
See Also
--------
#### Reference
[Extensions Class][7]
[DbExtensions Namespace][2]
[1]: https://learn.microsoft.com/dotnet/api/system.byte
[2]: ../README.md
[3]: https://learn.microsoft.com/dotnet/api/system.data.common.dbdatareader
[4]: https://learn.microsoft.com/dotnet/api/system.string
[5]: https://docs.microsoft.com/dotnet/visual-basic/programming-guide/language-features/procedures/extension-methods
[6]: https://docs.microsoft.com/dotnet/csharp/programming-guide/classes-and-structs/extension-methods
[7]: README.md
================================================
FILE: docs/api/DbExtensions/Extensions/GetChar.md
================================================
Extensions.GetChar Method
=========================
Gets the value of the specified column as a [Char][1].
**Namespace:** [DbExtensions][2]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public static char GetChar(
this DbDataReader reader,
string name
)
```
#### Parameters
##### *reader* [DbDataReader][3]
The data reader.
##### *name* [String][4]
The name of the column to find.
#### Return Value
[Char][1]
The value of the column.
#### Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type [DbDataReader][3]. When you use instance method syntax to call this method, omit the first parameter. For more information, see [Extension Methods (Visual Basic)][5] or [Extension Methods (C# Programming Guide)][6].
See Also
--------
#### Reference
[Extensions Class][7]
[DbExtensions Namespace][2]
[1]: https://learn.microsoft.com/dotnet/api/system.char
[2]: ../README.md
[3]: https://learn.microsoft.com/dotnet/api/system.data.common.dbdatareader
[4]: https://learn.microsoft.com/dotnet/api/system.string
[5]: https://docs.microsoft.com/dotnet/visual-basic/programming-guide/language-features/procedures/extension-methods
[6]: https://docs.microsoft.com/dotnet/csharp/programming-guide/classes-and-structs/extension-methods
[7]: README.md
================================================
FILE: docs/api/DbExtensions/Extensions/GetDateTime.md
================================================
Extensions.GetDateTime Method
=============================
Gets the value of the specified column as a [DateTime][1].
**Namespace:** [DbExtensions][2]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public static DateTime GetDateTime(
this DbDataReader reader,
string name
)
```
#### Parameters
##### *reader* [DbDataReader][3]
The data reader.
##### *name* [String][4]
The name of the column to find.
#### Return Value
[DateTime][1]
The value of the column.
#### Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type [DbDataReader][3]. When you use instance method syntax to call this method, omit the first parameter. For more information, see [Extension Methods (Visual Basic)][5] or [Extension Methods (C# Programming Guide)][6].
See Also
--------
#### Reference
[Extensions Class][7]
[DbExtensions Namespace][2]
[1]: https://learn.microsoft.com/dotnet/api/system.datetime
[2]: ../README.md
[3]: https://learn.microsoft.com/dotnet/api/system.data.common.dbdatareader
[4]: https://learn.microsoft.com/dotnet/api/system.string
[5]: https://docs.microsoft.com/dotnet/visual-basic/programming-guide/language-features/procedures/extension-methods
[6]: https://docs.microsoft.com/dotnet/csharp/programming-guide/classes-and-structs/extension-methods
[7]: README.md
================================================
FILE: docs/api/DbExtensions/Extensions/GetDecimal.md
================================================
Extensions.GetDecimal Method
============================
Gets the value of the specified column as a [Decimal][1].
**Namespace:** [DbExtensions][2]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public static decimal GetDecimal(
this DbDataReader reader,
string name
)
```
#### Parameters
##### *reader* [DbDataReader][3]
The data reader.
##### *name* [String][4]
The name of the column to find.
#### Return Value
[Decimal][1]
The value of the column.
#### Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type [DbDataReader][3]. When you use instance method syntax to call this method, omit the first parameter. For more information, see [Extension Methods (Visual Basic)][5] or [Extension Methods (C# Programming Guide)][6].
See Also
--------
#### Reference
[Extensions Class][7]
[DbExtensions Namespace][2]
[1]: https://learn.microsoft.com/dotnet/api/system.decimal
[2]: ../README.md
[3]: https://learn.microsoft.com/dotnet/api/system.data.common.dbdatareader
[4]: https://learn.microsoft.com/dotnet/api/system.string
[5]: https://docs.microsoft.com/dotnet/visual-basic/programming-guide/language-features/procedures/extension-methods
[6]: https://docs.microsoft.com/dotnet/csharp/programming-guide/classes-and-structs/extension-methods
[7]: README.md
================================================
FILE: docs/api/DbExtensions/Extensions/GetDouble.md
================================================
Extensions.GetDouble Method
===========================
Gets the value of the specified column as a [Double][1].
**Namespace:** [DbExtensions][2]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public static double GetDouble(
this DbDataReader reader,
string name
)
```
#### Parameters
##### *reader* [DbDataReader][3]
The data reader.
##### *name* [String][4]
The name of the column to find.
#### Return Value
[Double][1]
The value of the column.
#### Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type [DbDataReader][3]. When you use instance method syntax to call this method, omit the first parameter. For more information, see [Extension Methods (Visual Basic)][5] or [Extension Methods (C# Programming Guide)][6].
See Also
--------
#### Reference
[Extensions Class][7]
[DbExtensions Namespace][2]
[1]: https://learn.microsoft.com/dotnet/api/system.double
[2]: ../README.md
[3]: https://learn.microsoft.com/dotnet/api/system.data.common.dbdatareader
[4]: https://learn.microsoft.com/dotnet/api/system.string
[5]: https://docs.microsoft.com/dotnet/visual-basic/programming-guide/language-features/procedures/extension-methods
[6]: https://docs.microsoft.com/dotnet/csharp/programming-guide/classes-and-structs/extension-methods
[7]: README.md
================================================
FILE: docs/api/DbExtensions/Extensions/GetFloat.md
================================================
Extensions.GetFloat Method
==========================
Gets the value of the specified column as a [Single][1].
**Namespace:** [DbExtensions][2]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public static float GetFloat(
this DbDataReader reader,
string name
)
```
#### Parameters
##### *reader* [DbDataReader][3]
The data reader.
##### *name* [String][4]
The name of the column to find.
#### Return Value
[Single][1]
The value of the column.
#### Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type [DbDataReader][3]. When you use instance method syntax to call this method, omit the first parameter. For more information, see [Extension Methods (Visual Basic)][5] or [Extension Methods (C# Programming Guide)][6].
See Also
--------
#### Reference
[Extensions Class][7]
[DbExtensions Namespace][2]
[1]: https://learn.microsoft.com/dotnet/api/system.single
[2]: ../README.md
[3]: https://learn.microsoft.com/dotnet/api/system.data.common.dbdatareader
[4]: https://learn.microsoft.com/dotnet/api/system.string
[5]: https://docs.microsoft.com/dotnet/visual-basic/programming-guide/language-features/procedures/extension-methods
[6]: https://docs.microsoft.com/dotnet/csharp/programming-guide/classes-and-structs/extension-methods
[7]: README.md
================================================
FILE: docs/api/DbExtensions/Extensions/GetInt16.md
================================================
Extensions.GetInt16 Method
==========================
Gets the value of the specified column as an [Int16][1].
**Namespace:** [DbExtensions][2]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public static short GetInt16(
this DbDataReader reader,
string name
)
```
#### Parameters
##### *reader* [DbDataReader][3]
The data reader.
##### *name* [String][4]
The name of the column to find.
#### Return Value
[Int16][1]
The value of the column.
#### Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type [DbDataReader][3]. When you use instance method syntax to call this method, omit the first parameter. For more information, see [Extension Methods (Visual Basic)][5] or [Extension Methods (C# Programming Guide)][6].
See Also
--------
#### Reference
[Extensions Class][7]
[DbExtensions Namespace][2]
[1]: https://learn.microsoft.com/dotnet/api/system.int16
[2]: ../README.md
[3]: https://learn.microsoft.com/dotnet/api/system.data.common.dbdatareader
[4]: https://learn.microsoft.com/dotnet/api/system.string
[5]: https://docs.microsoft.com/dotnet/visual-basic/programming-guide/language-features/procedures/extension-methods
[6]: https://docs.microsoft.com/dotnet/csharp/programming-guide/classes-and-structs/extension-methods
[7]: README.md
================================================
FILE: docs/api/DbExtensions/Extensions/GetInt32.md
================================================
Extensions.GetInt32 Method
==========================
Gets the value of the specified column as an [Int32][1].
**Namespace:** [DbExtensions][2]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public static int GetInt32(
this DbDataReader reader,
string name
)
```
#### Parameters
##### *reader* [DbDataReader][3]
The data reader.
##### *name* [String][4]
The name of the column to find.
#### Return Value
[Int32][1]
The value of the column.
#### Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type [DbDataReader][3]. When you use instance method syntax to call this method, omit the first parameter. For more information, see [Extension Methods (Visual Basic)][5] or [Extension Methods (C# Programming Guide)][6].
See Also
--------
#### Reference
[Extensions Class][7]
[DbExtensions Namespace][2]
[1]: https://learn.microsoft.com/dotnet/api/system.int32
[2]: ../README.md
[3]: https://learn.microsoft.com/dotnet/api/system.data.common.dbdatareader
[4]: https://learn.microsoft.com/dotnet/api/system.string
[5]: https://docs.microsoft.com/dotnet/visual-basic/programming-guide/language-features/procedures/extension-methods
[6]: https://docs.microsoft.com/dotnet/csharp/programming-guide/classes-and-structs/extension-methods
[7]: README.md
================================================
FILE: docs/api/DbExtensions/Extensions/GetInt64.md
================================================
Extensions.GetInt64 Method
==========================
Gets the value of the specified column as an [Int64][1].
**Namespace:** [DbExtensions][2]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public static long GetInt64(
this DbDataReader reader,
string name
)
```
#### Parameters
##### *reader* [DbDataReader][3]
The data reader.
##### *name* [String][4]
The name of the column to find.
#### Return Value
[Int64][1]
The value of the column.
#### Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type [DbDataReader][3]. When you use instance method syntax to call this method, omit the first parameter. For more information, see [Extension Methods (Visual Basic)][5] or [Extension Methods (C# Programming Guide)][6].
See Also
--------
#### Reference
[Extensions Class][7]
[DbExtensions Namespace][2]
[1]: https://learn.microsoft.com/dotnet/api/system.int64
[2]: ../README.md
[3]: https://learn.microsoft.com/dotnet/api/system.data.common.dbdatareader
[4]: https://learn.microsoft.com/dotnet/api/system.string
[5]: https://docs.microsoft.com/dotnet/visual-basic/programming-guide/language-features/procedures/extension-methods
[6]: https://docs.microsoft.com/dotnet/csharp/programming-guide/classes-and-structs/extension-methods
[7]: README.md
================================================
FILE: docs/api/DbExtensions/Extensions/GetNullableBoolean.md
================================================
Extensions.GetNullableBoolean(DbDataReader, Int32) Method
=========================================================
Gets the value of the specified column as a [Nullable<T>][1] of [Boolean][2].
**Namespace:** [DbExtensions][3]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| --------------------------------------------- | -------------------------------------------------------------------------------- |
| **GetNullableBoolean(DbDataReader, Int32)** | Gets the value of the specified column as a [Nullable<T>][1] of [Boolean][2]. |
| [GetNullableBoolean(DbDataReader, String)][4] | Gets the value of the specified column as a [Nullable<T>][1] of [Boolean][2]. |
Syntax
------
```csharp
public static bool? GetNullableBoolean(
this DbDataReader reader,
int i
)
```
#### Parameters
##### *reader* [DbDataReader][5]
The data reader.
##### *i* [Int32][6]
The zero-based column ordinal.
#### Return Value
[Nullable][1]<[Boolean][2]>
The value of the column.
#### Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type [DbDataReader][5]. When you use instance method syntax to call this method, omit the first parameter. For more information, see [Extension Methods (Visual Basic)][7] or [Extension Methods (C# Programming Guide)][8].
See Also
--------
#### Reference
[Extensions Class][9]
[DbExtensions Namespace][3]
[1]: https://learn.microsoft.com/dotnet/api/system.nullable-1
[2]: https://learn.microsoft.com/dotnet/api/system.boolean
[3]: ../README.md
[4]: GetNullableBoolean_1.md
[5]: https://learn.microsoft.com/dotnet/api/system.data.common.dbdatareader
[6]: https://learn.microsoft.com/dotnet/api/system.int32
[7]: https://docs.microsoft.com/dotnet/visual-basic/programming-guide/language-features/procedures/extension-methods
[8]: https://docs.microsoft.com/dotnet/csharp/programming-guide/classes-and-structs/extension-methods
[9]: README.md
================================================
FILE: docs/api/DbExtensions/Extensions/GetNullableBoolean_1.md
================================================
Extensions.GetNullableBoolean(DbDataReader, String) Method
==========================================================
Gets the value of the specified column as a [Nullable<T>][1] of [Boolean][2].
**Namespace:** [DbExtensions][3]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| -------------------------------------------- | -------------------------------------------------------------------------------- |
| [GetNullableBoolean(DbDataReader, Int32)][4] | Gets the value of the specified column as a [Nullable<T>][1] of [Boolean][2]. |
| **GetNullableBoolean(DbDataReader, String)** | Gets the value of the specified column as a [Nullable<T>][1] of [Boolean][2]. |
Syntax
------
```csharp
public static bool? GetNullableBoolean(
this DbDataReader reader,
string name
)
```
#### Parameters
##### *reader* [DbDataReader][5]
The data reader.
##### *name* [String][6]
The name of the column to find.
#### Return Value
[Nullable][1]<[Boolean][2]>
The value of the column.
#### Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type [DbDataReader][5]. When you use instance method syntax to call this method, omit the first parameter. For more information, see [Extension Methods (Visual Basic)][7] or [Extension Methods (C# Programming Guide)][8].
See Also
--------
#### Reference
[Extensions Class][9]
[DbExtensions Namespace][3]
[1]: https://learn.microsoft.com/dotnet/api/system.nullable-1
[2]: https://learn.microsoft.com/dotnet/api/system.boolean
[3]: ../README.md
[4]: GetNullableBoolean.md
[5]: https://learn.microsoft.com/dotnet/api/system.data.common.dbdatareader
[6]: https://learn.microsoft.com/dotnet/api/system.string
[7]: https://docs.microsoft.com/dotnet/visual-basic/programming-guide/language-features/procedures/extension-methods
[8]: https://docs.microsoft.com/dotnet/csharp/programming-guide/classes-and-structs/extension-methods
[9]: README.md
================================================
FILE: docs/api/DbExtensions/Extensions/GetNullableByte.md
================================================
Extensions.GetNullableByte(DbDataReader, Int32) Method
======================================================
Gets the value of the specified column as a [Nullable<T>][1] of [Byte][2].
**Namespace:** [DbExtensions][3]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ------------------------------------------ | ----------------------------------------------------------------------------- |
| **GetNullableByte(DbDataReader, Int32)** | Gets the value of the specified column as a [Nullable<T>][1] of [Byte][2]. |
| [GetNullableByte(DbDataReader, String)][4] | Gets the value of the specified column as a [Nullable<T>][1] of [Byte][2]. |
Syntax
------
```csharp
public static byte? GetNullableByte(
this DbDataReader reader,
int i
)
```
#### Parameters
##### *reader* [DbDataReader][5]
The data reader.
##### *i* [Int32][6]
The zero-based column ordinal.
#### Return Value
[Nullable][1]<[Byte][2]>
The value of the column.
#### Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type [DbDataReader][5]. When you use instance method syntax to call this method, omit the first parameter. For more information, see [Extension Methods (Visual Basic)][7] or [Extension Methods (C# Programming Guide)][8].
See Also
--------
#### Reference
[Extensions Class][9]
[DbExtensions Namespace][3]
[1]: https://learn.microsoft.com/dotnet/api/system.nullable-1
[2]: https://learn.microsoft.com/dotnet/api/system.byte
[3]: ../README.md
[4]: GetNullableByte_1.md
[5]: https://learn.microsoft.com/dotnet/api/system.data.common.dbdatareader
[6]: https://learn.microsoft.com/dotnet/api/system.int32
[7]: https://docs.microsoft.com/dotnet/visual-basic/programming-guide/language-features/procedures/extension-methods
[8]: https://docs.microsoft.com/dotnet/csharp/programming-guide/classes-and-structs/extension-methods
[9]: README.md
================================================
FILE: docs/api/DbExtensions/Extensions/GetNullableByte_1.md
================================================
Extensions.GetNullableByte(DbDataReader, String) Method
=======================================================
Gets the value of the specified column as a [Nullable<T>][1] of [Byte][2].
**Namespace:** [DbExtensions][3]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ----------------------------------------- | ----------------------------------------------------------------------------- |
| [GetNullableByte(DbDataReader, Int32)][4] | Gets the value of the specified column as a [Nullable<T>][1] of [Byte][2]. |
| **GetNullableByte(DbDataReader, String)** | Gets the value of the specified column as a [Nullable<T>][1] of [Byte][2]. |
Syntax
------
```csharp
public static byte? GetNullableByte(
this DbDataReader reader,
string name
)
```
#### Parameters
##### *reader* [DbDataReader][5]
The data reader.
##### *name* [String][6]
The name of the column to find.
#### Return Value
[Nullable][1]<[Byte][2]>
The value of the column.
#### Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type [DbDataReader][5]. When you use instance method syntax to call this method, omit the first parameter. For more information, see [Extension Methods (Visual Basic)][7] or [Extension Methods (C# Programming Guide)][8].
See Also
--------
#### Reference
[Extensions Class][9]
[DbExtensions Namespace][3]
[1]: https://learn.microsoft.com/dotnet/api/system.nullable-1
[2]: https://learn.microsoft.com/dotnet/api/system.byte
[3]: ../README.md
[4]: GetNullableByte.md
[5]: https://learn.microsoft.com/dotnet/api/system.data.common.dbdatareader
[6]: https://learn.microsoft.com/dotnet/api/system.string
[7]: https://docs.microsoft.com/dotnet/visual-basic/programming-guide/language-features/procedures/extension-methods
[8]: https://docs.microsoft.com/dotnet/csharp/programming-guide/classes-and-structs/extension-methods
[9]: README.md
================================================
FILE: docs/api/DbExtensions/Extensions/GetNullableChar.md
================================================
Extensions.GetNullableChar(DbDataReader, Int32) Method
======================================================
Gets the value of the specified column as a [Nullable<T>][1] of [Char][2].
**Namespace:** [DbExtensions][3]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ------------------------------------------ | ----------------------------------------------------------------------------- |
| **GetNullableChar(DbDataReader, Int32)** | Gets the value of the specified column as a [Nullable<T>][1] of [Char][2]. |
| [GetNullableChar(DbDataReader, String)][4] | Gets the value of the specified column as a [Nullable<T>][1] of [Char][2]. |
Syntax
------
```csharp
public static char? GetNullableChar(
this DbDataReader reader,
int i
)
```
#### Parameters
##### *reader* [DbDataReader][5]
The data reader.
##### *i* [Int32][6]
The zero-based column ordinal.
#### Return Value
[Nullable][1]<[Char][2]>
The value of the column.
#### Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type [DbDataReader][5]. When you use instance method syntax to call this method, omit the first parameter. For more information, see [Extension Methods (Visual Basic)][7] or [Extension Methods (C# Programming Guide)][8].
See Also
--------
#### Reference
[Extensions Class][9]
[DbExtensions Namespace][3]
[1]: https://learn.microsoft.com/dotnet/api/system.nullable-1
[2]: https://learn.microsoft.com/dotnet/api/system.char
[3]: ../README.md
[4]: GetNullableChar_1.md
[5]: https://learn.microsoft.com/dotnet/api/system.data.common.dbdatareader
[6]: https://learn.microsoft.com/dotnet/api/system.int32
[7]: https://docs.microsoft.com/dotnet/visual-basic/programming-guide/language-features/procedures/extension-methods
[8]: https://docs.microsoft.com/dotnet/csharp/programming-guide/classes-and-structs/extension-methods
[9]: README.md
================================================
FILE: docs/api/DbExtensions/Extensions/GetNullableChar_1.md
================================================
Extensions.GetNullableChar(DbDataReader, String) Method
=======================================================
Gets the value of the specified column as a [Nullable<T>][1] of [Char][2].
**Namespace:** [DbExtensions][3]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ----------------------------------------- | ----------------------------------------------------------------------------- |
| [GetNullableChar(DbDataReader, Int32)][4] | Gets the value of the specified column as a [Nullable<T>][1] of [Char][2]. |
| **GetNullableChar(DbDataReader, String)** | Gets the value of the specified column as a [Nullable<T>][1] of [Char][2]. |
Syntax
------
```csharp
public static char? GetNullableChar(
this DbDataReader reader,
string name
)
```
#### Parameters
##### *reader* [DbDataReader][5]
The data reader.
##### *name* [String][6]
The name of the column to find.
#### Return Value
[Nullable][1]<[Char][2]>
The value of the column.
#### Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type [DbDataReader][5]. When you use instance method syntax to call this method, omit the first parameter. For more information, see [Extension Methods (Visual Basic)][7] or [Extension Methods (C# Programming Guide)][8].
See Also
--------
#### Reference
[Extensions Class][9]
[DbExtensions Namespace][3]
[1]: https://learn.microsoft.com/dotnet/api/system.nullable-1
[2]: https://learn.microsoft.com/dotnet/api/system.char
[3]: ../README.md
[4]: GetNullableChar.md
[5]: https://learn.microsoft.com/dotnet/api/system.data.common.dbdatareader
[6]: https://learn.microsoft.com/dotnet/api/system.string
[7]: https://docs.microsoft.com/dotnet/visual-basic/programming-guide/language-features/procedures/extension-methods
[8]: https://docs.microsoft.com/dotnet/csharp/programming-guide/classes-and-structs/extension-methods
[9]: README.md
================================================
FILE: docs/api/DbExtensions/Extensions/GetNullableDateTime.md
================================================
Extensions.GetNullableDateTime(DbDataReader, Int32) Method
==========================================================
Gets the value of the specified column as a [Nullable<T>][1] of [DateTime][2].
**Namespace:** [DbExtensions][3]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ---------------------------------------------- | --------------------------------------------------------------------------------- |
| **GetNullableDateTime(DbDataReader, Int32)** | Gets the value of the specified column as a [Nullable<T>][1] of [DateTime][2]. |
| [GetNullableDateTime(DbDataReader, String)][4] | Gets the value of the specified column as a [Nullable<T>][1] of [DateTime][2]. |
Syntax
------
```csharp
public static DateTime? GetNullableDateTime(
this DbDataReader reader,
int i
)
```
#### Parameters
##### *reader* [DbDataReader][5]
The data reader.
##### *i* [Int32][6]
The zero-based column ordinal.
#### Return Value
[Nullable][1]<[DateTime][2]>
The value of the column.
#### Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type [DbDataReader][5]. When you use instance method syntax to call this method, omit the first parameter. For more information, see [Extension Methods (Visual Basic)][7] or [Extension Methods (C# Programming Guide)][8].
See Also
--------
#### Reference
[Extensions Class][9]
[DbExtensions Namespace][3]
[1]: https://learn.microsoft.com/dotnet/api/system.nullable-1
[2]: https://learn.microsoft.com/dotnet/api/system.datetime
[3]: ../README.md
[4]: GetNullableDateTime_1.md
[5]: https://learn.microsoft.com/dotnet/api/system.data.common.dbdatareader
[6]: https://learn.microsoft.com/dotnet/api/system.int32
[7]: https://docs.microsoft.com/dotnet/visual-basic/programming-guide/language-features/procedures/extension-methods
[8]: https://docs.microsoft.com/dotnet/csharp/programming-guide/classes-and-structs/extension-methods
[9]: README.md
================================================
FILE: docs/api/DbExtensions/Extensions/GetNullableDateTime_1.md
================================================
Extensions.GetNullableDateTime(DbDataReader, String) Method
===========================================================
Gets the value of the specified column as a [Nullable<T>][1] of [DateTime][2].
**Namespace:** [DbExtensions][3]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| --------------------------------------------- | --------------------------------------------------------------------------------- |
| [GetNullableDateTime(DbDataReader, Int32)][4] | Gets the value of the specified column as a [Nullable<T>][1] of [DateTime][2]. |
| **GetNullableDateTime(DbDataReader, String)** | Gets the value of the specified column as a [Nullable<T>][1] of [DateTime][2]. |
Syntax
------
```csharp
public static DateTime? GetNullableDateTime(
this DbDataReader reader,
string name
)
```
#### Parameters
##### *reader* [DbDataReader][5]
The data reader.
##### *name* [String][6]
The name of the column to find.
#### Return Value
[Nullable][1]<[DateTime][2]>
The value of the column.
#### Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type [DbDataReader][5]. When you use instance method syntax to call this method, omit the first parameter. For more information, see [Extension Methods (Visual Basic)][7] or [Extension Methods (C# Programming Guide)][8].
See Also
--------
#### Reference
[Extensions Class][9]
[DbExtensions Namespace][3]
[1]: https://learn.microsoft.com/dotnet/api/system.nullable-1
[2]: https://learn.microsoft.com/dotnet/api/system.datetime
[3]: ../README.md
[4]: GetNullableDateTime.md
[5]: https://learn.microsoft.com/dotnet/api/system.data.common.dbdatareader
[6]: https://learn.microsoft.com/dotnet/api/system.string
[7]: https://docs.microsoft.com/dotnet/visual-basic/programming-guide/language-features/procedures/extension-methods
[8]: https://docs.microsoft.com/dotnet/csharp/programming-guide/classes-and-structs/extension-methods
[9]: README.md
================================================
FILE: docs/api/DbExtensions/Extensions/GetNullableDecimal.md
================================================
Extensions.GetNullableDecimal(DbDataReader, Int32) Method
=========================================================
Gets the value of the specified column as a [Nullable<T>][1] of [Decimal][2].
**Namespace:** [DbExtensions][3]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| --------------------------------------------- | -------------------------------------------------------------------------------- |
| **GetNullableDecimal(DbDataReader, Int32)** | Gets the value of the specified column as a [Nullable<T>][1] of [Decimal][2]. |
| [GetNullableDecimal(DbDataReader, String)][4] | Gets the value of the specified column as a [Nullable<T>][1] of [Decimal][2]. |
Syntax
------
```csharp
public static decimal? GetNullableDecimal(
this DbDataReader reader,
int i
)
```
#### Parameters
##### *reader* [DbDataReader][5]
The data reader.
##### *i* [Int32][6]
The zero-based column ordinal.
#### Return Value
[Nullable][1]<[Decimal][2]>
The value of the column.
#### Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type [DbDataReader][5]. When you use instance method syntax to call this method, omit the first parameter. For more information, see [Extension Methods (Visual Basic)][7] or [Extension Methods (C# Programming Guide)][8].
See Also
--------
#### Reference
[Extensions Class][9]
[DbExtensions Namespace][3]
[1]: https://learn.microsoft.com/dotnet/api/system.nullable-1
[2]: https://learn.microsoft.com/dotnet/api/system.decimal
[3]: ../README.md
[4]: GetNullableDecimal_1.md
[5]: https://learn.microsoft.com/dotnet/api/system.data.common.dbdatareader
[6]: https://learn.microsoft.com/dotnet/api/system.int32
[7]: https://docs.microsoft.com/dotnet/visual-basic/programming-guide/language-features/procedures/extension-methods
[8]: https://docs.microsoft.com/dotnet/csharp/programming-guide/classes-and-structs/extension-methods
[9]: README.md
================================================
FILE: docs/api/DbExtensions/Extensions/GetNullableDecimal_1.md
================================================
Extensions.GetNullableDecimal(DbDataReader, String) Method
==========================================================
Gets the value of the specified column as a [Nullable<T>][1] of [Decimal][2].
**Namespace:** [DbExtensions][3]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| -------------------------------------------- | -------------------------------------------------------------------------------- |
| [GetNullableDecimal(DbDataReader, Int32)][4] | Gets the value of the specified column as a [Nullable<T>][1] of [Decimal][2]. |
| **GetNullableDecimal(DbDataReader, String)** | Gets the value of the specified column as a [Nullable<T>][1] of [Decimal][2]. |
Syntax
------
```csharp
public static decimal? GetNullableDecimal(
this DbDataReader reader,
string name
)
```
#### Parameters
##### *reader* [DbDataReader][5]
The data reader.
##### *name* [String][6]
The name of the column to find.
#### Return Value
[Nullable][1]<[Decimal][2]>
The value of the column.
#### Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type [DbDataReader][5]. When you use instance method syntax to call this method, omit the first parameter. For more information, see [Extension Methods (Visual Basic)][7] or [Extension Methods (C# Programming Guide)][8].
See Also
--------
#### Reference
[Extensions Class][9]
[DbExtensions Namespace][3]
[1]: https://learn.microsoft.com/dotnet/api/system.nullable-1
[2]: https://learn.microsoft.com/dotnet/api/system.decimal
[3]: ../README.md
[4]: GetNullableDecimal.md
[5]: https://learn.microsoft.com/dotnet/api/system.data.common.dbdatareader
[6]: https://learn.microsoft.com/dotnet/api/system.string
[7]: https://docs.microsoft.com/dotnet/visual-basic/programming-guide/language-features/procedures/extension-methods
[8]: https://docs.microsoft.com/dotnet/csharp/programming-guide/classes-and-structs/extension-methods
[9]: README.md
================================================
FILE: docs/api/DbExtensions/Extensions/GetNullableDouble.md
================================================
Extensions.GetNullableDouble(DbDataReader, Int32) Method
========================================================
Gets the value of the specified column as a [Nullable<T>][1] of [Double][2].
**Namespace:** [DbExtensions][3]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| -------------------------------------------- | ------------------------------------------------------------------------------- |
| **GetNullableDouble(DbDataReader, Int32)** | Gets the value of the specified column as a [Nullable<T>][1] of [Double][2]. |
| [GetNullableDouble(DbDataReader, String)][4] | Gets the value of the specified column as a [Nullable<T>][1] of [Double][2]. |
Syntax
------
```csharp
public static double? GetNullableDouble(
this DbDataReader reader,
int i
)
```
#### Parameters
##### *reader* [DbDataReader][5]
The data reader.
##### *i* [Int32][6]
The zero-based column ordinal.
#### Return Value
[Nullable][1]<[Double][2]>
The value of the column.
#### Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type [DbDataReader][5]. When you use instance method syntax to call this method, omit the first parameter. For more information, see [Extension Methods (Visual Basic)][7] or [Extension Methods (C# Programming Guide)][8].
See Also
--------
#### Reference
[Extensions Class][9]
[DbExtensions Namespace][3]
[1]: https://learn.microsoft.com/dotnet/api/system.nullable-1
[2]: https://learn.microsoft.com/dotnet/api/system.double
[3]: ../README.md
[4]: GetNullableDouble_1.md
[5]: https://learn.microsoft.com/dotnet/api/system.data.common.dbdatareader
[6]: https://learn.microsoft.com/dotnet/api/system.int32
[7]: https://docs.microsoft.com/dotnet/visual-basic/programming-guide/language-features/procedures/extension-methods
[8]: https://docs.microsoft.com/dotnet/csharp/programming-guide/classes-and-structs/extension-methods
[9]: README.md
================================================
FILE: docs/api/DbExtensions/Extensions/GetNullableDouble_1.md
================================================
Extensions.GetNullableDouble(DbDataReader, String) Method
=========================================================
Gets the value of the specified column as a [Nullable<T>][1] of [Double][2].
**Namespace:** [DbExtensions][3]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ------------------------------------------- | ------------------------------------------------------------------------------- |
| [GetNullableDouble(DbDataReader, Int32)][4] | Gets the value of the specified column as a [Nullable<T>][1] of [Double][2]. |
| **GetNullableDouble(DbDataReader, String)** | Gets the value of the specified column as a [Nullable<T>][1] of [Double][2]. |
Syntax
------
```csharp
public static double? GetNullableDouble(
this DbDataReader reader,
string name
)
```
#### Parameters
##### *reader* [DbDataReader][5]
The data reader.
##### *name* [String][6]
The name of the column to find.
#### Return Value
[Nullable][1]<[Double][2]>
The value of the column.
#### Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type [DbDataReader][5]. When you use instance method syntax to call this method, omit the first parameter. For more information, see [Extension Methods (Visual Basic)][7] or [Extension Methods (C# Programming Guide)][8].
See Also
--------
#### Reference
[Extensions Class][9]
[DbExtensions Namespace][3]
[1]: https://learn.microsoft.com/dotnet/api/system.nullable-1
[2]: https://learn.microsoft.com/dotnet/api/system.double
[3]: ../README.md
[4]: GetNullableDouble.md
[5]: https://learn.microsoft.com/dotnet/api/system.data.common.dbdatareader
[6]: https://learn.microsoft.com/dotnet/api/system.string
[7]: https://docs.microsoft.com/dotnet/visual-basic/programming-guide/language-features/procedures/extension-methods
[8]: https://docs.microsoft.com/dotnet/csharp/programming-guide/classes-and-structs/extension-methods
[9]: README.md
================================================
FILE: docs/api/DbExtensions/Extensions/GetNullableFloat.md
================================================
Extensions.GetNullableFloat(DbDataReader, Int32) Method
=======================================================
Gets the value of the specified column as a [Nullable<T>][1] of [Single][2].
**Namespace:** [DbExtensions][3]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ------------------------------------------- | ------------------------------------------------------------------------------- |
| **GetNullableFloat(DbDataReader, Int32)** | Gets the value of the specified column as a [Nullable<T>][1] of [Single][2]. |
| [GetNullableFloat(DbDataReader, String)][4] | Gets the value of the specified column as a [Nullable<T>][1] of [Single][2]. |
Syntax
------
```csharp
public static float? GetNullableFloat(
this DbDataReader reader,
int i
)
```
#### Parameters
##### *reader* [DbDataReader][5]
The data reader.
##### *i* [Int32][6]
The zero-based column ordinal.
#### Return Value
[Nullable][1]<[Single][2]>
The value of the column.
#### Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type [DbDataReader][5]. When you use instance method syntax to call this method, omit the first parameter. For more information, see [Extension Methods (Visual Basic)][7] or [Extension Methods (C# Programming Guide)][8].
See Also
--------
#### Reference
[Extensions Class][9]
[DbExtensions Namespace][3]
[1]: https://learn.microsoft.com/dotnet/api/system.nullable-1
[2]: https://learn.microsoft.com/dotnet/api/system.single
[3]: ../README.md
[4]: GetNullableFloat_1.md
[5]: https://learn.microsoft.com/dotnet/api/system.data.common.dbdatareader
[6]: https://learn.microsoft.com/dotnet/api/system.int32
[7]: https://docs.microsoft.com/dotnet/visual-basic/programming-guide/language-features/procedures/extension-methods
[8]: https://docs.microsoft.com/dotnet/csharp/programming-guide/classes-and-structs/extension-methods
[9]: README.md
================================================
FILE: docs/api/DbExtensions/Extensions/GetNullableFloat_1.md
================================================
Extensions.GetNullableFloat(DbDataReader, String) Method
========================================================
Gets the value of the specified column as a [Nullable<T>][1] of [Single][2].
**Namespace:** [DbExtensions][3]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ------------------------------------------ | ------------------------------------------------------------------------------- |
| [GetNullableFloat(DbDataReader, Int32)][4] | Gets the value of the specified column as a [Nullable<T>][1] of [Single][2]. |
| **GetNullableFloat(DbDataReader, String)** | Gets the value of the specified column as a [Nullable<T>][1] of [Single][2]. |
Syntax
------
```csharp
public static float? GetNullableFloat(
this DbDataReader reader,
string name
)
```
#### Parameters
##### *reader* [DbDataReader][5]
The data reader.
##### *name* [String][6]
The name of the column to find.
#### Return Value
[Nullable][1]<[Single][2]>
The value of the column.
#### Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type [DbDataReader][5]. When you use instance method syntax to call this method, omit the first parameter. For more information, see [Extension Methods (Visual Basic)][7] or [Extension Methods (C# Programming Guide)][8].
See Also
--------
#### Reference
[Extensions Class][9]
[DbExtensions Namespace][3]
[1]: https://learn.microsoft.com/dotnet/api/system.nullable-1
[2]: https://learn.microsoft.com/dotnet/api/system.single
[3]: ../README.md
[4]: GetNullableFloat.md
[5]: https://learn.microsoft.com/dotnet/api/system.data.common.dbdatareader
[6]: https://learn.microsoft.com/dotnet/api/system.string
[7]: https://docs.microsoft.com/dotnet/visual-basic/programming-guide/language-features/procedures/extension-methods
[8]: https://docs.microsoft.com/dotnet/csharp/programming-guide/classes-and-structs/extension-methods
[9]: README.md
================================================
FILE: docs/api/DbExtensions/Extensions/GetNullableGuid.md
================================================
Extensions.GetNullableGuid(DbDataReader, Int32) Method
======================================================
Gets the value of the specified column as a [Nullable<T>][1] of [Guid][2].
**Namespace:** [DbExtensions][3]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ------------------------------------------ | ----------------------------------------------------------------------------- |
| **GetNullableGuid(DbDataReader, Int32)** | Gets the value of the specified column as a [Nullable<T>][1] of [Guid][2]. |
| [GetNullableGuid(DbDataReader, String)][4] | Gets the value of the specified column as a [Nullable<T>][1] of [Guid][2]. |
Syntax
------
```csharp
public static Guid? GetNullableGuid(
this DbDataReader reader,
int i
)
```
#### Parameters
##### *reader* [DbDataReader][5]
The data reader.
##### *i* [Int32][6]
The zero-based column ordinal.
#### Return Value
[Nullable][1]<[Guid][2]>
The value of the column.
#### Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type [DbDataReader][5]. When you use instance method syntax to call this method, omit the first parameter. For more information, see [Extension Methods (Visual Basic)][7] or [Extension Methods (C# Programming Guide)][8].
See Also
--------
#### Reference
[Extensions Class][9]
[DbExtensions Namespace][3]
[1]: https://learn.microsoft.com/dotnet/api/system.nullable-1
[2]: https://learn.microsoft.com/dotnet/api/system.guid
[3]: ../README.md
[4]: GetNullableGuid_1.md
[5]: https://learn.microsoft.com/dotnet/api/system.data.common.dbdatareader
[6]: https://learn.microsoft.com/dotnet/api/system.int32
[7]: https://docs.microsoft.com/dotnet/visual-basic/programming-guide/language-features/procedures/extension-methods
[8]: https://docs.microsoft.com/dotnet/csharp/programming-guide/classes-and-structs/extension-methods
[9]: README.md
================================================
FILE: docs/api/DbExtensions/Extensions/GetNullableGuid_1.md
================================================
Extensions.GetNullableGuid(DbDataReader, String) Method
=======================================================
Gets the value of the specified column as a [Nullable<T>][1] of [Guid][2].
**Namespace:** [DbExtensions][3]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ----------------------------------------- | ----------------------------------------------------------------------------- |
| [GetNullableGuid(DbDataReader, Int32)][4] | Gets the value of the specified column as a [Nullable<T>][1] of [Guid][2]. |
| **GetNullableGuid(DbDataReader, String)** | Gets the value of the specified column as a [Nullable<T>][1] of [Guid][2]. |
Syntax
------
```csharp
public static Guid? GetNullableGuid(
this DbDataReader reader,
string name
)
```
#### Parameters
##### *reader* [DbDataReader][5]
The data reader.
##### *name* [String][6]
The name of the column to find.
#### Return Value
[Nullable][1]<[Guid][2]>
The value of the column.
#### Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type [DbDataReader][5]. When you use instance method syntax to call this method, omit the first parameter. For more information, see [Extension Methods (Visual Basic)][7] or [Extension Methods (C# Programming Guide)][8].
See Also
--------
#### Reference
[Extensions Class][9]
[DbExtensions Namespace][3]
[1]: https://learn.microsoft.com/dotnet/api/system.nullable-1
[2]: https://learn.microsoft.com/dotnet/api/system.guid
[3]: ../README.md
[4]: GetNullableGuid.md
[5]: https://learn.microsoft.com/dotnet/api/system.data.common.dbdatareader
[6]: https://learn.microsoft.com/dotnet/api/system.string
[7]: https://docs.microsoft.com/dotnet/visual-basic/programming-guide/language-features/procedures/extension-methods
[8]: https://docs.microsoft.com/dotnet/csharp/programming-guide/classes-and-structs/extension-methods
[9]: README.md
================================================
FILE: docs/api/DbExtensions/Extensions/GetNullableInt16.md
================================================
Extensions.GetNullableInt16(DbDataReader, Int32) Method
=======================================================
Gets the value of the specified column as a [Nullable<T>][1] of [Int16][2].
**Namespace:** [DbExtensions][3]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ------------------------------------------- | ------------------------------------------------------------------------------ |
| **GetNullableInt16(DbDataReader, Int32)** | Gets the value of the specified column as a [Nullable<T>][1] of [Int16][2]. |
| [GetNullableInt16(DbDataReader, String)][4] | Gets the value of the specified column as a [Nullable<T>][1] of [Int16][2]. |
Syntax
------
```csharp
public static short? GetNullableInt16(
this DbDataReader reader,
int i
)
```
#### Parameters
##### *reader* [DbDataReader][5]
The data reader.
##### *i* [Int32][6]
The zero-based column ordinal.
#### Return Value
[Nullable][1]<[Int16][2]>
The value of the column.
#### Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type [DbDataReader][5]. When you use instance method syntax to call this method, omit the first parameter. For more information, see [Extension Methods (Visual Basic)][7] or [Extension Methods (C# Programming Guide)][8].
See Also
--------
#### Reference
[Extensions Class][9]
[DbExtensions Namespace][3]
[1]: https://learn.microsoft.com/dotnet/api/system.nullable-1
[2]: https://learn.microsoft.com/dotnet/api/system.int16
[3]: ../README.md
[4]: GetNullableInt16_1.md
[5]: https://learn.microsoft.com/dotnet/api/system.data.common.dbdatareader
[6]: https://learn.microsoft.com/dotnet/api/system.int32
[7]: https://docs.microsoft.com/dotnet/visual-basic/programming-guide/language-features/procedures/extension-methods
[8]: https://docs.microsoft.com/dotnet/csharp/programming-guide/classes-and-structs/extension-methods
[9]: README.md
================================================
FILE: docs/api/DbExtensions/Extensions/GetNullableInt16_1.md
================================================
Extensions.GetNullableInt16(DbDataReader, String) Method
========================================================
Gets the value of the specified column as a [Nullable<T>][1] of [Int16][2].
**Namespace:** [DbExtensions][3]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ------------------------------------------ | ------------------------------------------------------------------------------ |
| [GetNullableInt16(DbDataReader, Int32)][4] | Gets the value of the specified column as a [Nullable<T>][1] of [Int16][2]. |
| **GetNullableInt16(DbDataReader, String)** | Gets the value of the specified column as a [Nullable<T>][1] of [Int16][2]. |
Syntax
------
```csharp
public static short? GetNullableInt16(
this DbDataReader reader,
string name
)
```
#### Parameters
##### *reader* [DbDataReader][5]
The data reader.
##### *name* [String][6]
The name of the column to find.
#### Return Value
[Nullable][1]<[Int16][2]>
The value of the column.
#### Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type [DbDataReader][5]. When you use instance method syntax to call this method, omit the first parameter. For more information, see [Extension Methods (Visual Basic)][7] or [Extension Methods (C# Programming Guide)][8].
See Also
--------
#### Reference
[Extensions Class][9]
[DbExtensions Namespace][3]
[1]: https://learn.microsoft.com/dotnet/api/system.nullable-1
[2]: https://learn.microsoft.com/dotnet/api/system.int16
[3]: ../README.md
[4]: GetNullableInt16.md
[5]: https://learn.microsoft.com/dotnet/api/system.data.common.dbdatareader
[6]: https://learn.microsoft.com/dotnet/api/system.string
[7]: https://docs.microsoft.com/dotnet/visual-basic/programming-guide/language-features/procedures/extension-methods
[8]: https://docs.microsoft.com/dotnet/csharp/programming-guide/classes-and-structs/extension-methods
[9]: README.md
================================================
FILE: docs/api/DbExtensions/Extensions/GetNullableInt32.md
================================================
Extensions.GetNullableInt32(DbDataReader, Int32) Method
=======================================================
Gets the value of the specified column as a [Nullable<T>][1] of [Int32][2].
**Namespace:** [DbExtensions][3]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ------------------------------------------- | ------------------------------------------------------------------------------ |
| **GetNullableInt32(DbDataReader, Int32)** | Gets the value of the specified column as a [Nullable<T>][1] of [Int32][2]. |
| [GetNullableInt32(DbDataReader, String)][4] | Gets the value of the specified column as a [Nullable<T>][1] of [Int32][2]. |
Syntax
------
```csharp
public static int? GetNullableInt32(
this DbDataReader reader,
int i
)
```
#### Parameters
##### *reader* [DbDataReader][5]
The data reader.
##### *i* [Int32][2]
The zero-based column ordinal.
#### Return Value
[Nullable][1]<[Int32][2]>
The value of the column.
#### Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type [DbDataReader][5]. When you use instance method syntax to call this method, omit the first parameter. For more information, see [Extension Methods (Visual Basic)][6] or [Extension Methods (C# Programming Guide)][7].
See Also
--------
#### Reference
[Extensions Class][8]
[DbExtensions Namespace][3]
[1]: https://learn.microsoft.com/dotnet/api/system.nullable-1
[2]: https://learn.microsoft.com/dotnet/api/system.int32
[3]: ../README.md
[4]: GetNullableInt32_1.md
[5]: https://learn.microsoft.com/dotnet/api/system.data.common.dbdatareader
[6]: https://docs.microsoft.com/dotnet/visual-basic/programming-guide/language-features/procedures/extension-methods
[7]: https://docs.microsoft.com/dotnet/csharp/programming-guide/classes-and-structs/extension-methods
[8]: README.md
================================================
FILE: docs/api/DbExtensions/Extensions/GetNullableInt32_1.md
================================================
Extensions.GetNullableInt32(DbDataReader, String) Method
========================================================
Gets the value of the specified column as a [Nullable<T>][1] of [Int32][2].
**Namespace:** [DbExtensions][3]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ------------------------------------------ | ------------------------------------------------------------------------------ |
| [GetNullableInt32(DbDataReader, Int32)][4] | Gets the value of the specified column as a [Nullable<T>][1] of [Int32][2]. |
| **GetNullableInt32(DbDataReader, String)** | Gets the value of the specified column as a [Nullable<T>][1] of [Int32][2]. |
Syntax
------
```csharp
public static int? GetNullableInt32(
this DbDataReader reader,
string name
)
```
#### Parameters
##### *reader* [DbDataReader][5]
The data reader.
##### *name* [String][6]
The name of the column to find.
#### Return Value
[Nullable][1]<[Int32][2]>
The value of the column.
#### Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type [DbDataReader][5]. When you use instance method syntax to call this method, omit the first parameter. For more information, see [Extension Methods (Visual Basic)][7] or [Extension Methods (C# Programming Guide)][8].
See Also
--------
#### Reference
[Extensions Class][9]
[DbExtensions Namespace][3]
[1]: https://learn.microsoft.com/dotnet/api/system.nullable-1
[2]: https://learn.microsoft.com/dotnet/api/system.int32
[3]: ../README.md
[4]: GetNullableInt32.md
[5]: https://learn.microsoft.com/dotnet/api/system.data.common.dbdatareader
[6]: https://learn.microsoft.com/dotnet/api/system.string
[7]: https://docs.microsoft.com/dotnet/visual-basic/programming-guide/language-features/procedures/extension-methods
[8]: https://docs.microsoft.com/dotnet/csharp/programming-guide/classes-and-structs/extension-methods
[9]: README.md
================================================
FILE: docs/api/DbExtensions/Extensions/GetNullableInt64.md
================================================
Extensions.GetNullableInt64(DbDataReader, Int32) Method
=======================================================
Gets the value of the specified column as a [Nullable<T>][1] of [Int64][2].
**Namespace:** [DbExtensions][3]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ------------------------------------------- | ------------------------------------------------------------------------------ |
| **GetNullableInt64(DbDataReader, Int32)** | Gets the value of the specified column as a [Nullable<T>][1] of [Int64][2]. |
| [GetNullableInt64(DbDataReader, String)][4] | Gets the value of the specified column as a [Nullable<T>][1] of [Int64][2]. |
Syntax
------
```csharp
public static long? GetNullableInt64(
this DbDataReader reader,
int i
)
```
#### Parameters
##### *reader* [DbDataReader][5]
The data reader.
##### *i* [Int32][6]
The zero-based column ordinal.
#### Return Value
[Nullable][1]<[Int64][2]>
The value of the column.
#### Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type [DbDataReader][5]. When you use instance method syntax to call this method, omit the first parameter. For more information, see [Extension Methods (Visual Basic)][7] or [Extension Methods (C# Programming Guide)][8].
See Also
--------
#### Reference
[Extensions Class][9]
[DbExtensions Namespace][3]
[1]: https://learn.microsoft.com/dotnet/api/system.nullable-1
[2]: https://learn.microsoft.com/dotnet/api/system.int64
[3]: ../README.md
[4]: GetNullableInt64_1.md
[5]: https://learn.microsoft.com/dotnet/api/system.data.common.dbdatareader
[6]: https://learn.microsoft.com/dotnet/api/system.int32
[7]: https://docs.microsoft.com/dotnet/visual-basic/programming-guide/language-features/procedures/extension-methods
[8]: https://docs.microsoft.com/dotnet/csharp/programming-guide/classes-and-structs/extension-methods
[9]: README.md
================================================
FILE: docs/api/DbExtensions/Extensions/GetNullableInt64_1.md
================================================
Extensions.GetNullableInt64(DbDataReader, String) Method
========================================================
Gets the value of the specified column as a [Nullable<T>][1] of [Int64][2].
**Namespace:** [DbExtensions][3]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ------------------------------------------ | ------------------------------------------------------------------------------ |
| [GetNullableInt64(DbDataReader, Int32)][4] | Gets the value of the specified column as a [Nullable<T>][1] of [Int64][2]. |
| **GetNullableInt64(DbDataReader, String)** | Gets the value of the specified column as a [Nullable<T>][1] of [Int64][2]. |
Syntax
------
```csharp
public static long? GetNullableInt64(
this DbDataReader reader,
string name
)
```
#### Parameters
##### *reader* [DbDataReader][5]
The data reader.
##### *name* [String][6]
The name of the column to find.
#### Return Value
[Nullable][1]<[Int64][2]>
The value of the column.
#### Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type [DbDataReader][5]. When you use instance method syntax to call this method, omit the first parameter. For more information, see [Extension Methods (Visual Basic)][7] or [Extension Methods (C# Programming Guide)][8].
See Also
--------
#### Reference
[Extensions Class][9]
[DbExtensions Namespace][3]
[1]: https://learn.microsoft.com/dotnet/api/system.nullable-1
[2]: https://learn.microsoft.com/dotnet/api/system.int64
[3]: ../README.md
[4]: GetNullableInt64.md
[5]: https://learn.microsoft.com/dotnet/api/system.data.common.dbdatareader
[6]: https://learn.microsoft.com/dotnet/api/system.string
[7]: https://docs.microsoft.com/dotnet/visual-basic/programming-guide/language-features/procedures/extension-methods
[8]: https://docs.microsoft.com/dotnet/csharp/programming-guide/classes-and-structs/extension-methods
[9]: README.md
================================================
FILE: docs/api/DbExtensions/Extensions/GetString.md
================================================
Extensions.GetString Method
===========================
Gets the value of the specified column as a [String][1].
**Namespace:** [DbExtensions][2]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public static string GetString(
this DbDataReader reader,
string name
)
```
#### Parameters
##### *reader* [DbDataReader][3]
The data reader.
##### *name* [String][1]
The name of the column to find.
#### Return Value
[String][1]
The value of the column.
#### Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type [DbDataReader][3]. When you use instance method syntax to call this method, omit the first parameter. For more information, see [Extension Methods (Visual Basic)][4] or [Extension Methods (C# Programming Guide)][5].
See Also
--------
#### Reference
[Extensions Class][6]
[DbExtensions Namespace][2]
[1]: https://learn.microsoft.com/dotnet/api/system.string
[2]: ../README.md
[3]: https://learn.microsoft.com/dotnet/api/system.data.common.dbdatareader
[4]: https://docs.microsoft.com/dotnet/visual-basic/programming-guide/language-features/procedures/extension-methods
[5]: https://docs.microsoft.com/dotnet/csharp/programming-guide/classes-and-structs/extension-methods
[6]: README.md
================================================
FILE: docs/api/DbExtensions/Extensions/GetStringOrNull.md
================================================
Extensions.GetStringOrNull(DbDataReader, Int32) Method
======================================================
Gets the value of the specified column as a [String][1], or null (Nothing in Visual Basic).
**Namespace:** [DbExtensions][2]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ------------------------------------------ | ------------------------------------------------------------------------------------------- |
| **GetStringOrNull(DbDataReader, Int32)** | Gets the value of the specified column as a [String][1], or null (Nothing in Visual Basic). |
| [GetStringOrNull(DbDataReader, String)][3] | Gets the value of the specified column as a [String][1], or null (Nothing in Visual Basic). |
Syntax
------
```csharp
public static string? GetStringOrNull(
this DbDataReader reader,
int i
)
```
#### Parameters
##### *reader* [DbDataReader][4]
The data reader.
##### *i* [Int32][5]
The zero-based column ordinal.
#### Return Value
[String][1]
The value of the column.
#### Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type [DbDataReader][4]. When you use instance method syntax to call this method, omit the first parameter. For more information, see [Extension Methods (Visual Basic)][6] or [Extension Methods (C# Programming Guide)][7].
See Also
--------
#### Reference
[Extensions Class][8]
[DbExtensions Namespace][2]
[1]: https://learn.microsoft.com/dotnet/api/system.string
[2]: ../README.md
[3]: GetStringOrNull_1.md
[4]: https://learn.microsoft.com/dotnet/api/system.data.common.dbdatareader
[5]: https://learn.microsoft.com/dotnet/api/system.int32
[6]: https://docs.microsoft.com/dotnet/visual-basic/programming-guide/language-features/procedures/extension-methods
[7]: https://docs.microsoft.com/dotnet/csharp/programming-guide/classes-and-structs/extension-methods
[8]: README.md
================================================
FILE: docs/api/DbExtensions/Extensions/GetStringOrNull_1.md
================================================
Extensions.GetStringOrNull(DbDataReader, String) Method
=======================================================
Gets the value of the specified column as a [String][1], or null (Nothing in Visual Basic).
**Namespace:** [DbExtensions][2]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ----------------------------------------- | ------------------------------------------------------------------------------------------- |
| [GetStringOrNull(DbDataReader, Int32)][3] | Gets the value of the specified column as a [String][1], or null (Nothing in Visual Basic). |
| **GetStringOrNull(DbDataReader, String)** | Gets the value of the specified column as a [String][1], or null (Nothing in Visual Basic). |
Syntax
------
```csharp
public static string? GetStringOrNull(
this DbDataReader reader,
string name
)
```
#### Parameters
##### *reader* [DbDataReader][4]
The data reader.
##### *name* [String][1]
The name of the column to find.
#### Return Value
[String][1]
The value of the column.
#### Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type [DbDataReader][4]. When you use instance method syntax to call this method, omit the first parameter. For more information, see [Extension Methods (Visual Basic)][5] or [Extension Methods (C# Programming Guide)][6].
See Also
--------
#### Reference
[Extensions Class][7]
[DbExtensions Namespace][2]
[1]: https://learn.microsoft.com/dotnet/api/system.string
[2]: ../README.md
[3]: GetStringOrNull.md
[4]: https://learn.microsoft.com/dotnet/api/system.data.common.dbdatareader
[5]: https://docs.microsoft.com/dotnet/visual-basic/programming-guide/language-features/procedures/extension-methods
[6]: https://docs.microsoft.com/dotnet/csharp/programming-guide/classes-and-structs/extension-methods
[7]: README.md
================================================
FILE: docs/api/DbExtensions/Extensions/GetValue.md
================================================
Extensions.GetValue Method
==========================
Gets the value of the specified column.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public static Object GetValue(
this DbDataReader reader,
string name
)
```
#### Parameters
##### *reader* [DbDataReader][2]
The data reader.
##### *name* [String][3]
The name of the column to find.
#### Return Value
[Object][4]
The value of the column.
#### Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type [DbDataReader][2]. When you use instance method syntax to call this method, omit the first parameter. For more information, see [Extension Methods (Visual Basic)][5] or [Extension Methods (C# Programming Guide)][6].
See Also
--------
#### Reference
[Extensions Class][7]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: https://learn.microsoft.com/dotnet/api/system.data.common.dbdatareader
[3]: https://learn.microsoft.com/dotnet/api/system.string
[4]: https://learn.microsoft.com/dotnet/api/system.object
[5]: https://docs.microsoft.com/dotnet/visual-basic/programming-guide/language-features/procedures/extension-methods
[6]: https://docs.microsoft.com/dotnet/csharp/programming-guide/classes-and-structs/extension-methods
[7]: README.md
================================================
FILE: docs/api/DbExtensions/Extensions/GetValueOrNull.md
================================================
Extensions.GetValueOrNull(DbDataReader, Int32) Method
=====================================================
Gets the value of the specified column as an [Object][1], or null (Nothing in Visual Basic).
**Namespace:** [DbExtensions][2]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ----------------------------------------- | -------------------------------------------------------------------------------------------- |
| **GetValueOrNull(DbDataReader, Int32)** | Gets the value of the specified column as an [Object][1], or null (Nothing in Visual Basic). |
| [GetValueOrNull(DbDataReader, String)][3] | Gets the value of the specified column as an [Object][1], or null (Nothing in Visual Basic). |
Syntax
------
```csharp
public static Object? GetValueOrNull(
this DbDataReader reader,
int i
)
```
#### Parameters
##### *reader* [DbDataReader][4]
The data reader.
##### *i* [Int32][5]
The zero-based column ordinal.
#### Return Value
[Object][1]
The value of the column.
#### Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type [DbDataReader][4]. When you use instance method syntax to call this method, omit the first parameter. For more information, see [Extension Methods (Visual Basic)][6] or [Extension Methods (C# Programming Guide)][7].
See Also
--------
#### Reference
[Extensions Class][8]
[DbExtensions Namespace][2]
[1]: https://learn.microsoft.com/dotnet/api/system.object
[2]: ../README.md
[3]: GetValueOrNull_1.md
[4]: https://learn.microsoft.com/dotnet/api/system.data.common.dbdatareader
[5]: https://learn.microsoft.com/dotnet/api/system.int32
[6]: https://docs.microsoft.com/dotnet/visual-basic/programming-guide/language-features/procedures/extension-methods
[7]: https://docs.microsoft.com/dotnet/csharp/programming-guide/classes-and-structs/extension-methods
[8]: README.md
================================================
FILE: docs/api/DbExtensions/Extensions/GetValueOrNull_1.md
================================================
Extensions.GetValueOrNull(DbDataReader, String) Method
======================================================
Gets the value of the specified column as an [Object][1], or null (Nothing in Visual Basic).
**Namespace:** [DbExtensions][2]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ---------------------------------------- | -------------------------------------------------------------------------------------------- |
| [GetValueOrNull(DbDataReader, Int32)][3] | Gets the value of the specified column as an [Object][1], or null (Nothing in Visual Basic). |
| **GetValueOrNull(DbDataReader, String)** | Gets the value of the specified column as an [Object][1], or null (Nothing in Visual Basic). |
Syntax
------
```csharp
public static Object? GetValueOrNull(
this DbDataReader reader,
string name
)
```
#### Parameters
##### *reader* [DbDataReader][4]
The data reader.
##### *name* [String][5]
The name of the column to find.
#### Return Value
[Object][1]
The value of the column.
#### Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type [DbDataReader][4]. When you use instance method syntax to call this method, omit the first parameter. For more information, see [Extension Methods (Visual Basic)][6] or [Extension Methods (C# Programming Guide)][7].
See Also
--------
#### Reference
[Extensions Class][8]
[DbExtensions Namespace][2]
[1]: https://learn.microsoft.com/dotnet/api/system.object
[2]: ../README.md
[3]: GetValueOrNull.md
[4]: https://learn.microsoft.com/dotnet/api/system.data.common.dbdatareader
[5]: https://learn.microsoft.com/dotnet/api/system.string
[6]: https://docs.microsoft.com/dotnet/visual-basic/programming-guide/language-features/procedures/extension-methods
[7]: https://docs.microsoft.com/dotnet/csharp/programming-guide/classes-and-structs/extension-methods
[8]: README.md
================================================
FILE: docs/api/DbExtensions/Extensions/README.md
================================================
Extensions Class
================
Provides extension methods for common ADO.NET objects.
Inheritance Hierarchy
---------------------
[System.Object][1]
**DbExtensions.Extensions**
**Namespace:** [DbExtensions][2]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public static class Extensions
```
The **Extensions** type exposes the following members.
Methods
-------
| Name | Description |
| ----------------------------------------------- | -------------------------------------------------------------------------------------------- |
| [GetBoolean][3] | Gets the value of the specified column as a [Boolean][4]. |
| [GetByte][5] | Gets the value of the specified column as a [Byte][6]. |
| [GetChar][7] | Gets the value of the specified column as a [Char][8]. |
| [GetDateTime][9] | Gets the value of the specified column as a [DateTime][10]. |
| [GetDecimal][11] | Gets the value of the specified column as a [Decimal][12]. |
| [GetDouble][13] | Gets the value of the specified column as a [Double][14]. |
| [GetFloat][15] | Gets the value of the specified column as a [Single][16]. |
| [GetInt16][17] | Gets the value of the specified column as an [Int16][18]. |
| [GetInt32][19] | Gets the value of the specified column as an [Int32][20]. |
| [GetInt64][21] | Gets the value of the specified column as an [Int64][22]. |
| [GetNullableBoolean(DbDataReader, Int32)][23] | Gets the value of the specified column as a [Nullable<T>][24] of [Boolean][4]. |
| [GetNullableBoolean(DbDataReader, String)][25] | Gets the value of the specified column as a [Nullable<T>][24] of [Boolean][4]. |
| [GetNullableByte(DbDataReader, Int32)][26] | Gets the value of the specified column as a [Nullable<T>][24] of [Byte][6]. |
| [GetNullableByte(DbDataReader, String)][27] | Gets the value of the specified column as a [Nullable<T>][24] of [Byte][6]. |
| [GetNullableChar(DbDataReader, Int32)][28] | Gets the value of the specified column as a [Nullable<T>][24] of [Char][8]. |
| [GetNullableChar(DbDataReader, String)][29] | Gets the value of the specified column as a [Nullable<T>][24] of [Char][8]. |
| [GetNullableDateTime(DbDataReader, Int32)][30] | Gets the value of the specified column as a [Nullable<T>][24] of [DateTime][10]. |
| [GetNullableDateTime(DbDataReader, String)][31] | Gets the value of the specified column as a [Nullable<T>][24] of [DateTime][10]. |
| [GetNullableDecimal(DbDataReader, Int32)][32] | Gets the value of the specified column as a [Nullable<T>][24] of [Decimal][12]. |
| [GetNullableDecimal(DbDataReader, String)][33] | Gets the value of the specified column as a [Nullable<T>][24] of [Decimal][12]. |
| [GetNullableDouble(DbDataReader, Int32)][34] | Gets the value of the specified column as a [Nullable<T>][24] of [Double][14]. |
| [GetNullableDouble(DbDataReader, String)][35] | Gets the value of the specified column as a [Nullable<T>][24] of [Double][14]. |
| [GetNullableFloat(DbDataReader, Int32)][36] | Gets the value of the specified column as a [Nullable<T>][24] of [Single][16]. |
| [GetNullableFloat(DbDataReader, String)][37] | Gets the value of the specified column as a [Nullable<T>][24] of [Single][16]. |
| [GetNullableGuid(DbDataReader, Int32)][38] | Gets the value of the specified column as a [Nullable<T>][24] of [Guid][39]. |
| [GetNullableGuid(DbDataReader, String)][40] | Gets the value of the specified column as a [Nullable<T>][24] of [Guid][39]. |
| [GetNullableInt16(DbDataReader, Int32)][41] | Gets the value of the specified column as a [Nullable<T>][24] of [Int16][18]. |
| [GetNullableInt16(DbDataReader, String)][42] | Gets the value of the specified column as a [Nullable<T>][24] of [Int16][18]. |
| [GetNullableInt32(DbDataReader, Int32)][43] | Gets the value of the specified column as a [Nullable<T>][24] of [Int32][20]. |
| [GetNullableInt32(DbDataReader, String)][44] | Gets the value of the specified column as a [Nullable<T>][24] of [Int32][20]. |
| [GetNullableInt64(DbDataReader, Int32)][45] | Gets the value of the specified column as a [Nullable<T>][24] of [Int64][22]. |
| [GetNullableInt64(DbDataReader, String)][46] | Gets the value of the specified column as a [Nullable<T>][24] of [Int64][22]. |
| [GetString][47] | Gets the value of the specified column as a [String][48]. |
| [GetStringOrNull(DbDataReader, Int32)][49] | Gets the value of the specified column as a [String][48], or null (Nothing in Visual Basic). |
| [GetStringOrNull(DbDataReader, String)][50] | Gets the value of the specified column as a [String][48], or null (Nothing in Visual Basic). |
| [GetValue][51] | Gets the value of the specified column. |
| [GetValueOrNull(DbDataReader, Int32)][52] | Gets the value of the specified column as an [Object][1], or null (Nothing in Visual Basic). |
| [GetValueOrNull(DbDataReader, String)][53] | Gets the value of the specified column as an [Object][1], or null (Nothing in Visual Basic). |
See Also
--------
#### Reference
[DbExtensions Namespace][2]
[1]: https://learn.microsoft.com/dotnet/api/system.object
[2]: ../README.md
[3]: GetBoolean.md
[4]: https://learn.microsoft.com/dotnet/api/system.boolean
[5]: GetByte.md
[6]: https://learn.microsoft.com/dotnet/api/system.byte
[7]: GetChar.md
[8]: https://learn.microsoft.com/dotnet/api/system.char
[9]: GetDateTime.md
[10]: https://learn.microsoft.com/dotnet/api/system.datetime
[11]: GetDecimal.md
[12]: https://learn.microsoft.com/dotnet/api/system.decimal
[13]: GetDouble.md
[14]: https://learn.microsoft.com/dotnet/api/system.double
[15]: GetFloat.md
[16]: https://learn.microsoft.com/dotnet/api/system.single
[17]: GetInt16.md
[18]: https://learn.microsoft.com/dotnet/api/system.int16
[19]: GetInt32.md
[20]: https://learn.microsoft.com/dotnet/api/system.int32
[21]: GetInt64.md
[22]: https://learn.microsoft.com/dotnet/api/system.int64
[23]: GetNullableBoolean.md
[24]: https://learn.microsoft.com/dotnet/api/system.nullable-1
[25]: GetNullableBoolean_1.md
[26]: GetNullableByte.md
[27]: GetNullableByte_1.md
[28]: GetNullableChar.md
[29]: GetNullableChar_1.md
[30]: GetNullableDateTime.md
[31]: GetNullableDateTime_1.md
[32]: GetNullableDecimal.md
[33]: GetNullableDecimal_1.md
[34]: GetNullableDouble.md
[35]: GetNullableDouble_1.md
[36]: GetNullableFloat.md
[37]: GetNullableFloat_1.md
[38]: GetNullableGuid.md
[39]: https://learn.microsoft.com/dotnet/api/system.guid
[40]: GetNullableGuid_1.md
[41]: GetNullableInt16.md
[42]: GetNullableInt16_1.md
[43]: GetNullableInt32.md
[44]: GetNullableInt32_1.md
[45]: GetNullableInt64.md
[46]: GetNullableInt64_1.md
[47]: GetString.md
[48]: https://learn.microsoft.com/dotnet/api/system.string
[49]: GetStringOrNull.md
[50]: GetStringOrNull_1.md
[51]: GetValue.md
[52]: GetValueOrNull.md
[53]: GetValueOrNull_1.md
================================================
FILE: docs/api/DbExtensions/README.md
================================================
DbExtensions Namespace
======================
DbExtensions is a data-access framework with a strong focus on query composition, granularity and code aesthetics. [Database][1] is the entry point of the **DbExtensions** API.
Classes
-------
| Class | Description |
| ----------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [AssociationAttribute][2] | Designates a property to represent a database association, such as a foreign key relationship. |
| [ChangeConflictException][3] | An exception that is thrown when a concurrency violation is encountered while saving to the database. A concurrency violation occurs when an unexpected number of rows are affected during save. This is usually because the data in the database has been modified since it was loaded into memory. |
| [ColumnAttribute][4] | Associates a property with a column in a database table. |
| [ComplexPropertyAttribute][5] | Designates a property as a complex property that groups columns of a table that share the same base name. |
| [Database][1] | Provides simple data access using [SqlSet][6], [SqlBuilder][7] and [SqlTable<TEntity>][8]. |
| [DatabaseConfiguration][9] | Holds configuration options that customize the behavior of [Database][1]. This class cannot be instantiated, to get an instance use the [Configuration][10] property. |
| [Extensions][11] | Provides extension methods for common ADO.NET objects. |
| [SQL][12] | Provides a set of static (Shared in Visual Basic) methods to create [SqlBuilder][7] instances. |
| [SqlBuilder][7] | Represents a mutable SQL string. |
| [SqlClause][13] | Provides information about a SQL clause. Used by [SqlBuilder][7]. |
| [SqlSet][6] | Represents an immutable, connected SQL query. This class cannot be instantiated, to get an instance use one of the [Database.From][14] or [Database.FromQuery][15] overloads. |
| [SqlSet<TResult>][16] | Represents an immutable, connected SQL query that maps to TResult objects. This class cannot be instantiated, to get an instance use one of the [Database.From<TResult>(String)][17] or [Database.FromQuery<TResult>(SqlBuilder)][18] overloads. |
| [SqlTable][19] | A non-generic version of [SqlTable<TEntity>][8] which can be used when the type of the entity is not known at build time. This class cannot be instantiated, to get an instance use the [Database.Table(Type)][20] method. |
| [SqlTable<TEntity>][8] | A [SqlSet<TResult>][16] that provides CRUD (Create, Read, Update, Delete) operations for annotated classes. This class cannot be instantiated, to get an instance use the [Database.Table<TEntity>()][21] method. |
| [TableAttribute][22] | Designates a class as an entity class that is associated with a database table. |
Enumerations
------------
| Enumeration | Description |
| -------------- | ----------------------------------------------------------------------------------------------------------------------------- |
| [AutoSync][23] | Used to specify for during INSERT and UPDATE operations when a data member should be read back after the operation completes. |
[1]: Database/README.md
[2]: AssociationAttribute/README.md
[3]: ChangeConflictException/README.md
[4]: ColumnAttribute/README.md
[5]: ComplexPropertyAttribute/README.md
[6]: SqlSet/README.md
[7]: SqlBuilder/README.md
[8]: SqlTable_1/README.md
[9]: DatabaseConfiguration/README.md
[10]: Database/Configuration.md
[11]: Extensions/README.md
[12]: SQL/README.md
[13]: SqlClause/README.md
[14]: Database/From.md
[15]: Database/FromQuery.md
[16]: SqlSet_1/README.md
[17]: Database/From__1.md
[18]: Database/FromQuery__1.md
[19]: SqlTable/README.md
[20]: Database/Table.md
[21]: Database/Table__1.md
[22]: TableAttribute/README.md
[23]: AutoSync/README.md
================================================
FILE: docs/api/DbExtensions/SQL/DELETE_FROM.md
================================================
SQL.DELETE_FROM(SqlBuilder.ClauseStringHandler<SqlClause.DELETE_FROM>) Method
================================================================================
Creates and returns a new [SqlBuilder][1] initialized by appending the DELETE FROM clause using the provided string interpolated *handler*.
**Namespace:** [DbExtensions][2]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| --------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
| **DELETE_FROM(SqlBuilder.ClauseStringHandler<DELETE_FROM>)** | Creates and returns a new [SqlBuilder][1] initialized by appending the DELETE FROM clause using the provided string interpolated *handler*. |
| [DELETE_FROM(String)][3] | Creates and returns a new [SqlBuilder][1] initialized by appending the DELETE FROM clause using the provided *text*. |
Syntax
------
```csharp
public static SqlBuilder DELETE_FROM(
ref ClauseStringHandler handler
)
```
#### Parameters
##### *handler* ClauseStringHandler<DELETE_FROM>
The body of the DELETE FROM clause.
#### Return Value
[SqlBuilder][1]
A new [SqlBuilder][1] after calling [DELETE_FROM(SqlBuilder.ClauseStringHandler<DELETE_FROM>)][4].
See Also
--------
#### Reference
[SQL Class][5]
[DbExtensions Namespace][2]
[1]: ../SqlBuilder/README.md
[2]: ../README.md
[3]: DELETE_FROM_1.md
[4]: ../SqlBuilder/DELETE_FROM.md
[5]: README.md
================================================
FILE: docs/api/DbExtensions/SQL/DELETE_FROM_1.md
================================================
SQL.DELETE_FROM(String) Method
==============================
Creates and returns a new [SqlBuilder][1] initialized by appending the DELETE FROM clause using the provided *text*.
**Namespace:** [DbExtensions][2]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ---------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
| [DELETE_FROM(SqlBuilder.ClauseStringHandler<DELETE_FROM>)][3] | Creates and returns a new [SqlBuilder][1] initialized by appending the DELETE FROM clause using the provided string interpolated *handler*. |
| **DELETE_FROM(String)** | Creates and returns a new [SqlBuilder][1] initialized by appending the DELETE FROM clause using the provided *text*. |
Syntax
------
```csharp
public static SqlBuilder DELETE_FROM(
string? text
)
```
#### Parameters
##### *text* [String][4]
The body of the DELETE FROM clause.
#### Return Value
[SqlBuilder][1]
A new [SqlBuilder][1] after calling [DELETE_FROM(String)][5].
See Also
--------
#### Reference
[SQL Class][6]
[DbExtensions Namespace][2]
[1]: ../SqlBuilder/README.md
[2]: ../README.md
[3]: DELETE_FROM.md
[4]: https://learn.microsoft.com/dotnet/api/system.string
[5]: ../SqlBuilder/DELETE_FROM_1.md
[6]: README.md
================================================
FILE: docs/api/DbExtensions/SQL/INSERT_INTO.md
================================================
SQL.INSERT_INTO(SqlBuilder.ClauseStringHandler<SqlClause.INSERT_INTO>) Method
================================================================================
Creates and returns a new [SqlBuilder][1] initialized by appending the INSERT INTO clause using the provided string interpolated *handler*.
**Namespace:** [DbExtensions][2]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| --------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
| **INSERT_INTO(SqlBuilder.ClauseStringHandler<INSERT_INTO>)** | Creates and returns a new [SqlBuilder][1] initialized by appending the INSERT INTO clause using the provided string interpolated *handler*. |
| [INSERT_INTO(String)][3] | Creates and returns a new [SqlBuilder][1] initialized by appending the INSERT INTO clause using the provided *text*. |
Syntax
------
```csharp
public static SqlBuilder INSERT_INTO(
ref ClauseStringHandler handler
)
```
#### Parameters
##### *handler* ClauseStringHandler<INSERT_INTO>
The body of the INSERT INTO clause.
#### Return Value
[SqlBuilder][1]
A new [SqlBuilder][1] after calling [INSERT_INTO(SqlBuilder.ClauseStringHandler<INSERT_INTO>)][4].
See Also
--------
#### Reference
[SQL Class][5]
[DbExtensions Namespace][2]
[1]: ../SqlBuilder/README.md
[2]: ../README.md
[3]: INSERT_INTO_1.md
[4]: ../SqlBuilder/INSERT_INTO.md
[5]: README.md
================================================
FILE: docs/api/DbExtensions/SQL/INSERT_INTO_1.md
================================================
SQL.INSERT_INTO(String) Method
==============================
Creates and returns a new [SqlBuilder][1] initialized by appending the INSERT INTO clause using the provided *text*.
**Namespace:** [DbExtensions][2]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ---------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
| [INSERT_INTO(SqlBuilder.ClauseStringHandler<INSERT_INTO>)][3] | Creates and returns a new [SqlBuilder][1] initialized by appending the INSERT INTO clause using the provided string interpolated *handler*. |
| **INSERT_INTO(String)** | Creates and returns a new [SqlBuilder][1] initialized by appending the INSERT INTO clause using the provided *text*. |
Syntax
------
```csharp
public static SqlBuilder INSERT_INTO(
string? text
)
```
#### Parameters
##### *text* [String][4]
The body of the INSERT INTO clause.
#### Return Value
[SqlBuilder][1]
A new [SqlBuilder][1] after calling [INSERT_INTO(String)][5].
See Also
--------
#### Reference
[SQL Class][6]
[DbExtensions Namespace][2]
[1]: ../SqlBuilder/README.md
[2]: ../README.md
[3]: INSERT_INTO.md
[4]: https://learn.microsoft.com/dotnet/api/system.string
[5]: ../SqlBuilder/INSERT_INTO_1.md
[6]: README.md
================================================
FILE: docs/api/DbExtensions/SQL/README.md
================================================
SQL Class
=========
Provides a set of static (Shared in Visual Basic) methods to create [SqlBuilder][1] instances.
Inheritance Hierarchy
---------------------
[System.Object][2]
**DbExtensions.SQL**
**Namespace:** [DbExtensions][3]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public static class SQL
```
The **SQL** type exposes the following members.
Methods
-------
| Name | Description |
| ---------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
| [DELETE_FROM(SqlBuilder.ClauseStringHandler<DELETE_FROM>)][4] | Creates and returns a new [SqlBuilder][1] initialized by appending the DELETE FROM clause using the provided string interpolated *handler*. |
| [DELETE_FROM(String)][5] | Creates and returns a new [SqlBuilder][1] initialized by appending the DELETE FROM clause using the provided *text*. |
| [INSERT_INTO(SqlBuilder.ClauseStringHandler<INSERT_INTO>)][6] | Creates and returns a new [SqlBuilder][1] initialized by appending the INSERT INTO clause using the provided string interpolated *handler*. |
| [INSERT_INTO(String)][7] | Creates and returns a new [SqlBuilder][1] initialized by appending the INSERT INTO clause using the provided *text*. |
| [SELECT(SqlBuilder.ClauseStringHandler<SELECT>)][8] | Creates and returns a new [SqlBuilder][1] initialized by appending the SELECT clause using the provided string interpolated *handler*. |
| [SELECT(String)][9] | Creates and returns a new [SqlBuilder][1] initialized by appending the SELECT clause using the provided *text*. |
| [UPDATE(SqlBuilder.ClauseStringHandler<UPDATE>)][10] | Creates and returns a new [SqlBuilder][1] initialized by appending the UPDATE clause using the provided string interpolated *handler*. |
| [UPDATE(String)][11] | Creates and returns a new [SqlBuilder][1] initialized by appending the UPDATE clause using the provided *text*. |
| [WITH(SqlBuilder.ClauseStringHandler<WITH>)][12] | Creates and returns a new [SqlBuilder][1] initialized by appending the WITH clause using the provided string interpolated *handler*. |
| [WITH(String)][13] | Creates and returns a new [SqlBuilder][1] initialized by appending the WITH clause using the provided *text*. |
| [WITH(String, SqlBuilder)][14] | Creates and returns a new [SqlBuilder][1] initialized by appending the WITH clause using the provided *subQuery* and *alias*. |
| [WITH(String, SqlSet)][15] | Creates and returns a new [SqlBuilder][1] initialized by appending the WITH clause using the provided *subQuery* and *alias*. |
See Also
--------
#### Reference
[DbExtensions Namespace][3]
[1]: ../SqlBuilder/README.md
[2]: https://learn.microsoft.com/dotnet/api/system.object
[3]: ../README.md
[4]: DELETE_FROM.md
[5]: DELETE_FROM_1.md
[6]: INSERT_INTO.md
[7]: INSERT_INTO_1.md
[8]: SELECT.md
[9]: SELECT_1.md
[10]: UPDATE.md
[11]: UPDATE_1.md
[12]: WITH.md
[13]: WITH_1.md
[14]: WITH_2.md
[15]: WITH_3.md
================================================
FILE: docs/api/DbExtensions/SQL/SELECT.md
================================================
SQL.SELECT(SqlBuilder.ClauseStringHandler<SqlClause.SELECT>) Method
======================================================================
Creates and returns a new [SqlBuilder][1] initialized by appending the SELECT clause using the provided string interpolated *handler*.
**Namespace:** [DbExtensions][2]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ----------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- |
| **SELECT(SqlBuilder.ClauseStringHandler<SELECT>)** | Creates and returns a new [SqlBuilder][1] initialized by appending the SELECT clause using the provided string interpolated *handler*. |
| [SELECT(String)][3] | Creates and returns a new [SqlBuilder][1] initialized by appending the SELECT clause using the provided *text*. |
Syntax
------
```csharp
public static SqlBuilder SELECT(
ref ClauseStringHandler handler
)
```
#### Parameters
##### *handler* ClauseStringHandler<SELECT>
The body of the SELECT clause.
#### Return Value
[SqlBuilder][1]
A new [SqlBuilder][1] after calling [SELECT(SqlBuilder.ClauseStringHandler<SELECT>)][4].
See Also
--------
#### Reference
[SQL Class][5]
[DbExtensions Namespace][2]
[1]: ../SqlBuilder/README.md
[2]: ../README.md
[3]: SELECT_1.md
[4]: ../SqlBuilder/SELECT_1.md
[5]: README.md
================================================
FILE: docs/api/DbExtensions/SQL/SELECT_1.md
================================================
SQL.SELECT(String) Method
=========================
Creates and returns a new [SqlBuilder][1] initialized by appending the SELECT clause using the provided *text*.
**Namespace:** [DbExtensions][2]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------- |
| [SELECT(SqlBuilder.ClauseStringHandler<SELECT>)][3] | Creates and returns a new [SqlBuilder][1] initialized by appending the SELECT clause using the provided string interpolated *handler*. |
| **SELECT(String)** | Creates and returns a new [SqlBuilder][1] initialized by appending the SELECT clause using the provided *text*. |
Syntax
------
```csharp
public static SqlBuilder SELECT(
string? text
)
```
#### Parameters
##### *text* [String][4]
The body of the SELECT clause.
#### Return Value
[SqlBuilder][1]
A new [SqlBuilder][1] after calling [SELECT(String)][5].
See Also
--------
#### Reference
[SQL Class][6]
[DbExtensions Namespace][2]
[1]: ../SqlBuilder/README.md
[2]: ../README.md
[3]: SELECT.md
[4]: https://learn.microsoft.com/dotnet/api/system.string
[5]: ../SqlBuilder/SELECT_2.md
[6]: README.md
================================================
FILE: docs/api/DbExtensions/SQL/UPDATE.md
================================================
SQL.UPDATE(SqlBuilder.ClauseStringHandler<SqlClause.UPDATE>) Method
======================================================================
Creates and returns a new [SqlBuilder][1] initialized by appending the UPDATE clause using the provided string interpolated *handler*.
**Namespace:** [DbExtensions][2]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ----------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- |
| **UPDATE(SqlBuilder.ClauseStringHandler<UPDATE>)** | Creates and returns a new [SqlBuilder][1] initialized by appending the UPDATE clause using the provided string interpolated *handler*. |
| [UPDATE(String)][3] | Creates and returns a new [SqlBuilder][1] initialized by appending the UPDATE clause using the provided *text*. |
Syntax
------
```csharp
public static SqlBuilder UPDATE(
ref ClauseStringHandler handler
)
```
#### Parameters
##### *handler* ClauseStringHandler<UPDATE>
The body of the UPDATE clause.
#### Return Value
[SqlBuilder][1]
A new [SqlBuilder][1] after calling [UPDATE(SqlBuilder.ClauseStringHandler<UPDATE>)][4].
See Also
--------
#### Reference
[SQL Class][5]
[DbExtensions Namespace][2]
[1]: ../SqlBuilder/README.md
[2]: ../README.md
[3]: UPDATE_1.md
[4]: ../SqlBuilder/UPDATE.md
[5]: README.md
================================================
FILE: docs/api/DbExtensions/SQL/UPDATE_1.md
================================================
SQL.UPDATE(String) Method
=========================
Creates and returns a new [SqlBuilder][1] initialized by appending the UPDATE clause using the provided *text*.
**Namespace:** [DbExtensions][2]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------- |
| [UPDATE(SqlBuilder.ClauseStringHandler<UPDATE>)][3] | Creates and returns a new [SqlBuilder][1] initialized by appending the UPDATE clause using the provided string interpolated *handler*. |
| **UPDATE(String)** | Creates and returns a new [SqlBuilder][1] initialized by appending the UPDATE clause using the provided *text*. |
Syntax
------
```csharp
public static SqlBuilder UPDATE(
string? text
)
```
#### Parameters
##### *text* [String][4]
The body of the UPDATE clause.
#### Return Value
[SqlBuilder][1]
A new [SqlBuilder][1] after calling [UPDATE(String)][5].
See Also
--------
#### Reference
[SQL Class][6]
[DbExtensions Namespace][2]
[1]: ../SqlBuilder/README.md
[2]: ../README.md
[3]: UPDATE.md
[4]: https://learn.microsoft.com/dotnet/api/system.string
[5]: ../SqlBuilder/UPDATE_1.md
[6]: README.md
================================================
FILE: docs/api/DbExtensions/SQL/WITH.md
================================================
SQL.WITH(SqlBuilder.ClauseStringHandler<SqlClause.WITH>) Method
==================================================================
Creates and returns a new [SqlBuilder][1] initialized by appending the WITH clause using the provided string interpolated *handler*.
**Namespace:** [DbExtensions][2]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ |
| **WITH(SqlBuilder.ClauseStringHandler<WITH>)** | Creates and returns a new [SqlBuilder][1] initialized by appending the WITH clause using the provided string interpolated *handler*. |
| [WITH(String)][3] | Creates and returns a new [SqlBuilder][1] initialized by appending the WITH clause using the provided *text*. |
| [WITH(String, SqlBuilder)][4] | Creates and returns a new [SqlBuilder][1] initialized by appending the WITH clause using the provided *subQuery* and *alias*. |
| [WITH(String, SqlSet)][5] | Creates and returns a new [SqlBuilder][1] initialized by appending the WITH clause using the provided *subQuery* and *alias*. |
Syntax
------
```csharp
public static SqlBuilder WITH(
ref ClauseStringHandler handler
)
```
#### Parameters
##### *handler* ClauseStringHandler<WITH>
The body of the WITH clause.
#### Return Value
[SqlBuilder][1]
A new [SqlBuilder][1] after calling [WITH(SqlBuilder.ClauseStringHandler<WITH>)][6].
See Also
--------
#### Reference
[SQL Class][7]
[DbExtensions Namespace][2]
[1]: ../SqlBuilder/README.md
[2]: ../README.md
[3]: WITH_1.md
[4]: WITH_2.md
[5]: WITH_3.md
[6]: ../SqlBuilder/WITH.md
[7]: README.md
================================================
FILE: docs/api/DbExtensions/SQL/WITH_1.md
================================================
SQL.WITH(String) Method
=======================
Creates and returns a new [SqlBuilder][1] initialized by appending the WITH clause using the provided *text*.
**Namespace:** [DbExtensions][2]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| -------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ |
| [WITH(SqlBuilder.ClauseStringHandler<WITH>)][3] | Creates and returns a new [SqlBuilder][1] initialized by appending the WITH clause using the provided string interpolated *handler*. |
| **WITH(String)** | Creates and returns a new [SqlBuilder][1] initialized by appending the WITH clause using the provided *text*. |
| [WITH(String, SqlBuilder)][4] | Creates and returns a new [SqlBuilder][1] initialized by appending the WITH clause using the provided *subQuery* and *alias*. |
| [WITH(String, SqlSet)][5] | Creates and returns a new [SqlBuilder][1] initialized by appending the WITH clause using the provided *subQuery* and *alias*. |
Syntax
------
```csharp
public static SqlBuilder WITH(
string? text
)
```
#### Parameters
##### *text* [String][6]
The body of the WITH clause.
#### Return Value
[SqlBuilder][1]
A new [SqlBuilder][1] after calling [WITH(String)][7].
See Also
--------
#### Reference
[SQL Class][8]
[DbExtensions Namespace][2]
[1]: ../SqlBuilder/README.md
[2]: ../README.md
[3]: WITH.md
[4]: WITH_2.md
[5]: WITH_3.md
[6]: https://learn.microsoft.com/dotnet/api/system.string
[7]: ../SqlBuilder/WITH_1.md
[8]: README.md
================================================
FILE: docs/api/DbExtensions/SQL/WITH_2.md
================================================
SQL.WITH(String, SqlBuilder) Method
===================================
Creates and returns a new [SqlBuilder][1] initialized by appending the WITH clause using the provided *subQuery* and *alias*.
**Namespace:** [DbExtensions][2]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| -------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ |
| [WITH(SqlBuilder.ClauseStringHandler<WITH>)][3] | Creates and returns a new [SqlBuilder][1] initialized by appending the WITH clause using the provided string interpolated *handler*. |
| [WITH(String)][4] | Creates and returns a new [SqlBuilder][1] initialized by appending the WITH clause using the provided *text*. |
| **WITH(String, SqlBuilder)** | Creates and returns a new [SqlBuilder][1] initialized by appending the WITH clause using the provided *subQuery* and *alias*. |
| [WITH(String, SqlSet)][5] | Creates and returns a new [SqlBuilder][1] initialized by appending the WITH clause using the provided *subQuery* and *alias*. |
Syntax
------
```csharp
public static SqlBuilder WITH(
string alias,
SqlBuilder subQuery
)
```
#### Parameters
##### *alias* [String][6]
The alias of the sub-query.
##### *subQuery* [SqlBuilder][1]
The sub-query to use as the body of the WITH clause.
#### Return Value
[SqlBuilder][1]
A new [SqlBuilder][1] after calling [WITH(String, SqlBuilder)][7].
See Also
--------
#### Reference
[SQL Class][8]
[DbExtensions Namespace][2]
[1]: ../SqlBuilder/README.md
[2]: ../README.md
[3]: WITH.md
[4]: WITH_1.md
[5]: WITH_3.md
[6]: https://learn.microsoft.com/dotnet/api/system.string
[7]: ../SqlBuilder/WITH_2.md
[8]: README.md
================================================
FILE: docs/api/DbExtensions/SQL/WITH_3.md
================================================
SQL.WITH(String, SqlSet) Method
===============================
Creates and returns a new [SqlBuilder][1] initialized by appending the WITH clause using the provided *subQuery* and *alias*.
**Namespace:** [DbExtensions][2]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| -------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ |
| [WITH(SqlBuilder.ClauseStringHandler<WITH>)][3] | Creates and returns a new [SqlBuilder][1] initialized by appending the WITH clause using the provided string interpolated *handler*. |
| [WITH(String)][4] | Creates and returns a new [SqlBuilder][1] initialized by appending the WITH clause using the provided *text*. |
| [WITH(String, SqlBuilder)][5] | Creates and returns a new [SqlBuilder][1] initialized by appending the WITH clause using the provided *subQuery* and *alias*. |
| **WITH(String, SqlSet)** | Creates and returns a new [SqlBuilder][1] initialized by appending the WITH clause using the provided *subQuery* and *alias*. |
Syntax
------
```csharp
public static SqlBuilder WITH(
string alias,
SqlSet subQuery
)
```
#### Parameters
##### *alias* [String][6]
The alias of the sub-query.
##### *subQuery* [SqlSet][7]
The sub-query to use as the body of the WITH clause.
#### Return Value
[SqlBuilder][1]
A new [SqlBuilder][1] after calling [WITH(String, SqlSet)][8].
See Also
--------
#### Reference
[SQL Class][9]
[DbExtensions Namespace][2]
[1]: ../SqlBuilder/README.md
[2]: ../README.md
[3]: WITH.md
[4]: WITH_1.md
[5]: WITH_2.md
[6]: https://learn.microsoft.com/dotnet/api/system.string
[7]: ../SqlSet/README.md
[8]: ../SqlBuilder/WITH_3.md
[9]: README.md
================================================
FILE: docs/api/DbExtensions/SqlBuilder/Append.md
================================================
SqlBuilder.Append(SqlBuilder.AppendStringHandler) Method
========================================================
Appends the interpolated string *handler* to this instance.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ------------------------------- | ----------------------------------------------------------- |
| **Append(AppendStringHandler)** | Appends the interpolated string *handler* to this instance. |
| [Append(String)][2] | Appends *text* to this instance. |
Syntax
------
```csharp
public SqlBuilder Append(
ref AppendStringHandler handler
)
```
#### Parameters
##### *handler* AppendStringHandler
The interpolated string.
#### Return Value
[SqlBuilder][3]
A reference to this instance after the append operation has completed.
See Also
--------
#### Reference
[SqlBuilder Class][3]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: Append_1.md
[3]: README.md
================================================
FILE: docs/api/DbExtensions/SqlBuilder/AppendClause.md
================================================
SqlBuilder.AppendClause(SqlClause) Method
=========================================
Appends the SQL *clause*.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ------------------------------- | --------------------------------------------- |
| **AppendClause(SqlClause)** | Appends the SQL *clause*. |
| [AppendClause<TClause>()][2] | Appends the SQL clause identified by TClause. |
Syntax
------
```csharp
public SqlBuilder AppendClause(
SqlClause clause
)
```
#### Parameters
##### *clause* [SqlClause][3]
The clause to append.
#### Return Value
[SqlBuilder][4]
A reference to this instance after the append operation has completed.
See Also
--------
#### Reference
[SqlBuilder Class][4]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: AppendClause__1.md
[3]: ../SqlClause/README.md
[4]: README.md
================================================
FILE: docs/api/DbExtensions/SqlBuilder/AppendClause__1.md
================================================
SqlBuilder.AppendClause<TClause> Method
==========================================
Appends the SQL clause identified by TClause.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ------------------------------ | --------------------------------------------- |
| [AppendClause(SqlClause)][2] | Appends the SQL *clause*. |
| **AppendClause<TClause>()** | Appends the SQL clause identified by TClause. |
Syntax
------
```csharp
public SqlBuilder AppendClause()
where TClause : new(), SqlClause
```
#### Type Parameters
##### *TClause*
The type of the SQL clause.
#### Return Value
[SqlBuilder][3]
A reference to this instance after the append operation has completed.
See Also
--------
#### Reference
[SqlBuilder Class][3]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: AppendClause.md
[3]: README.md
================================================
FILE: docs/api/DbExtensions/SqlBuilder/AppendElse.md
================================================
SqlBuilder.AppendElse Method
============================
Appends the interpolated string *handler* if an antecedent call to [AppendIf(Boolean, AppendStringHandler)][1] or [AppendElseIf(Boolean, AppendElseStringHandler)][2] used a `false` condition
**Namespace:** [DbExtensions][3]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public SqlBuilder AppendElse(
ref AppendElseStringHandler handler
)
```
#### Parameters
##### *handler* AppendElseStringHandler
The interpolated string to append.
#### Return Value
[SqlBuilder][4]
A reference to this instance after the append operation has completed.
See Also
--------
#### Reference
[SqlBuilder Class][4]
[DbExtensions Namespace][3]
[1]: AppendIf.md
[2]: AppendElseIf.md
[3]: ../README.md
[4]: README.md
================================================
FILE: docs/api/DbExtensions/SqlBuilder/AppendElseIf.md
================================================
SqlBuilder.AppendElseIf Method
==============================
Appends the interpolated string *handler* if *condition* is `true` and an antecedent call to [AppendIf(Boolean, AppendStringHandler)][1] or **AppendElseIf(Boolean, AppendElseStringHandler)** used a `false` condition.
**Namespace:** [DbExtensions][2]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public SqlBuilder AppendElseIf(
bool condition,
ref AppendElseStringHandler handler
)
```
#### Parameters
##### *condition* [Boolean][3]
`true` to append *handler*; otherwise, `false`.
##### *handler* AppendElseStringHandler
The interpolated string to append.
#### Return Value
[SqlBuilder][4]
A reference to this instance after the append operation has completed.
See Also
--------
#### Reference
[SqlBuilder Class][4]
[DbExtensions Namespace][2]
[1]: AppendIf.md
[2]: ../README.md
[3]: https://learn.microsoft.com/dotnet/api/system.boolean
[4]: README.md
================================================
FILE: docs/api/DbExtensions/SqlBuilder/AppendIf.md
================================================
SqlBuilder.AppendIf Method
==========================
Appends the interpolated string *handler* if *condition* is `true`.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public SqlBuilder AppendIf(
bool condition,
ref AppendStringHandler handler
)
```
#### Parameters
##### *condition* [Boolean][2]
`true` to append *handler*; otherwise, `false`.
##### *handler* AppendStringHandler
The interpolated string to append.
#### Return Value
[SqlBuilder][3]
A reference to this instance after the append operation has completed.
See Also
--------
#### Reference
[SqlBuilder Class][3]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: https://learn.microsoft.com/dotnet/api/system.boolean
[3]: README.md
================================================
FILE: docs/api/DbExtensions/SqlBuilder/AppendLine.md
================================================
SqlBuilder.AppendLine Method
============================
Appends the default line terminator to this instance.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public SqlBuilder AppendLine()
```
#### Return Value
[SqlBuilder][2]
A reference to this instance after the append operation has completed.
See Also
--------
#### Reference
[SqlBuilder Class][2]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: README.md
================================================
FILE: docs/api/DbExtensions/SqlBuilder/AppendSql.md
================================================
SqlBuilder.AppendSql Method
===========================
Appends *sql* to this instance.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public SqlBuilder AppendSql(
SqlBuilder sql
)
```
#### Parameters
##### *sql* [SqlBuilder][2]
A [SqlBuilder][2].
#### Return Value
[SqlBuilder][2]
A reference to this instance after the append operation has completed.
See Also
--------
#### Reference
[SqlBuilder Class][2]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: README.md
================================================
FILE: docs/api/DbExtensions/SqlBuilder/Append_1.md
================================================
SqlBuilder.Append(String) Method
================================
Appends *text* to this instance.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| -------------------------------- | ----------------------------------------------------------- |
| [Append(AppendStringHandler)][2] | Appends the interpolated string *handler* to this instance. |
| **Append(String)** | Appends *text* to this instance. |
Syntax
------
```csharp
public SqlBuilder Append(
string? text
)
```
#### Parameters
##### *text* [String][3]
The string.
#### Return Value
[SqlBuilder][4]
A reference to this instance after the append operation has completed.
See Also
--------
#### Reference
[SqlBuilder Class][4]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: Append.md
[3]: https://learn.microsoft.com/dotnet/api/system.string
[4]: README.md
================================================
FILE: docs/api/DbExtensions/SqlBuilder/Buffer.md
================================================
SqlBuilder.Buffer Property
==========================
The underlying [StringBuilder][1].
**Namespace:** [DbExtensions][2]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public StringBuilder Buffer { get; }
```
#### Property Value
[StringBuilder][1]
See Also
--------
#### Reference
[SqlBuilder Class][3]
[DbExtensions Namespace][2]
[1]: https://learn.microsoft.com/dotnet/api/system.text.stringbuilder
[2]: ../README.md
[3]: README.md
================================================
FILE: docs/api/DbExtensions/SqlBuilder/CROSS_JOIN.md
================================================
SqlBuilder.CROSS_JOIN Method
============================
Sets CROSS JOIN as the next clause, to be used by subsequent calls to clause continuation methods, such as [_If(Boolean, ConditionalStringHandler)][1].
**Namespace:** [DbExtensions][2]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| -------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **CROSS_JOIN()** | Sets CROSS JOIN as the next clause, to be used by subsequent calls to clause continuation methods, such as [_If(Boolean, ConditionalStringHandler)][1]. |
| [CROSS_JOIN(SqlBuilder.ClauseStringHandler<CROSS_JOIN>)][3] | Appends the CROSS JOIN clause using the provided interpolated string *handler*. |
| [CROSS_JOIN(String)][4] | Appends the CROSS JOIN clause using the provided *text*. |
Syntax
------
```csharp
public SqlBuilder CROSS_JOIN()
```
#### Return Value
[SqlBuilder][5]
A reference to this instance after the operation has completed.
See Also
--------
#### Reference
[SqlBuilder Class][5]
[DbExtensions Namespace][2]
[1]: _If.md
[2]: ../README.md
[3]: CROSS_JOIN_1.md
[4]: CROSS_JOIN_2.md
[5]: README.md
================================================
FILE: docs/api/DbExtensions/SqlBuilder/CROSS_JOIN_1.md
================================================
SqlBuilder.CROSS_JOIN(SqlBuilder.ClauseStringHandler<SqlClause.CROSS_JOIN>) Method
=====================================================================================
Appends the CROSS JOIN clause using the provided interpolated string *handler*.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [CROSS_JOIN()][2] | Sets CROSS JOIN as the next clause, to be used by subsequent calls to clause continuation methods, such as [_If(Boolean, ConditionalStringHandler)][3]. |
| **CROSS_JOIN(SqlBuilder.ClauseStringHandler<CROSS_JOIN>)** | Appends the CROSS JOIN clause using the provided interpolated string *handler*. |
| [CROSS_JOIN(String)][4] | Appends the CROSS JOIN clause using the provided *text*. |
Syntax
------
```csharp
public SqlBuilder CROSS_JOIN(
ref ClauseStringHandler handler
)
```
#### Parameters
##### *handler* ClauseStringHandler<CROSS_JOIN>
The interpolated string that represents the body of the CROSS JOIN clause.
#### Return Value
[SqlBuilder][5]
A reference to this instance after the append operation has completed.
See Also
--------
#### Reference
[SqlBuilder Class][5]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: CROSS_JOIN.md
[3]: _If.md
[4]: CROSS_JOIN_2.md
[5]: README.md
================================================
FILE: docs/api/DbExtensions/SqlBuilder/CROSS_JOIN_2.md
================================================
SqlBuilder.CROSS_JOIN(String) Method
====================================
Appends the CROSS JOIN clause using the provided *text*.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| -------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [CROSS_JOIN()][2] | Sets CROSS JOIN as the next clause, to be used by subsequent calls to clause continuation methods, such as [_If(Boolean, ConditionalStringHandler)][3]. |
| [CROSS_JOIN(SqlBuilder.ClauseStringHandler<CROSS_JOIN>)][4] | Appends the CROSS JOIN clause using the provided interpolated string *handler*. |
| **CROSS_JOIN(String)** | Appends the CROSS JOIN clause using the provided *text*. |
Syntax
------
```csharp
public SqlBuilder CROSS_JOIN(
string? text
)
```
#### Parameters
##### *text* [String][5]
The text that represents the body of the CROSS JOIN clause.
#### Return Value
[SqlBuilder][6]
A reference to this instance after the append operation has completed.
See Also
--------
#### Reference
[SqlBuilder Class][6]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: CROSS_JOIN.md
[3]: _If.md
[4]: CROSS_JOIN_1.md
[5]: https://learn.microsoft.com/dotnet/api/system.string
[6]: README.md
================================================
FILE: docs/api/DbExtensions/SqlBuilder/Clone.md
================================================
SqlBuilder.Clone Method
=======================
Creates and returns a copy of this instance.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public SqlBuilder Clone()
```
#### Return Value
[SqlBuilder][2]
A new [SqlBuilder][2] that is equivalent to this instance.
See Also
--------
#### Reference
[SqlBuilder Class][2]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: README.md
================================================
FILE: docs/api/DbExtensions/SqlBuilder/CurrentClause.md
================================================
SqlBuilder.CurrentClause Property
=================================
Gets or sets the current SQL clause, used to identify consecutive appends to the same clause.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public SqlClause? CurrentClause { get; set; }
```
#### Property Value
[SqlClause][2]
See Also
--------
#### Reference
[SqlBuilder Class][3]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: ../SqlClause/README.md
[3]: README.md
================================================
FILE: docs/api/DbExtensions/SqlBuilder/DELETE_FROM.md
================================================
SqlBuilder.DELETE_FROM(SqlBuilder.ClauseStringHandler<SqlClause.DELETE_FROM>) Method
=======================================================================================
Appends the DELETE FROM clause using the provided interpolated string *handler*.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| --------------------------------------------------------------- | -------------------------------------------------------------------------------- |
| **DELETE_FROM(SqlBuilder.ClauseStringHandler<DELETE_FROM>)** | Appends the DELETE FROM clause using the provided interpolated string *handler*. |
| [DELETE_FROM(String)][2] | Appends the DELETE FROM clause using the provided *text*. |
Syntax
------
```csharp
public SqlBuilder DELETE_FROM(
ref ClauseStringHandler handler
)
```
#### Parameters
##### *handler* ClauseStringHandler<DELETE_FROM>
The interpolated string that represents the body of the DELETE FROM clause.
#### Return Value
[SqlBuilder][3]
A reference to this instance after the append operation has completed.
See Also
--------
#### Reference
[SqlBuilder Class][3]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: DELETE_FROM_1.md
[3]: README.md
================================================
FILE: docs/api/DbExtensions/SqlBuilder/DELETE_FROM_1.md
================================================
SqlBuilder.DELETE_FROM(String) Method
=====================================
Appends the DELETE FROM clause using the provided *text*.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ---------------------------------------------------------------- | -------------------------------------------------------------------------------- |
| [DELETE_FROM(SqlBuilder.ClauseStringHandler<DELETE_FROM>)][2] | Appends the DELETE FROM clause using the provided interpolated string *handler*. |
| **DELETE_FROM(String)** | Appends the DELETE FROM clause using the provided *text*. |
Syntax
------
```csharp
public SqlBuilder DELETE_FROM(
string? text
)
```
#### Parameters
##### *text* [String][3]
The text that represents the body of the DELETE FROM clause.
#### Return Value
[SqlBuilder][4]
A reference to this instance after the append operation has completed.
See Also
--------
#### Reference
[SqlBuilder Class][4]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: DELETE_FROM.md
[3]: https://learn.microsoft.com/dotnet/api/system.string
[4]: README.md
================================================
FILE: docs/api/DbExtensions/SqlBuilder/FROM.md
================================================
SqlBuilder.FROM Method
======================
Sets FROM as the next clause, to be used by subsequent calls to clause continuation methods, such as [_If(Boolean, ConditionalStringHandler)][1].
**Namespace:** [DbExtensions][2]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| -------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
| **FROM()** | Sets FROM as the next clause, to be used by subsequent calls to clause continuation methods, such as [_If(Boolean, ConditionalStringHandler)][1]. |
| [FROM(SqlBuilder.ClauseStringHandler<FROM>)][3] | Appends the FROM clause using the provided interpolated string *handler*. |
| [FROM(String)][4] | Appends the FROM clause using the provided *text*. |
| [FROM(SqlBuilder, String)][5] | Appends the FROM clause using the provided *subQuery* as body named after *alias*. |
| [FROM(SqlSet, String)][6] | Appends the FROM clause using the provided *subQuery* as body named after *alias*. |
Syntax
------
```csharp
public SqlBuilder FROM()
```
#### Return Value
[SqlBuilder][7]
A reference to this instance after the operation has completed.
See Also
--------
#### Reference
[SqlBuilder Class][7]
[DbExtensions Namespace][2]
[1]: _If.md
[2]: ../README.md
[3]: FROM_2.md
[4]: FROM_4.md
[5]: FROM_1.md
[6]: FROM_3.md
[7]: README.md
================================================
FILE: docs/api/DbExtensions/SqlBuilder/FROM_1.md
================================================
SqlBuilder.FROM(SqlBuilder, String) Method
==========================================
Appends the FROM clause using the provided *subQuery* as body named after *alias*.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| -------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
| [FROM()][2] | Sets FROM as the next clause, to be used by subsequent calls to clause continuation methods, such as [_If(Boolean, ConditionalStringHandler)][3]. |
| [FROM(SqlBuilder.ClauseStringHandler<FROM>)][4] | Appends the FROM clause using the provided interpolated string *handler*. |
| [FROM(String)][5] | Appends the FROM clause using the provided *text*. |
| **FROM(SqlBuilder, String)** | Appends the FROM clause using the provided *subQuery* as body named after *alias*. |
| [FROM(SqlSet, String)][6] | Appends the FROM clause using the provided *subQuery* as body named after *alias*. |
Syntax
------
```csharp
public SqlBuilder FROM(
SqlBuilder subQuery,
string alias
)
```
#### Parameters
##### *subQuery* [SqlBuilder][7]
The sub-query to use as the body of the FROM clause.
##### *alias* [String][8]
The alias of the sub-query.
#### Return Value
[SqlBuilder][7]
A reference to this instance after the append operation has completed.
See Also
--------
#### Reference
[SqlBuilder Class][7]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: FROM.md
[3]: _If.md
[4]: FROM_2.md
[5]: FROM_4.md
[6]: FROM_3.md
[7]: README.md
[8]: https://learn.microsoft.com/dotnet/api/system.string
================================================
FILE: docs/api/DbExtensions/SqlBuilder/FROM_2.md
================================================
SqlBuilder.FROM(SqlBuilder.ClauseStringHandler<SqlClause.FROM>) Method
=========================================================================
Appends the FROM clause using the provided interpolated string *handler*.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
| [FROM()][2] | Sets FROM as the next clause, to be used by subsequent calls to clause continuation methods, such as [_If(Boolean, ConditionalStringHandler)][3]. |
| **FROM(SqlBuilder.ClauseStringHandler<FROM>)** | Appends the FROM clause using the provided interpolated string *handler*. |
| [FROM(String)][4] | Appends the FROM clause using the provided *text*. |
| [FROM(SqlBuilder, String)][5] | Appends the FROM clause using the provided *subQuery* as body named after *alias*. |
| [FROM(SqlSet, String)][6] | Appends the FROM clause using the provided *subQuery* as body named after *alias*. |
Syntax
------
```csharp
public SqlBuilder FROM(
ref ClauseStringHandler handler
)
```
#### Parameters
##### *handler* ClauseStringHandler<FROM>
The interpolated string that represents the body of the FROM clause.
#### Return Value
[SqlBuilder][7]
A reference to this instance after the append operation has completed.
See Also
--------
#### Reference
[SqlBuilder Class][7]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: FROM.md
[3]: _If.md
[4]: FROM_4.md
[5]: FROM_1.md
[6]: FROM_3.md
[7]: README.md
================================================
FILE: docs/api/DbExtensions/SqlBuilder/FROM_3.md
================================================
SqlBuilder.FROM(SqlSet, String) Method
======================================
Appends the FROM clause using the provided *subQuery* as body named after *alias*.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| -------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
| [FROM()][2] | Sets FROM as the next clause, to be used by subsequent calls to clause continuation methods, such as [_If(Boolean, ConditionalStringHandler)][3]. |
| [FROM(SqlBuilder.ClauseStringHandler<FROM>)][4] | Appends the FROM clause using the provided interpolated string *handler*. |
| [FROM(String)][5] | Appends the FROM clause using the provided *text*. |
| [FROM(SqlBuilder, String)][6] | Appends the FROM clause using the provided *subQuery* as body named after *alias*. |
| **FROM(SqlSet, String)** | Appends the FROM clause using the provided *subQuery* as body named after *alias*. |
Syntax
------
```csharp
public SqlBuilder FROM(
SqlSet subQuery,
string alias
)
```
#### Parameters
##### *subQuery* [SqlSet][7]
The sub-query to use as the body of the FROM clause.
##### *alias* [String][8]
The alias of the sub-query.
#### Return Value
[SqlBuilder][9]
A reference to this instance after the append operation has completed.
See Also
--------
#### Reference
[SqlBuilder Class][9]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: FROM.md
[3]: _If.md
[4]: FROM_2.md
[5]: FROM_4.md
[6]: FROM_1.md
[7]: ../SqlSet/README.md
[8]: https://learn.microsoft.com/dotnet/api/system.string
[9]: README.md
================================================
FILE: docs/api/DbExtensions/SqlBuilder/FROM_4.md
================================================
SqlBuilder.FROM(String) Method
==============================
Appends the FROM clause using the provided *text*.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| -------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
| [FROM()][2] | Sets FROM as the next clause, to be used by subsequent calls to clause continuation methods, such as [_If(Boolean, ConditionalStringHandler)][3]. |
| [FROM(SqlBuilder.ClauseStringHandler<FROM>)][4] | Appends the FROM clause using the provided interpolated string *handler*. |
| **FROM(String)** | Appends the FROM clause using the provided *text*. |
| [FROM(SqlBuilder, String)][5] | Appends the FROM clause using the provided *subQuery* as body named after *alias*. |
| [FROM(SqlSet, String)][6] | Appends the FROM clause using the provided *subQuery* as body named after *alias*. |
Syntax
------
```csharp
public SqlBuilder FROM(
string? text
)
```
#### Parameters
##### *text* [String][7]
The text that represents the body of the FROM clause.
#### Return Value
[SqlBuilder][8]
A reference to this instance after the append operation has completed.
See Also
--------
#### Reference
[SqlBuilder Class][8]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: FROM.md
[3]: _If.md
[4]: FROM_2.md
[5]: FROM_1.md
[6]: FROM_3.md
[7]: https://learn.microsoft.com/dotnet/api/system.string
[8]: README.md
================================================
FILE: docs/api/DbExtensions/SqlBuilder/GROUP_BY.md
================================================
SqlBuilder.GROUP_BY Method
==========================
Sets GROUP BY as the next clause, to be used by subsequent calls to clause continuation methods, such as [_If(Boolean, ConditionalStringHandler)][1].
**Namespace:** [DbExtensions][2]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ---------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
| **GROUP_BY()** | Sets GROUP BY as the next clause, to be used by subsequent calls to clause continuation methods, such as [_If(Boolean, ConditionalStringHandler)][1]. |
| [GROUP_BY(SqlBuilder.ClauseStringHandler<GROUP_BY>)][3] | Appends the GROUP BY clause using the provided interpolated string *handler*. |
| [GROUP_BY(String)][4] | Appends the GROUP BY clause using the provided *text*. |
Syntax
------
```csharp
public SqlBuilder GROUP_BY()
```
#### Return Value
[SqlBuilder][5]
A reference to this instance after the operation has completed.
See Also
--------
#### Reference
[SqlBuilder Class][5]
[DbExtensions Namespace][2]
[1]: _If.md
[2]: ../README.md
[3]: GROUP_BY_1.md
[4]: GROUP_BY_2.md
[5]: README.md
================================================
FILE: docs/api/DbExtensions/SqlBuilder/GROUP_BY_1.md
================================================
SqlBuilder.GROUP_BY(SqlBuilder.ClauseStringHandler<SqlClause.GROUP_BY>) Method
=================================================================================
Appends the GROUP BY clause using the provided interpolated string *handler*.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| --------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
| [GROUP_BY()][2] | Sets GROUP BY as the next clause, to be used by subsequent calls to clause continuation methods, such as [_If(Boolean, ConditionalStringHandler)][3]. |
| **GROUP_BY(SqlBuilder.ClauseStringHandler<GROUP_BY>)** | Appends the GROUP BY clause using the provided interpolated string *handler*. |
| [GROUP_BY(String)][4] | Appends the GROUP BY clause using the provided *text*. |
Syntax
------
```csharp
public SqlBuilder GROUP_BY(
ref ClauseStringHandler handler
)
```
#### Parameters
##### *handler* ClauseStringHandler<GROUP_BY>
The interpolated string that represents the body of the GROUP BY clause.
#### Return Value
[SqlBuilder][5]
A reference to this instance after the append operation has completed.
See Also
--------
#### Reference
[SqlBuilder Class][5]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: GROUP_BY.md
[3]: _If.md
[4]: GROUP_BY_2.md
[5]: README.md
================================================
FILE: docs/api/DbExtensions/SqlBuilder/GROUP_BY_2.md
================================================
SqlBuilder.GROUP_BY(String) Method
==================================
Appends the GROUP BY clause using the provided *text*.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ---------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
| [GROUP_BY()][2] | Sets GROUP BY as the next clause, to be used by subsequent calls to clause continuation methods, such as [_If(Boolean, ConditionalStringHandler)][3]. |
| [GROUP_BY(SqlBuilder.ClauseStringHandler<GROUP_BY>)][4] | Appends the GROUP BY clause using the provided interpolated string *handler*. |
| **GROUP_BY(String)** | Appends the GROUP BY clause using the provided *text*. |
Syntax
------
```csharp
public SqlBuilder GROUP_BY(
string? text
)
```
#### Parameters
##### *text* [String][5]
The text that represents the body of the GROUP BY clause.
#### Return Value
[SqlBuilder][6]
A reference to this instance after the append operation has completed.
See Also
--------
#### Reference
[SqlBuilder Class][6]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: GROUP_BY.md
[3]: _If.md
[4]: GROUP_BY_1.md
[5]: https://learn.microsoft.com/dotnet/api/system.string
[6]: README.md
================================================
FILE: docs/api/DbExtensions/SqlBuilder/HAVING.md
================================================
SqlBuilder.HAVING Method
========================
Sets HAVING as the next clause, to be used by subsequent calls to clause continuation methods, such as [_If(Boolean, ConditionalStringHandler)][1].
**Namespace:** [DbExtensions][2]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------- |
| **HAVING()** | Sets HAVING as the next clause, to be used by subsequent calls to clause continuation methods, such as [_If(Boolean, ConditionalStringHandler)][1]. |
| [HAVING(SqlBuilder.ClauseStringHandler<HAVING>)][3] | Appends the HAVING clause using the provided interpolated string *handler*. |
| [HAVING(String)][4] | Appends the HAVING clause using the provided *text*. |
Syntax
------
```csharp
public SqlBuilder HAVING()
```
#### Return Value
[SqlBuilder][5]
A reference to this instance after the operation has completed.
See Also
--------
#### Reference
[SqlBuilder Class][5]
[DbExtensions Namespace][2]
[1]: _If.md
[2]: ../README.md
[3]: HAVING_1.md
[4]: HAVING_2.md
[5]: README.md
================================================
FILE: docs/api/DbExtensions/SqlBuilder/HAVING_1.md
================================================
SqlBuilder.HAVING(SqlBuilder.ClauseStringHandler<SqlClause.HAVING>) Method
=============================================================================
Appends the HAVING clause using the provided interpolated string *handler*.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ----------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |
| [HAVING()][2] | Sets HAVING as the next clause, to be used by subsequent calls to clause continuation methods, such as [_If(Boolean, ConditionalStringHandler)][3]. |
| **HAVING(SqlBuilder.ClauseStringHandler<HAVING>)** | Appends the HAVING clause using the provided interpolated string *handler*. |
| [HAVING(String)][4] | Appends the HAVING clause using the provided *text*. |
Syntax
------
```csharp
public SqlBuilder HAVING(
ref ClauseStringHandler handler
)
```
#### Parameters
##### *handler* ClauseStringHandler<HAVING>
The interpolated string that represents the body of the HAVING clause.
#### Return Value
[SqlBuilder][5]
A reference to this instance after the append operation has completed.
See Also
--------
#### Reference
[SqlBuilder Class][5]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: HAVING.md
[3]: _If.md
[4]: HAVING_2.md
[5]: README.md
================================================
FILE: docs/api/DbExtensions/SqlBuilder/HAVING_2.md
================================================
SqlBuilder.HAVING(String) Method
================================
Appends the HAVING clause using the provided *text*.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------- |
| [HAVING()][2] | Sets HAVING as the next clause, to be used by subsequent calls to clause continuation methods, such as [_If(Boolean, ConditionalStringHandler)][3]. |
| [HAVING(SqlBuilder.ClauseStringHandler<HAVING>)][4] | Appends the HAVING clause using the provided interpolated string *handler*. |
| **HAVING(String)** | Appends the HAVING clause using the provided *text*. |
Syntax
------
```csharp
public SqlBuilder HAVING(
string? text
)
```
#### Parameters
##### *text* [String][5]
The text that represents the body of the HAVING clause.
#### Return Value
[SqlBuilder][6]
A reference to this instance after the append operation has completed.
See Also
--------
#### Reference
[SqlBuilder Class][6]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: HAVING.md
[3]: _If.md
[4]: HAVING_1.md
[5]: https://learn.microsoft.com/dotnet/api/system.string
[6]: README.md
================================================
FILE: docs/api/DbExtensions/SqlBuilder/INNER_JOIN.md
================================================
SqlBuilder.INNER_JOIN Method
============================
Sets INNER JOIN as the next clause, to be used by subsequent calls to clause continuation methods, such as [_If(Boolean, ConditionalStringHandler)][1].
**Namespace:** [DbExtensions][2]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| -------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **INNER_JOIN()** | Sets INNER JOIN as the next clause, to be used by subsequent calls to clause continuation methods, such as [_If(Boolean, ConditionalStringHandler)][1]. |
| [INNER_JOIN(SqlBuilder.ClauseStringHandler<INNER_JOIN>)][3] | Appends the INNER JOIN clause using the provided interpolated string *handler*. |
| [INNER_JOIN(String)][4] | Appends the INNER JOIN clause using the provided *text*. |
Syntax
------
```csharp
public SqlBuilder INNER_JOIN()
```
#### Return Value
[SqlBuilder][5]
A reference to this instance after the operation has completed.
See Also
--------
#### Reference
[SqlBuilder Class][5]
[DbExtensions Namespace][2]
[1]: _If.md
[2]: ../README.md
[3]: INNER_JOIN_1.md
[4]: INNER_JOIN_2.md
[5]: README.md
================================================
FILE: docs/api/DbExtensions/SqlBuilder/INNER_JOIN_1.md
================================================
SqlBuilder.INNER_JOIN(SqlBuilder.ClauseStringHandler<SqlClause.INNER_JOIN>) Method
=====================================================================================
Appends the INNER JOIN clause using the provided interpolated string *handler*.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [INNER_JOIN()][2] | Sets INNER JOIN as the next clause, to be used by subsequent calls to clause continuation methods, such as [_If(Boolean, ConditionalStringHandler)][3]. |
| **INNER_JOIN(SqlBuilder.ClauseStringHandler<INNER_JOIN>)** | Appends the INNER JOIN clause using the provided interpolated string *handler*. |
| [INNER_JOIN(String)][4] | Appends the INNER JOIN clause using the provided *text*. |
Syntax
------
```csharp
public SqlBuilder INNER_JOIN(
ref ClauseStringHandler handler
)
```
#### Parameters
##### *handler* ClauseStringHandler<INNER_JOIN>
The interpolated string that represents the body of the INNER JOIN clause.
#### Return Value
[SqlBuilder][5]
A reference to this instance after the append operation has completed.
See Also
--------
#### Reference
[SqlBuilder Class][5]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: INNER_JOIN.md
[3]: _If.md
[4]: INNER_JOIN_2.md
[5]: README.md
================================================
FILE: docs/api/DbExtensions/SqlBuilder/INNER_JOIN_2.md
================================================
SqlBuilder.INNER_JOIN(String) Method
====================================
Appends the INNER JOIN clause using the provided *text*.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| -------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [INNER_JOIN()][2] | Sets INNER JOIN as the next clause, to be used by subsequent calls to clause continuation methods, such as [_If(Boolean, ConditionalStringHandler)][3]. |
| [INNER_JOIN(SqlBuilder.ClauseStringHandler<INNER_JOIN>)][4] | Appends the INNER JOIN clause using the provided interpolated string *handler*. |
| **INNER_JOIN(String)** | Appends the INNER JOIN clause using the provided *text*. |
Syntax
------
```csharp
public SqlBuilder INNER_JOIN(
string? text
)
```
#### Parameters
##### *text* [String][5]
The text that represents the body of the INNER JOIN clause.
#### Return Value
[SqlBuilder][6]
A reference to this instance after the append operation has completed.
See Also
--------
#### Reference
[SqlBuilder Class][6]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: INNER_JOIN.md
[3]: _If.md
[4]: INNER_JOIN_1.md
[5]: https://learn.microsoft.com/dotnet/api/system.string
[6]: README.md
================================================
FILE: docs/api/DbExtensions/SqlBuilder/INSERT_INTO.md
================================================
SqlBuilder.INSERT_INTO(SqlBuilder.ClauseStringHandler<SqlClause.INSERT_INTO>) Method
=======================================================================================
Appends the INSERT INTO clause using the provided interpolated string *handler*.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| --------------------------------------------------------------- | -------------------------------------------------------------------------------- |
| **INSERT_INTO(SqlBuilder.ClauseStringHandler<INSERT_INTO>)** | Appends the INSERT INTO clause using the provided interpolated string *handler*. |
| [INSERT_INTO(String)][2] | Appends the INSERT INTO clause using the provided *text*. |
Syntax
------
```csharp
public SqlBuilder INSERT_INTO(
ref ClauseStringHandler handler
)
```
#### Parameters
##### *handler* ClauseStringHandler<INSERT_INTO>
The interpolated string that represents the body of the INSERT INTO clause.
#### Return Value
[SqlBuilder][3]
A reference to this instance after the append operation has completed.
See Also
--------
#### Reference
[SqlBuilder Class][3]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: INSERT_INTO_1.md
[3]: README.md
================================================
FILE: docs/api/DbExtensions/SqlBuilder/INSERT_INTO_1.md
================================================
SqlBuilder.INSERT_INTO(String) Method
=====================================
Appends the INSERT INTO clause using the provided *text*.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ---------------------------------------------------------------- | -------------------------------------------------------------------------------- |
| [INSERT_INTO(SqlBuilder.ClauseStringHandler<INSERT_INTO>)][2] | Appends the INSERT INTO clause using the provided interpolated string *handler*. |
| **INSERT_INTO(String)** | Appends the INSERT INTO clause using the provided *text*. |
Syntax
------
```csharp
public SqlBuilder INSERT_INTO(
string? text
)
```
#### Parameters
##### *text* [String][3]
The text that represents the body of the INSERT INTO clause.
#### Return Value
[SqlBuilder][4]
A reference to this instance after the append operation has completed.
See Also
--------
#### Reference
[SqlBuilder Class][4]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: INSERT_INTO.md
[3]: https://learn.microsoft.com/dotnet/api/system.string
[4]: README.md
================================================
FILE: docs/api/DbExtensions/SqlBuilder/InsertText.md
================================================
SqlBuilder.InsertText Method
============================
Inserts a string into this instance at the specified character position.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public SqlBuilder InsertText(
int index,
string? value
)
```
#### Parameters
##### *index* [Int32][2]
The position in this instance where insertion begins.
##### *value* [String][3]
The string to insert.
#### Return Value
[SqlBuilder][4]
A reference to this instance after the insert operation has completed.
See Also
--------
#### Reference
[SqlBuilder Class][4]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: https://learn.microsoft.com/dotnet/api/system.int32
[3]: https://learn.microsoft.com/dotnet/api/system.string
[4]: README.md
================================================
FILE: docs/api/DbExtensions/SqlBuilder/IsEmpty.md
================================================
SqlBuilder.IsEmpty Property
===========================
Returns `true` if the buffer is empty.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public bool IsEmpty { get; }
```
#### Property Value
[Boolean][2]
See Also
--------
#### Reference
[SqlBuilder Class][3]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: https://learn.microsoft.com/dotnet/api/system.boolean
[3]: README.md
================================================
FILE: docs/api/DbExtensions/SqlBuilder/JOIN.md
================================================
SqlBuilder.JOIN Method
======================
Sets JOIN as the next clause, to be used by subsequent calls to clause continuation methods, such as [_If(Boolean, ConditionalStringHandler)][1].
**Namespace:** [DbExtensions][2]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| -------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
| **JOIN()** | Sets JOIN as the next clause, to be used by subsequent calls to clause continuation methods, such as [_If(Boolean, ConditionalStringHandler)][1]. |
| [JOIN(SqlBuilder.ClauseStringHandler<JOIN>)][3] | Appends the JOIN clause using the provided interpolated string *handler*. |
| [JOIN(String)][4] | Appends the JOIN clause using the provided *text*. |
Syntax
------
```csharp
public SqlBuilder JOIN()
```
#### Return Value
[SqlBuilder][5]
A reference to this instance after the operation has completed.
See Also
--------
#### Reference
[SqlBuilder Class][5]
[DbExtensions Namespace][2]
[1]: _If.md
[2]: ../README.md
[3]: JOIN_1.md
[4]: JOIN_2.md
[5]: README.md
================================================
FILE: docs/api/DbExtensions/SqlBuilder/JOIN_1.md
================================================
SqlBuilder.JOIN(SqlBuilder.ClauseStringHandler<SqlClause.JOIN>) Method
=========================================================================
Appends the JOIN clause using the provided interpolated string *handler*.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
| [JOIN()][2] | Sets JOIN as the next clause, to be used by subsequent calls to clause continuation methods, such as [_If(Boolean, ConditionalStringHandler)][3]. |
| **JOIN(SqlBuilder.ClauseStringHandler<JOIN>)** | Appends the JOIN clause using the provided interpolated string *handler*. |
| [JOIN(String)][4] | Appends the JOIN clause using the provided *text*. |
Syntax
------
```csharp
public SqlBuilder JOIN(
ref ClauseStringHandler handler
)
```
#### Parameters
##### *handler* ClauseStringHandler<JOIN>
The interpolated string that represents the body of the JOIN clause.
#### Return Value
[SqlBuilder][5]
A reference to this instance after the append operation has completed.
See Also
--------
#### Reference
[SqlBuilder Class][5]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: JOIN.md
[3]: _If.md
[4]: JOIN_2.md
[5]: README.md
================================================
FILE: docs/api/DbExtensions/SqlBuilder/JOIN_2.md
================================================
SqlBuilder.JOIN(String) Method
==============================
Appends the JOIN clause using the provided *text*.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| -------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
| [JOIN()][2] | Sets JOIN as the next clause, to be used by subsequent calls to clause continuation methods, such as [_If(Boolean, ConditionalStringHandler)][3]. |
| [JOIN(SqlBuilder.ClauseStringHandler<JOIN>)][4] | Appends the JOIN clause using the provided interpolated string *handler*. |
| **JOIN(String)** | Appends the JOIN clause using the provided *text*. |
Syntax
------
```csharp
public SqlBuilder JOIN(
string? text
)
```
#### Parameters
##### *text* [String][5]
The text that represents the body of the JOIN clause.
#### Return Value
[SqlBuilder][6]
A reference to this instance after the append operation has completed.
See Also
--------
#### Reference
[SqlBuilder Class][6]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: JOIN.md
[3]: _If.md
[4]: JOIN_1.md
[5]: https://learn.microsoft.com/dotnet/api/system.string
[6]: README.md
================================================
FILE: docs/api/DbExtensions/SqlBuilder/JoinSql.md
================================================
SqlBuilder.JoinSql(String, SqlBuilder[]) Method
===============================================
Concatenates a specified separator [String][1] between each element of a specified [SqlBuilder][2] array, yielding a single concatenated [SqlBuilder][2].
**Namespace:** [DbExtensions][3]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **JoinSql(String, SqlBuilder[])** | Concatenates a specified separator [String][1] between each element of a specified [SqlBuilder][2] array, yielding a single concatenated [SqlBuilder][2]. |
| [JoinSql(String, IEnumerable<SqlBuilder>)][4] | Concatenates the members of a constructed [IEnumerable<T>][5] collection of type [SqlBuilder][2], using the specified *separator* between each member. |
Syntax
------
```csharp
public static SqlBuilder JoinSql(
string? separator,
params SqlBuilder?[] values
)
```
#### Parameters
##### *separator* [String][1]
The string to use as a separator.
##### *values* [SqlBuilder][2][]
An array of [SqlBuilder][2].
#### Return Value
[SqlBuilder][2]
A [SqlBuilder][2] consisting of the elements of *values* interspersed with the *separator* string.
See Also
--------
#### Reference
[SqlBuilder Class][2]
[DbExtensions Namespace][3]
[1]: https://learn.microsoft.com/dotnet/api/system.string
[2]: README.md
[3]: ../README.md
[4]: JoinSql_1.md
[5]: https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1
================================================
FILE: docs/api/DbExtensions/SqlBuilder/JoinSql_1.md
================================================
SqlBuilder.JoinSql(String, IEnumerable<SqlBuilder>) Method
=============================================================
Concatenates the members of a constructed [IEnumerable<T>][1] collection of type [SqlBuilder][2], using the specified *separator* between each member.
**Namespace:** [DbExtensions][3]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ----------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [JoinSql(String, SqlBuilder[])][4] | Concatenates a specified separator [String][5] between each element of a specified [SqlBuilder][2] array, yielding a single concatenated [SqlBuilder][2]. |
| **JoinSql(String, IEnumerable<SqlBuilder>)** | Concatenates the members of a constructed [IEnumerable<T>][1] collection of type [SqlBuilder][2], using the specified *separator* between each member. |
Syntax
------
```csharp
public static SqlBuilder JoinSql(
string? separator,
IEnumerable values
)
```
#### Parameters
##### *separator* [String][5]
The string to use as a separator.
##### *values* [IEnumerable][1]<[SqlBuilder][2]>
A collection that contains the [SqlBuilder][2] objects to concatenate.
#### Return Value
[SqlBuilder][2]
A [SqlBuilder][2] that consists of the members of *values* delimited by the *separator* string. If *values* has no members, the method returns an empty [SqlBuilder][2].
See Also
--------
#### Reference
[SqlBuilder Class][2]
[DbExtensions Namespace][3]
[1]: https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1
[2]: README.md
[3]: ../README.md
[4]: JoinSql.md
[5]: https://learn.microsoft.com/dotnet/api/system.string
================================================
FILE: docs/api/DbExtensions/SqlBuilder/LEFT_JOIN.md
================================================
SqlBuilder.LEFT_JOIN Method
===========================
Sets LEFT JOIN as the next clause, to be used by subsequent calls to clause continuation methods, such as [_If(Boolean, ConditionalStringHandler)][1].
**Namespace:** [DbExtensions][2]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **LEFT_JOIN()** | Sets LEFT JOIN as the next clause, to be used by subsequent calls to clause continuation methods, such as [_If(Boolean, ConditionalStringHandler)][1]. |
| [LEFT_JOIN(SqlBuilder.ClauseStringHandler<LEFT_JOIN>)][3] | Appends the LEFT JOIN clause using the provided interpolated string *handler*. |
| [LEFT_JOIN(String)][4] | Appends the LEFT JOIN clause using the provided *text*. |
Syntax
------
```csharp
public SqlBuilder LEFT_JOIN()
```
#### Return Value
[SqlBuilder][5]
A reference to this instance after the operation has completed.
See Also
--------
#### Reference
[SqlBuilder Class][5]
[DbExtensions Namespace][2]
[1]: _If.md
[2]: ../README.md
[3]: LEFT_JOIN_1.md
[4]: LEFT_JOIN_2.md
[5]: README.md
================================================
FILE: docs/api/DbExtensions/SqlBuilder/LEFT_JOIN_1.md
================================================
SqlBuilder.LEFT_JOIN(SqlBuilder.ClauseStringHandler<SqlClause.LEFT_JOIN>) Method
===================================================================================
Appends the LEFT JOIN clause using the provided interpolated string *handler*.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ----------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
| [LEFT_JOIN()][2] | Sets LEFT JOIN as the next clause, to be used by subsequent calls to clause continuation methods, such as [_If(Boolean, ConditionalStringHandler)][3]. |
| **LEFT_JOIN(SqlBuilder.ClauseStringHandler<LEFT_JOIN>)** | Appends the LEFT JOIN clause using the provided interpolated string *handler*. |
| [LEFT_JOIN(String)][4] | Appends the LEFT JOIN clause using the provided *text*. |
Syntax
------
```csharp
public SqlBuilder LEFT_JOIN(
ref ClauseStringHandler handler
)
```
#### Parameters
##### *handler* ClauseStringHandler<LEFT_JOIN>
The interpolated string that represents the body of the LEFT JOIN clause.
#### Return Value
[SqlBuilder][5]
A reference to this instance after the append operation has completed.
See Also
--------
#### Reference
[SqlBuilder Class][5]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: LEFT_JOIN.md
[3]: _If.md
[4]: LEFT_JOIN_2.md
[5]: README.md
================================================
FILE: docs/api/DbExtensions/SqlBuilder/LEFT_JOIN_2.md
================================================
SqlBuilder.LEFT_JOIN(String) Method
===================================
Appends the LEFT JOIN clause using the provided *text*.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
| [LEFT_JOIN()][2] | Sets LEFT JOIN as the next clause, to be used by subsequent calls to clause continuation methods, such as [_If(Boolean, ConditionalStringHandler)][3]. |
| [LEFT_JOIN(SqlBuilder.ClauseStringHandler<LEFT_JOIN>)][4] | Appends the LEFT JOIN clause using the provided interpolated string *handler*. |
| **LEFT_JOIN(String)** | Appends the LEFT JOIN clause using the provided *text*. |
Syntax
------
```csharp
public SqlBuilder LEFT_JOIN(
string? text
)
```
#### Parameters
##### *text* [String][5]
The text that represents the body of the LEFT JOIN clause.
#### Return Value
[SqlBuilder][6]
A reference to this instance after the append operation has completed.
See Also
--------
#### Reference
[SqlBuilder Class][6]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: LEFT_JOIN.md
[3]: _If.md
[4]: LEFT_JOIN_1.md
[5]: https://learn.microsoft.com/dotnet/api/system.string
[6]: README.md
================================================
FILE: docs/api/DbExtensions/SqlBuilder/LIMIT.md
================================================
SqlBuilder.LIMIT Method
=======================
Sets LIMIT as the next clause, to be used by subsequent calls to clause continuation methods, such as [_If(Boolean, ConditionalStringHandler)][1].
**Namespace:** [DbExtensions][2]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ---------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
| **LIMIT()** | Sets LIMIT as the next clause, to be used by subsequent calls to clause continuation methods, such as [_If(Boolean, ConditionalStringHandler)][1]. |
| [LIMIT(SqlBuilder.ClauseStringHandler<LIMIT>)][3] | Appends the LIMIT clause using the provided interpolated string *handler*. |
| [LIMIT(Int32)][4] | Appends the LIMIT clause using the provided *maxRecords* parameter. |
| [LIMIT(String)][5] | Appends the LIMIT clause using the provided *text*. |
Syntax
------
```csharp
public SqlBuilder LIMIT()
```
#### Return Value
[SqlBuilder][6]
A reference to this instance after the operation has completed.
See Also
--------
#### Reference
[SqlBuilder Class][6]
[DbExtensions Namespace][2]
[1]: _If.md
[2]: ../README.md
[3]: LIMIT_1.md
[4]: LIMIT_2.md
[5]: LIMIT_3.md
[6]: README.md
================================================
FILE: docs/api/DbExtensions/SqlBuilder/LIMIT_1.md
================================================
SqlBuilder.LIMIT(SqlBuilder.ClauseStringHandler<SqlClause.LIMIT>) Method
===========================================================================
Appends the LIMIT clause using the provided interpolated string *handler*.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| --------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
| [LIMIT()][2] | Sets LIMIT as the next clause, to be used by subsequent calls to clause continuation methods, such as [_If(Boolean, ConditionalStringHandler)][3]. |
| **LIMIT(SqlBuilder.ClauseStringHandler<LIMIT>)** | Appends the LIMIT clause using the provided interpolated string *handler*. |
| [LIMIT(Int32)][4] | Appends the LIMIT clause using the provided *maxRecords* parameter. |
| [LIMIT(String)][5] | Appends the LIMIT clause using the provided *text*. |
Syntax
------
```csharp
public SqlBuilder LIMIT(
ref ClauseStringHandler handler
)
```
#### Parameters
##### *handler* ClauseStringHandler<LIMIT>
The interpolated string that represents the body of the LIMIT clause.
#### Return Value
[SqlBuilder][6]
A reference to this instance after the append operation has completed.
See Also
--------
#### Reference
[SqlBuilder Class][6]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: LIMIT.md
[3]: _If.md
[4]: LIMIT_2.md
[5]: LIMIT_3.md
[6]: README.md
================================================
FILE: docs/api/DbExtensions/SqlBuilder/LIMIT_2.md
================================================
SqlBuilder.LIMIT(Int32) Method
==============================
Appends the LIMIT clause using the provided *maxRecords* parameter.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ---------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
| [LIMIT()][2] | Sets LIMIT as the next clause, to be used by subsequent calls to clause continuation methods, such as [_If(Boolean, ConditionalStringHandler)][3]. |
| [LIMIT(SqlBuilder.ClauseStringHandler<LIMIT>)][4] | Appends the LIMIT clause using the provided interpolated string *handler*. |
| **LIMIT(Int32)** | Appends the LIMIT clause using the provided *maxRecords* parameter. |
| [LIMIT(String)][5] | Appends the LIMIT clause using the provided *text*. |
Syntax
------
```csharp
public SqlBuilder LIMIT(
int maxRecords
)
```
#### Parameters
##### *maxRecords* [Int32][6]
The value to use as parameter.
#### Return Value
[SqlBuilder][7]
A reference to this instance after the append operation has completed.
See Also
--------
#### Reference
[SqlBuilder Class][7]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: LIMIT.md
[3]: _If.md
[4]: LIMIT_1.md
[5]: LIMIT_3.md
[6]: https://learn.microsoft.com/dotnet/api/system.int32
[7]: README.md
================================================
FILE: docs/api/DbExtensions/SqlBuilder/LIMIT_3.md
================================================
SqlBuilder.LIMIT(String) Method
===============================
Appends the LIMIT clause using the provided *text*.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ---------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
| [LIMIT()][2] | Sets LIMIT as the next clause, to be used by subsequent calls to clause continuation methods, such as [_If(Boolean, ConditionalStringHandler)][3]. |
| [LIMIT(SqlBuilder.ClauseStringHandler<LIMIT>)][4] | Appends the LIMIT clause using the provided interpolated string *handler*. |
| [LIMIT(Int32)][5] | Appends the LIMIT clause using the provided *maxRecords* parameter. |
| **LIMIT(String)** | Appends the LIMIT clause using the provided *text*. |
Syntax
------
```csharp
public SqlBuilder LIMIT(
string? text
)
```
#### Parameters
##### *text* [String][6]
The text that represents the body of the LIMIT clause.
#### Return Value
[SqlBuilder][7]
A reference to this instance after the append operation has completed.
See Also
--------
#### Reference
[SqlBuilder Class][7]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: LIMIT.md
[3]: _If.md
[4]: LIMIT_1.md
[5]: LIMIT_2.md
[6]: https://learn.microsoft.com/dotnet/api/system.string
[7]: README.md
================================================
FILE: docs/api/DbExtensions/SqlBuilder/NextClause.md
================================================
SqlBuilder.NextClause Property
==============================
Gets or sets the next SQL clause. Used by clause continuation methods, such as [_(String)][1] and [_If(Boolean, ConditionalStringHandler)][2].
**Namespace:** [DbExtensions][3]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public SqlClause? NextClause { get; set; }
```
#### Property Value
[SqlClause][4]
See Also
--------
#### Reference
[SqlBuilder Class][5]
[DbExtensions Namespace][3]
[1]: __1.md
[2]: _If.md
[3]: ../README.md
[4]: ../SqlClause/README.md
[5]: README.md
================================================
FILE: docs/api/DbExtensions/SqlBuilder/OFFSET.md
================================================
SqlBuilder.OFFSET Method
========================
Sets OFFSET as the next clause, to be used by subsequent calls to clause continuation methods, such as [_If(Boolean, ConditionalStringHandler)][1].
**Namespace:** [DbExtensions][2]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------- |
| **OFFSET()** | Sets OFFSET as the next clause, to be used by subsequent calls to clause continuation methods, such as [_If(Boolean, ConditionalStringHandler)][1]. |
| [OFFSET(SqlBuilder.ClauseStringHandler<OFFSET>)][3] | Appends the OFFSET clause using the provided interpolated string *handler*. |
| [OFFSET(Int32)][4] | Appends the OFFSET clause using the provided *startIndex* parameter. |
| [OFFSET(String)][5] | Appends the OFFSET clause using the provided *text*. |
Syntax
------
```csharp
public SqlBuilder OFFSET()
```
#### Return Value
[SqlBuilder][6]
A reference to this instance after the operation has completed.
See Also
--------
#### Reference
[SqlBuilder Class][6]
[DbExtensions Namespace][2]
[1]: _If.md
[2]: ../README.md
[3]: OFFSET_1.md
[4]: OFFSET_2.md
[5]: OFFSET_3.md
[6]: README.md
================================================
FILE: docs/api/DbExtensions/SqlBuilder/OFFSET_1.md
================================================
SqlBuilder.OFFSET(SqlBuilder.ClauseStringHandler<SqlClause.OFFSET>) Method
=============================================================================
Appends the OFFSET clause using the provided interpolated string *handler*.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ----------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |
| [OFFSET()][2] | Sets OFFSET as the next clause, to be used by subsequent calls to clause continuation methods, such as [_If(Boolean, ConditionalStringHandler)][3]. |
| **OFFSET(SqlBuilder.ClauseStringHandler<OFFSET>)** | Appends the OFFSET clause using the provided interpolated string *handler*. |
| [OFFSET(Int32)][4] | Appends the OFFSET clause using the provided *startIndex* parameter. |
| [OFFSET(String)][5] | Appends the OFFSET clause using the provided *text*. |
Syntax
------
```csharp
public SqlBuilder OFFSET(
ref ClauseStringHandler handler
)
```
#### Parameters
##### *handler* ClauseStringHandler<OFFSET>
The interpolated string that represents the body of the OFFSET clause.
#### Return Value
[SqlBuilder][6]
A reference to this instance after the append operation has completed.
See Also
--------
#### Reference
[SqlBuilder Class][6]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: OFFSET.md
[3]: _If.md
[4]: OFFSET_2.md
[5]: OFFSET_3.md
[6]: README.md
================================================
FILE: docs/api/DbExtensions/SqlBuilder/OFFSET_2.md
================================================
SqlBuilder.OFFSET(Int32) Method
===============================
Appends the OFFSET clause using the provided *startIndex* parameter.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------- |
| [OFFSET()][2] | Sets OFFSET as the next clause, to be used by subsequent calls to clause continuation methods, such as [_If(Boolean, ConditionalStringHandler)][3]. |
| [OFFSET(SqlBuilder.ClauseStringHandler<OFFSET>)][4] | Appends the OFFSET clause using the provided interpolated string *handler*. |
| **OFFSET(Int32)** | Appends the OFFSET clause using the provided *startIndex* parameter. |
| [OFFSET(String)][5] | Appends the OFFSET clause using the provided *text*. |
Syntax
------
```csharp
public SqlBuilder OFFSET(
int startIndex
)
```
#### Parameters
##### *startIndex* [Int32][6]
The value to use as parameter.
#### Return Value
[SqlBuilder][7]
A reference to this instance after the append operation has completed.
See Also
--------
#### Reference
[SqlBuilder Class][7]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: OFFSET.md
[3]: _If.md
[4]: OFFSET_1.md
[5]: OFFSET_3.md
[6]: https://learn.microsoft.com/dotnet/api/system.int32
[7]: README.md
================================================
FILE: docs/api/DbExtensions/SqlBuilder/OFFSET_3.md
================================================
SqlBuilder.OFFSET(String) Method
================================
Appends the OFFSET clause using the provided *text*.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------- |
| [OFFSET()][2] | Sets OFFSET as the next clause, to be used by subsequent calls to clause continuation methods, such as [_If(Boolean, ConditionalStringHandler)][3]. |
| [OFFSET(SqlBuilder.ClauseStringHandler<OFFSET>)][4] | Appends the OFFSET clause using the provided interpolated string *handler*. |
| [OFFSET(Int32)][5] | Appends the OFFSET clause using the provided *startIndex* parameter. |
| **OFFSET(String)** | Appends the OFFSET clause using the provided *text*. |
Syntax
------
```csharp
public SqlBuilder OFFSET(
string? text
)
```
#### Parameters
##### *text* [String][6]
The text that represents the body of the OFFSET clause.
#### Return Value
[SqlBuilder][7]
A reference to this instance after the append operation has completed.
See Also
--------
#### Reference
[SqlBuilder Class][7]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: OFFSET.md
[3]: _If.md
[4]: OFFSET_1.md
[5]: OFFSET_2.md
[6]: https://learn.microsoft.com/dotnet/api/system.string
[7]: README.md
================================================
FILE: docs/api/DbExtensions/SqlBuilder/ORDER_BY.md
================================================
SqlBuilder.ORDER_BY Method
==========================
Sets ORDER BY as the next clause, to be used by subsequent calls to clause continuation methods, such as [_If(Boolean, ConditionalStringHandler)][1].
**Namespace:** [DbExtensions][2]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ---------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
| **ORDER_BY()** | Sets ORDER BY as the next clause, to be used by subsequent calls to clause continuation methods, such as [_If(Boolean, ConditionalStringHandler)][1]. |
| [ORDER_BY(SqlBuilder.ClauseStringHandler<ORDER_BY>)][3] | Appends the ORDER BY clause using the provided interpolated string *handler*. |
| [ORDER_BY(String)][4] | Appends the ORDER BY clause using the provided *text*. |
Syntax
------
```csharp
public SqlBuilder ORDER_BY()
```
#### Return Value
[SqlBuilder][5]
A reference to this instance after the operation has completed.
See Also
--------
#### Reference
[SqlBuilder Class][5]
[DbExtensions Namespace][2]
[1]: _If.md
[2]: ../README.md
[3]: ORDER_BY_1.md
[4]: ORDER_BY_2.md
[5]: README.md
================================================
FILE: docs/api/DbExtensions/SqlBuilder/ORDER_BY_1.md
================================================
SqlBuilder.ORDER_BY(SqlBuilder.ClauseStringHandler<SqlClause.ORDER_BY>) Method
=================================================================================
Appends the ORDER BY clause using the provided interpolated string *handler*.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| --------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
| [ORDER_BY()][2] | Sets ORDER BY as the next clause, to be used by subsequent calls to clause continuation methods, such as [_If(Boolean, ConditionalStringHandler)][3]. |
| **ORDER_BY(SqlBuilder.ClauseStringHandler<ORDER_BY>)** | Appends the ORDER BY clause using the provided interpolated string *handler*. |
| [ORDER_BY(String)][4] | Appends the ORDER BY clause using the provided *text*. |
Syntax
------
```csharp
public SqlBuilder ORDER_BY(
ref ClauseStringHandler handler
)
```
#### Parameters
##### *handler* ClauseStringHandler<ORDER_BY>
The interpolated string that represents the body of the ORDER BY clause.
#### Return Value
[SqlBuilder][5]
A reference to this instance after the append operation has completed.
See Also
--------
#### Reference
[SqlBuilder Class][5]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: ORDER_BY.md
[3]: _If.md
[4]: ORDER_BY_2.md
[5]: README.md
================================================
FILE: docs/api/DbExtensions/SqlBuilder/ORDER_BY_2.md
================================================
SqlBuilder.ORDER_BY(String) Method
==================================
Appends the ORDER BY clause using the provided *text*.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ---------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
| [ORDER_BY()][2] | Sets ORDER BY as the next clause, to be used by subsequent calls to clause continuation methods, such as [_If(Boolean, ConditionalStringHandler)][3]. |
| [ORDER_BY(SqlBuilder.ClauseStringHandler<ORDER_BY>)][4] | Appends the ORDER BY clause using the provided interpolated string *handler*. |
| **ORDER_BY(String)** | Appends the ORDER BY clause using the provided *text*. |
Syntax
------
```csharp
public SqlBuilder ORDER_BY(
string? text
)
```
#### Parameters
##### *text* [String][5]
The text that represents the body of the ORDER BY clause.
#### Return Value
[SqlBuilder][6]
A reference to this instance after the append operation has completed.
See Also
--------
#### Reference
[SqlBuilder Class][6]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: ORDER_BY.md
[3]: _If.md
[4]: ORDER_BY_1.md
[5]: https://learn.microsoft.com/dotnet/api/system.string
[6]: README.md
================================================
FILE: docs/api/DbExtensions/SqlBuilder/ParameterValues.md
================================================
SqlBuilder.ParameterValues Property
===================================
The parameter objects to be included in the database command.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public Collection ParameterValues { get; }
```
#### Property Value
[Collection][2]<[Object][3]>
See Also
--------
#### Reference
[SqlBuilder Class][4]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: https://learn.microsoft.com/dotnet/api/system.collections.objectmodel.collection-1
[3]: https://learn.microsoft.com/dotnet/api/system.object
[4]: README.md
================================================
FILE: docs/api/DbExtensions/SqlBuilder/README.md
================================================
SqlBuilder Class
================
Represents a mutable SQL string.
Inheritance Hierarchy
---------------------
[System.Object][1]
**DbExtensions.SqlBuilder**
**Namespace:** [DbExtensions][2]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public sealed class SqlBuilder
```
The **SqlBuilder** type exposes the following members.
Properties
----------
| Name | Description |
| --------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
| [Buffer][3] | The underlying [StringBuilder][4]. |
| [CurrentClause][5] | Gets or sets the current SQL clause, used to identify consecutive appends to the same clause. |
| [IsEmpty][6] | Returns `true` if the buffer is empty. |
| [NextClause][7] | Gets or sets the next SQL clause. Used by clause continuation methods, such as [_(String)][8] and [_If(Boolean, ConditionalStringHandler)][9]. |
| [ParameterValues][10] | The parameter objects to be included in the database command. |
Methods
-------
| Name | Description |
| ----------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [_(SqlBuilder.ClauseStringHandler<Current>)][11] | Appends the interpolated string *handler* to the current clause. |
| [_(String)][8] | Appends the *text* to the current clause. |
| [_Else][12] | Appends *handler* to the current clause if an antecedent call to [_If(Boolean, ConditionalStringHandler)][9] or [_ElseIf(Boolean, ConditionalElseStringHandler)][13] used a `false` condition |
| [_ElseIf][13] | Appends *handler* to the current clause if *condition* is `true` and an antecedent call to [_If(Boolean, ConditionalStringHandler)][9] or [_ElseIf(Boolean, ConditionalElseStringHandler)][13] used a `false` condition. |
| [_If][9] | Appends the interpolated string *handler* to the current clause if *condition* is `true`. |
| [Append(AppendStringHandler)][14] | Appends the interpolated string *handler* to this instance. |
| [Append(String)][15] | Appends *text* to this instance. |
| [AppendClause(SqlClause)][16] | Appends the SQL *clause*. |
| [AppendClause<TClause>()][17] | Appends the SQL clause identified by TClause. |
| [AppendElse][18] | Appends the interpolated string *handler* if an antecedent call to [AppendIf(Boolean, AppendStringHandler)][19] or [AppendElseIf(Boolean, AppendElseStringHandler)][20] used a `false` condition |
| [AppendElseIf][20] | Appends the interpolated string *handler* if *condition* is `true` and an antecedent call to [AppendIf(Boolean, AppendStringHandler)][19] or [AppendElseIf(Boolean, AppendElseStringHandler)][20] used a `false` condition. |
| [AppendIf][19] | Appends the interpolated string *handler* if *condition* is `true`. |
| [AppendLine][21] | Appends the default line terminator to this instance. |
| [AppendSql][22] | Appends *sql* to this instance. |
| [Clone][23] | Creates and returns a copy of this instance. |
| [CROSS_JOIN()][24] | Sets CROSS JOIN as the next clause, to be used by subsequent calls to clause continuation methods, such as [_If(Boolean, ConditionalStringHandler)][9]. |
| [CROSS_JOIN(SqlBuilder.ClauseStringHandler<CROSS_JOIN>)][25] | Appends the CROSS JOIN clause using the provided interpolated string *handler*. |
| [CROSS_JOIN(String)][26] | Appends the CROSS JOIN clause using the provided *text*. |
| [DELETE_FROM(SqlBuilder.ClauseStringHandler<DELETE_FROM>)][27] | Appends the DELETE FROM clause using the provided interpolated string *handler*. |
| [DELETE_FROM(String)][28] | Appends the DELETE FROM clause using the provided *text*. |
| [FROM()][29] | Sets FROM as the next clause, to be used by subsequent calls to clause continuation methods, such as [_If(Boolean, ConditionalStringHandler)][9]. |
| [FROM(SqlBuilder.ClauseStringHandler<FROM>)][30] | Appends the FROM clause using the provided interpolated string *handler*. |
| [FROM(String)][31] | Appends the FROM clause using the provided *text*. |
| [FROM(SqlBuilder, String)][32] | Appends the FROM clause using the provided *subQuery* as body named after *alias*. |
| [FROM(SqlSet, String)][33] | Appends the FROM clause using the provided *subQuery* as body named after *alias*. |
| [GROUP_BY()][34] | Sets GROUP BY as the next clause, to be used by subsequent calls to clause continuation methods, such as [_If(Boolean, ConditionalStringHandler)][9]. |
| [GROUP_BY(SqlBuilder.ClauseStringHandler<GROUP_BY>)][35] | Appends the GROUP BY clause using the provided interpolated string *handler*. |
| [GROUP_BY(String)][36] | Appends the GROUP BY clause using the provided *text*. |
| [HAVING()][37] | Sets HAVING as the next clause, to be used by subsequent calls to clause continuation methods, such as [_If(Boolean, ConditionalStringHandler)][9]. |
| [HAVING(SqlBuilder.ClauseStringHandler<HAVING>)][38] | Appends the HAVING clause using the provided interpolated string *handler*. |
| [HAVING(String)][39] | Appends the HAVING clause using the provided *text*. |
| [INNER_JOIN()][40] | Sets INNER JOIN as the next clause, to be used by subsequent calls to clause continuation methods, such as [_If(Boolean, ConditionalStringHandler)][9]. |
| [INNER_JOIN(SqlBuilder.ClauseStringHandler<INNER_JOIN>)][41] | Appends the INNER JOIN clause using the provided interpolated string *handler*. |
| [INNER_JOIN(String)][42] | Appends the INNER JOIN clause using the provided *text*. |
| [INSERT_INTO(SqlBuilder.ClauseStringHandler<INSERT_INTO>)][43] | Appends the INSERT INTO clause using the provided interpolated string *handler*. |
| [INSERT_INTO(String)][44] | Appends the INSERT INTO clause using the provided *text*. |
| [InsertText][45] | Inserts a string into this instance at the specified character position. |
| [JOIN()][46] | Sets JOIN as the next clause, to be used by subsequent calls to clause continuation methods, such as [_If(Boolean, ConditionalStringHandler)][9]. |
| [JOIN(SqlBuilder.ClauseStringHandler<JOIN>)][47] | Appends the JOIN clause using the provided interpolated string *handler*. |
| [JOIN(String)][48] | Appends the JOIN clause using the provided *text*. |
| [JoinSql(String, SqlBuilder[])][49] | Concatenates a specified separator [String][50] between each element of a specified **SqlBuilder** array, yielding a single concatenated **SqlBuilder**. |
| [JoinSql(String, IEnumerable<SqlBuilder>)][51] | Concatenates the members of a constructed [IEnumerable<T>][52] collection of type **SqlBuilder**, using the specified *separator* between each member. |
| [LEFT_JOIN()][53] | Sets LEFT JOIN as the next clause, to be used by subsequent calls to clause continuation methods, such as [_If(Boolean, ConditionalStringHandler)][9]. |
| [LEFT_JOIN(SqlBuilder.ClauseStringHandler<LEFT_JOIN>)][54] | Appends the LEFT JOIN clause using the provided interpolated string *handler*. |
| [LEFT_JOIN(String)][55] | Appends the LEFT JOIN clause using the provided *text*. |
| [LIMIT()][56] | Sets LIMIT as the next clause, to be used by subsequent calls to clause continuation methods, such as [_If(Boolean, ConditionalStringHandler)][9]. |
| [LIMIT(SqlBuilder.ClauseStringHandler<LIMIT>)][57] | Appends the LIMIT clause using the provided interpolated string *handler*. |
| [LIMIT(Int32)][58] | Appends the LIMIT clause using the provided *maxRecords* parameter. |
| [LIMIT(String)][59] | Appends the LIMIT clause using the provided *text*. |
| [OFFSET()][60] | Sets OFFSET as the next clause, to be used by subsequent calls to clause continuation methods, such as [_If(Boolean, ConditionalStringHandler)][9]. |
| [OFFSET(SqlBuilder.ClauseStringHandler<OFFSET>)][61] | Appends the OFFSET clause using the provided interpolated string *handler*. |
| [OFFSET(Int32)][62] | Appends the OFFSET clause using the provided *startIndex* parameter. |
| [OFFSET(String)][63] | Appends the OFFSET clause using the provided *text*. |
| [ORDER_BY()][64] | Sets ORDER BY as the next clause, to be used by subsequent calls to clause continuation methods, such as [_If(Boolean, ConditionalStringHandler)][9]. |
| [ORDER_BY(SqlBuilder.ClauseStringHandler<ORDER_BY>)][65] | Appends the ORDER BY clause using the provided interpolated string *handler*. |
| [ORDER_BY(String)][66] | Appends the ORDER BY clause using the provided *text*. |
| [RIGHT_JOIN()][67] | Sets RIGHT JOIN as the next clause, to be used by subsequent calls to clause continuation methods, such as [_If(Boolean, ConditionalStringHandler)][9]. |
| [RIGHT_JOIN(SqlBuilder.ClauseStringHandler<RIGHT_JOIN>)][68] | Appends the RIGHT JOIN clause using the provided interpolated string *handler*. |
| [RIGHT_JOIN(String)][69] | Appends the RIGHT JOIN clause using the provided *text*. |
| [SELECT()][70] | Sets SELECT as the next clause, to be used by subsequent calls to clause continuation methods, such as [_If(Boolean, ConditionalStringHandler)][9]. |
| [SELECT(SqlBuilder.ClauseStringHandler<SELECT>)][71] | Appends the SELECT clause using the provided interpolated string *handler*. |
| [SELECT(String)][72] | Appends the SELECT clause using the provided *text*. |
| [SET(SqlBuilder.ClauseStringHandler<SET>)][73] | Appends the SET clause using the provided interpolated string *handler*. |
| [SET(String)][74] | Appends the SET clause using the provided *text*. |
| [SetCurrentClause(SqlClause)][75] | Sets *clause* as the current SQL clause. |
| [SetCurrentClause<TClause>()][76] | Sets the clause identified by TClause as the current SQL clause. |
| [SetNextClause(SqlClause)][77] | Sets *clause* as the next SQL clause. |
| [SetNextClause<TClause>()][78] | Sets the clause identified by TClause as the next SQL clause. |
| [ToString][79] | Converts the value of this instance to a [String][50]. (Overrides [Object.ToString()][80]) |
| [UNION][81] | Appends the UNION clause. |
| [UPDATE(SqlBuilder.ClauseStringHandler<UPDATE>)][82] | Appends the UPDATE clause using the provided interpolated string *handler*. |
| [UPDATE(String)][83] | Appends the UPDATE clause using the provided *text*. |
| [VALUES(SqlBuilder.ClauseStringHandler<VALUES>)][84] | Appends the VALUES clause using the provided interpolated string *handler*. |
| [VALUES(Object[])][85] | Appends the VALUES clause using the provided parameters. |
| [WHERE()][86] | Sets WHERE as the next clause, to be used by subsequent calls to clause continuation methods, such as [_If(Boolean, ConditionalStringHandler)][9]. |
| [WHERE(SqlBuilder.ClauseStringHandler<WHERE>)][87] | Appends the WHERE clause using the provided interpolated string *handler*. |
| [WHERE(String)][88] | Appends the WHERE clause using the provided *text*. |
| [WITH(SqlBuilder.ClauseStringHandler<WITH>)][89] | Appends the WITH clause using the provided interpolated string *handler*. |
| [WITH(String)][90] | Appends the WITH clause using the provided *text*. |
| [WITH(String, SqlBuilder)][91] | Appends the WITH clause using the provided *subQuery* as body named after *alias*. |
| [WITH(String, SqlSet)][92] | Appends the WITH clause using the provided *subQuery* as body named after *alias*. |
Remarks
-------
For information on how to use SqlBuilder see [SqlBuilder Tutorial][93].
See Also
--------
#### Reference
[DbExtensions Namespace][2]
[1]: https://learn.microsoft.com/dotnet/api/system.object
[2]: ../README.md
[3]: Buffer.md
[4]: https://learn.microsoft.com/dotnet/api/system.text.stringbuilder
[5]: CurrentClause.md
[6]: IsEmpty.md
[7]: NextClause.md
[8]: __1.md
[9]: _If.md
[10]: ParameterValues.md
[11]: _.md
[12]: _Else.md
[13]: _ElseIf.md
[14]: Append.md
[15]: Append_1.md
[16]: AppendClause.md
[17]: AppendClause__1.md
[18]: AppendElse.md
[19]: AppendIf.md
[20]: AppendElseIf.md
[21]: AppendLine.md
[22]: AppendSql.md
[23]: Clone.md
[24]: CROSS_JOIN.md
[25]: CROSS_JOIN_1.md
[26]: CROSS_JOIN_2.md
[27]: DELETE_FROM.md
[28]: DELETE_FROM_1.md
[29]: FROM.md
[30]: FROM_2.md
[31]: FROM_4.md
[32]: FROM_1.md
[33]: FROM_3.md
[34]: GROUP_BY.md
[35]: GROUP_BY_1.md
[36]: GROUP_BY_2.md
[37]: HAVING.md
[38]: HAVING_1.md
[39]: HAVING_2.md
[40]: INNER_JOIN.md
[41]: INNER_JOIN_1.md
[42]: INNER_JOIN_2.md
[43]: INSERT_INTO.md
[44]: INSERT_INTO_1.md
[45]: InsertText.md
[46]: JOIN.md
[47]: JOIN_1.md
[48]: JOIN_2.md
[49]: JoinSql.md
[50]: https://learn.microsoft.com/dotnet/api/system.string
[51]: JoinSql_1.md
[52]: https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1
[53]: LEFT_JOIN.md
[54]: LEFT_JOIN_1.md
[55]: LEFT_JOIN_2.md
[56]: LIMIT.md
[57]: LIMIT_1.md
[58]: LIMIT_2.md
[59]: LIMIT_3.md
[60]: OFFSET.md
[61]: OFFSET_1.md
[62]: OFFSET_2.md
[63]: OFFSET_3.md
[64]: ORDER_BY.md
[65]: ORDER_BY_1.md
[66]: ORDER_BY_2.md
[67]: RIGHT_JOIN.md
[68]: RIGHT_JOIN_1.md
[69]: RIGHT_JOIN_2.md
[70]: SELECT.md
[71]: SELECT_1.md
[72]: SELECT_2.md
[73]: SET.md
[74]: SET_1.md
[75]: SetCurrentClause.md
[76]: SetCurrentClause__1.md
[77]: SetNextClause.md
[78]: SetNextClause__1.md
[79]: ToString.md
[80]: https://learn.microsoft.com/dotnet/api/system.object.tostring
[81]: UNION.md
[82]: UPDATE.md
[83]: UPDATE_1.md
[84]: VALUES.md
[85]: VALUES_1.md
[86]: WHERE.md
[87]: WHERE_1.md
[88]: WHERE_2.md
[89]: WITH.md
[90]: WITH_1.md
[91]: WITH_2.md
[92]: WITH_3.md
[93]: https://maxtoroq.github.io/DbExtensions/docs/7/SqlBuilder.html
================================================
FILE: docs/api/DbExtensions/SqlBuilder/RIGHT_JOIN.md
================================================
SqlBuilder.RIGHT_JOIN Method
============================
Sets RIGHT JOIN as the next clause, to be used by subsequent calls to clause continuation methods, such as [_If(Boolean, ConditionalStringHandler)][1].
**Namespace:** [DbExtensions][2]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| -------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **RIGHT_JOIN()** | Sets RIGHT JOIN as the next clause, to be used by subsequent calls to clause continuation methods, such as [_If(Boolean, ConditionalStringHandler)][1]. |
| [RIGHT_JOIN(SqlBuilder.ClauseStringHandler<RIGHT_JOIN>)][3] | Appends the RIGHT JOIN clause using the provided interpolated string *handler*. |
| [RIGHT_JOIN(String)][4] | Appends the RIGHT JOIN clause using the provided *text*. |
Syntax
------
```csharp
public SqlBuilder RIGHT_JOIN()
```
#### Return Value
[SqlBuilder][5]
A reference to this instance after the operation has completed.
See Also
--------
#### Reference
[SqlBuilder Class][5]
[DbExtensions Namespace][2]
[1]: _If.md
[2]: ../README.md
[3]: RIGHT_JOIN_1.md
[4]: RIGHT_JOIN_2.md
[5]: README.md
================================================
FILE: docs/api/DbExtensions/SqlBuilder/RIGHT_JOIN_1.md
================================================
SqlBuilder.RIGHT_JOIN(SqlBuilder.ClauseStringHandler<SqlClause.RIGHT_JOIN>) Method
=====================================================================================
Appends the RIGHT JOIN clause using the provided interpolated string *handler*.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [RIGHT_JOIN()][2] | Sets RIGHT JOIN as the next clause, to be used by subsequent calls to clause continuation methods, such as [_If(Boolean, ConditionalStringHandler)][3]. |
| **RIGHT_JOIN(SqlBuilder.ClauseStringHandler<RIGHT_JOIN>)** | Appends the RIGHT JOIN clause using the provided interpolated string *handler*. |
| [RIGHT_JOIN(String)][4] | Appends the RIGHT JOIN clause using the provided *text*. |
Syntax
------
```csharp
public SqlBuilder RIGHT_JOIN(
ref ClauseStringHandler handler
)
```
#### Parameters
##### *handler* ClauseStringHandler<RIGHT_JOIN>
The interpolated string that represents the body of the RIGHT JOIN clause.
#### Return Value
[SqlBuilder][5]
A reference to this instance after the append operation has completed.
See Also
--------
#### Reference
[SqlBuilder Class][5]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: RIGHT_JOIN.md
[3]: _If.md
[4]: RIGHT_JOIN_2.md
[5]: README.md
================================================
FILE: docs/api/DbExtensions/SqlBuilder/RIGHT_JOIN_2.md
================================================
SqlBuilder.RIGHT_JOIN(String) Method
====================================
Appends the RIGHT JOIN clause using the provided *text*.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| -------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [RIGHT_JOIN()][2] | Sets RIGHT JOIN as the next clause, to be used by subsequent calls to clause continuation methods, such as [_If(Boolean, ConditionalStringHandler)][3]. |
| [RIGHT_JOIN(SqlBuilder.ClauseStringHandler<RIGHT_JOIN>)][4] | Appends the RIGHT JOIN clause using the provided interpolated string *handler*. |
| **RIGHT_JOIN(String)** | Appends the RIGHT JOIN clause using the provided *text*. |
Syntax
------
```csharp
public SqlBuilder RIGHT_JOIN(
string? text
)
```
#### Parameters
##### *text* [String][5]
The text that represents the body of the RIGHT JOIN clause.
#### Return Value
[SqlBuilder][6]
A reference to this instance after the append operation has completed.
See Also
--------
#### Reference
[SqlBuilder Class][6]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: RIGHT_JOIN.md
[3]: _If.md
[4]: RIGHT_JOIN_1.md
[5]: https://learn.microsoft.com/dotnet/api/system.string
[6]: README.md
================================================
FILE: docs/api/DbExtensions/SqlBuilder/SELECT.md
================================================
SqlBuilder.SELECT Method
========================
Sets SELECT as the next clause, to be used by subsequent calls to clause continuation methods, such as [_If(Boolean, ConditionalStringHandler)][1].
**Namespace:** [DbExtensions][2]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------- |
| **SELECT()** | Sets SELECT as the next clause, to be used by subsequent calls to clause continuation methods, such as [_If(Boolean, ConditionalStringHandler)][1]. |
| [SELECT(SqlBuilder.ClauseStringHandler<SELECT>)][3] | Appends the SELECT clause using the provided interpolated string *handler*. |
| [SELECT(String)][4] | Appends the SELECT clause using the provided *text*. |
Syntax
------
```csharp
public SqlBuilder SELECT()
```
#### Return Value
[SqlBuilder][5]
A reference to this instance after the operation has completed.
See Also
--------
#### Reference
[SqlBuilder Class][5]
[DbExtensions Namespace][2]
[1]: _If.md
[2]: ../README.md
[3]: SELECT_1.md
[4]: SELECT_2.md
[5]: README.md
================================================
FILE: docs/api/DbExtensions/SqlBuilder/SELECT_1.md
================================================
SqlBuilder.SELECT(SqlBuilder.ClauseStringHandler<SqlClause.SELECT>) Method
=============================================================================
Appends the SELECT clause using the provided interpolated string *handler*.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ----------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |
| [SELECT()][2] | Sets SELECT as the next clause, to be used by subsequent calls to clause continuation methods, such as [_If(Boolean, ConditionalStringHandler)][3]. |
| **SELECT(SqlBuilder.ClauseStringHandler<SELECT>)** | Appends the SELECT clause using the provided interpolated string *handler*. |
| [SELECT(String)][4] | Appends the SELECT clause using the provided *text*. |
Syntax
------
```csharp
public SqlBuilder SELECT(
ref ClauseStringHandler handler
)
```
#### Parameters
##### *handler* ClauseStringHandler<SELECT>
The interpolated string that represents the body of the SELECT clause.
#### Return Value
[SqlBuilder][5]
A reference to this instance after the append operation has completed.
See Also
--------
#### Reference
[SqlBuilder Class][5]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: SELECT.md
[3]: _If.md
[4]: SELECT_2.md
[5]: README.md
================================================
FILE: docs/api/DbExtensions/SqlBuilder/SELECT_2.md
================================================
SqlBuilder.SELECT(String) Method
================================
Appends the SELECT clause using the provided *text*.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------- |
| [SELECT()][2] | Sets SELECT as the next clause, to be used by subsequent calls to clause continuation methods, such as [_If(Boolean, ConditionalStringHandler)][3]. |
| [SELECT(SqlBuilder.ClauseStringHandler<SELECT>)][4] | Appends the SELECT clause using the provided interpolated string *handler*. |
| **SELECT(String)** | Appends the SELECT clause using the provided *text*. |
Syntax
------
```csharp
public SqlBuilder SELECT(
string? text
)
```
#### Parameters
##### *text* [String][5]
The text that represents the body of the SELECT clause.
#### Return Value
[SqlBuilder][6]
A reference to this instance after the append operation has completed.
See Also
--------
#### Reference
[SqlBuilder Class][6]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: SELECT.md
[3]: _If.md
[4]: SELECT_1.md
[5]: https://learn.microsoft.com/dotnet/api/system.string
[6]: README.md
================================================
FILE: docs/api/DbExtensions/SqlBuilder/SET.md
================================================
SqlBuilder.SET(SqlBuilder.ClauseStringHandler<SqlClause.SET>) Method
=======================================================================
Appends the SET clause using the provided interpolated string *handler*.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ----------------------------------------------- | ------------------------------------------------------------------------ |
| **SET(SqlBuilder.ClauseStringHandler<SET>)** | Appends the SET clause using the provided interpolated string *handler*. |
| [SET(String)][2] | Appends the SET clause using the provided *text*. |
Syntax
------
```csharp
public SqlBuilder SET(
ref ClauseStringHandler handler
)
```
#### Parameters
##### *handler* ClauseStringHandler<SET>
The interpolated string that represents the body of the SET clause.
#### Return Value
[SqlBuilder][3]
A reference to this instance after the append operation has completed.
See Also
--------
#### Reference
[SqlBuilder Class][3]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: SET_1.md
[3]: README.md
================================================
FILE: docs/api/DbExtensions/SqlBuilder/SET_1.md
================================================
SqlBuilder.SET(String) Method
=============================
Appends the SET clause using the provided *text*.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ------------------------------------------------ | ------------------------------------------------------------------------ |
| [SET(SqlBuilder.ClauseStringHandler<SET>)][2] | Appends the SET clause using the provided interpolated string *handler*. |
| **SET(String)** | Appends the SET clause using the provided *text*. |
Syntax
------
```csharp
public SqlBuilder SET(
string? text
)
```
#### Parameters
##### *text* [String][3]
The text that represents the body of the SET clause.
#### Return Value
[SqlBuilder][4]
A reference to this instance after the append operation has completed.
See Also
--------
#### Reference
[SqlBuilder Class][4]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: SET.md
[3]: https://learn.microsoft.com/dotnet/api/system.string
[4]: README.md
================================================
FILE: docs/api/DbExtensions/SqlBuilder/SetCurrentClause.md
================================================
SqlBuilder.SetCurrentClause(SqlClause) Method
=============================================
Sets *clause* as the current SQL clause.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ----------------------------------- | ---------------------------------------------------------------- |
| **SetCurrentClause(SqlClause)** | Sets *clause* as the current SQL clause. |
| [SetCurrentClause<TClause>()][2] | Sets the clause identified by TClause as the current SQL clause. |
Syntax
------
```csharp
public SqlBuilder SetCurrentClause(
SqlClause? clause
)
```
#### Parameters
##### *clause* [SqlClause][3]
The SQL clause.
#### Return Value
[SqlBuilder][4]
A reference to this instance after the operation has completed.
See Also
--------
#### Reference
[SqlBuilder Class][4]
[DbExtensions Namespace][1]
[CurrentClause][5]
[1]: ../README.md
[2]: SetCurrentClause__1.md
[3]: ../SqlClause/README.md
[4]: README.md
[5]: CurrentClause.md
================================================
FILE: docs/api/DbExtensions/SqlBuilder/SetCurrentClause__1.md
================================================
SqlBuilder.SetCurrentClause<TClause> Method
==============================================
Sets the clause identified by TClause as the current SQL clause.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ---------------------------------- | ---------------------------------------------------------------- |
| [SetCurrentClause(SqlClause)][2] | Sets *clause* as the current SQL clause. |
| **SetCurrentClause<TClause>()** | Sets the clause identified by TClause as the current SQL clause. |
Syntax
------
```csharp
public SqlBuilder SetCurrentClause()
where TClause : new(), SqlClause
```
#### Type Parameters
##### *TClause*
The type of the SQL clause.
#### Return Value
[SqlBuilder][3]
A reference to this instance after the operation has completed.
See Also
--------
#### Reference
[SqlBuilder Class][3]
[DbExtensions Namespace][1]
[CurrentClause][4]
[1]: ../README.md
[2]: SetCurrentClause.md
[3]: README.md
[4]: CurrentClause.md
================================================
FILE: docs/api/DbExtensions/SqlBuilder/SetNextClause.md
================================================
SqlBuilder.SetNextClause(SqlClause) Method
==========================================
Sets *clause* as the next SQL clause.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| -------------------------------- | ------------------------------------------------------------- |
| **SetNextClause(SqlClause)** | Sets *clause* as the next SQL clause. |
| [SetNextClause<TClause>()][2] | Sets the clause identified by TClause as the next SQL clause. |
Syntax
------
```csharp
public SqlBuilder SetNextClause(
SqlClause? clause
)
```
#### Parameters
##### *clause* [SqlClause][3]
The SQL clause.
#### Return Value
[SqlBuilder][4]
A reference to this instance after the operation has completed.
See Also
--------
#### Reference
[SqlBuilder Class][4]
[DbExtensions Namespace][1]
[NextClause][5]
[1]: ../README.md
[2]: SetNextClause__1.md
[3]: ../SqlClause/README.md
[4]: README.md
[5]: NextClause.md
================================================
FILE: docs/api/DbExtensions/SqlBuilder/SetNextClause__1.md
================================================
SqlBuilder.SetNextClause<TClause> Method
===========================================
Sets the clause identified by TClause as the next SQL clause.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ------------------------------- | ------------------------------------------------------------- |
| [SetNextClause(SqlClause)][2] | Sets *clause* as the next SQL clause. |
| **SetNextClause<TClause>()** | Sets the clause identified by TClause as the next SQL clause. |
Syntax
------
```csharp
public SqlBuilder SetNextClause()
where TClause : new(), SqlClause
```
#### Type Parameters
##### *TClause*
The type of the SQL clause.
#### Return Value
[SqlBuilder][3]
A reference to this instance after the operation has completed.
See Also
--------
#### Reference
[SqlBuilder Class][3]
[DbExtensions Namespace][1]
[NextClause][4]
[1]: ../README.md
[2]: SetNextClause.md
[3]: README.md
[4]: NextClause.md
================================================
FILE: docs/api/DbExtensions/SqlBuilder/ToString.md
================================================
SqlBuilder.ToString Method
==========================
Converts the value of this instance to a [String][1].
**Namespace:** [DbExtensions][2]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public override string ToString()
```
#### Return Value
[String][1]
A string whose value is the same as this instance.
See Also
--------
#### Reference
[SqlBuilder Class][3]
[DbExtensions Namespace][2]
[1]: https://learn.microsoft.com/dotnet/api/system.string
[2]: ../README.md
[3]: README.md
================================================
FILE: docs/api/DbExtensions/SqlBuilder/UNION.md
================================================
SqlBuilder.UNION Method
=======================
Appends the UNION clause.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public SqlBuilder UNION()
```
#### Return Value
[SqlBuilder][2]
A reference to this instance after the append operation has completed.
See Also
--------
#### Reference
[SqlBuilder Class][2]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: README.md
================================================
FILE: docs/api/DbExtensions/SqlBuilder/UPDATE.md
================================================
SqlBuilder.UPDATE(SqlBuilder.ClauseStringHandler<SqlClause.UPDATE>) Method
=============================================================================
Appends the UPDATE clause using the provided interpolated string *handler*.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ----------------------------------------------------- | --------------------------------------------------------------------------- |
| **UPDATE(SqlBuilder.ClauseStringHandler<UPDATE>)** | Appends the UPDATE clause using the provided interpolated string *handler*. |
| [UPDATE(String)][2] | Appends the UPDATE clause using the provided *text*. |
Syntax
------
```csharp
public SqlBuilder UPDATE(
ref ClauseStringHandler handler
)
```
#### Parameters
##### *handler* ClauseStringHandler<UPDATE>
The interpolated string that represents the body of the UPDATE clause.
#### Return Value
[SqlBuilder][3]
A reference to this instance after the append operation has completed.
See Also
--------
#### Reference
[SqlBuilder Class][3]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: UPDATE_1.md
[3]: README.md
================================================
FILE: docs/api/DbExtensions/SqlBuilder/UPDATE_1.md
================================================
SqlBuilder.UPDATE(String) Method
================================
Appends the UPDATE clause using the provided *text*.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ------------------------------------------------------ | --------------------------------------------------------------------------- |
| [UPDATE(SqlBuilder.ClauseStringHandler<UPDATE>)][2] | Appends the UPDATE clause using the provided interpolated string *handler*. |
| **UPDATE(String)** | Appends the UPDATE clause using the provided *text*. |
Syntax
------
```csharp
public SqlBuilder UPDATE(
string? text
)
```
#### Parameters
##### *text* [String][3]
The text that represents the body of the UPDATE clause.
#### Return Value
[SqlBuilder][4]
A reference to this instance after the append operation has completed.
See Also
--------
#### Reference
[SqlBuilder Class][4]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: UPDATE.md
[3]: https://learn.microsoft.com/dotnet/api/system.string
[4]: README.md
================================================
FILE: docs/api/DbExtensions/SqlBuilder/VALUES.md
================================================
SqlBuilder.VALUES(SqlBuilder.ClauseStringHandler<SqlClause.VALUES>) Method
=============================================================================
Appends the VALUES clause using the provided interpolated string *handler*.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ----------------------------------------------------- | --------------------------------------------------------------------------- |
| **VALUES(SqlBuilder.ClauseStringHandler<VALUES>)** | Appends the VALUES clause using the provided interpolated string *handler*. |
| [VALUES(Object[])][2] | Appends the VALUES clause using the provided parameters. |
Syntax
------
```csharp
public SqlBuilder VALUES(
ref ClauseStringHandler handler
)
```
#### Parameters
##### *handler* ClauseStringHandler<VALUES>
The interpolated string that represents the body of the VALUES clause.
#### Return Value
[SqlBuilder][3]
A reference to this instance after the append operation has completed.
See Also
--------
#### Reference
[SqlBuilder Class][3]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: VALUES_1.md
[3]: README.md
================================================
FILE: docs/api/DbExtensions/SqlBuilder/VALUES_1.md
================================================
SqlBuilder.VALUES(Object[]) Method
==================================
Appends the VALUES clause using the provided parameters.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ------------------------------------------------------ | --------------------------------------------------------------------------- |
| [VALUES(SqlBuilder.ClauseStringHandler<VALUES>)][2] | Appends the VALUES clause using the provided interpolated string *handler*. |
| **VALUES(Object[])** | Appends the VALUES clause using the provided parameters. |
Syntax
------
```csharp
public SqlBuilder VALUES(
params Object?[] args
)
```
#### Parameters
##### *args* [Object][3][]
The parameters of the clause body.
#### Return Value
[SqlBuilder][4]
A reference to this instance after the append operation has completed.
See Also
--------
#### Reference
[SqlBuilder Class][4]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: VALUES.md
[3]: https://learn.microsoft.com/dotnet/api/system.object
[4]: README.md
================================================
FILE: docs/api/DbExtensions/SqlBuilder/WHERE.md
================================================
SqlBuilder.WHERE Method
=======================
Sets WHERE as the next clause, to be used by subsequent calls to clause continuation methods, such as [_If(Boolean, ConditionalStringHandler)][1].
**Namespace:** [DbExtensions][2]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ---------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
| **WHERE()** | Sets WHERE as the next clause, to be used by subsequent calls to clause continuation methods, such as [_If(Boolean, ConditionalStringHandler)][1]. |
| [WHERE(SqlBuilder.ClauseStringHandler<WHERE>)][3] | Appends the WHERE clause using the provided interpolated string *handler*. |
| [WHERE(String)][4] | Appends the WHERE clause using the provided *text*. |
Syntax
------
```csharp
public SqlBuilder WHERE()
```
#### Return Value
[SqlBuilder][5]
A reference to this instance after the operation has completed.
See Also
--------
#### Reference
[SqlBuilder Class][5]
[DbExtensions Namespace][2]
[1]: _If.md
[2]: ../README.md
[3]: WHERE_1.md
[4]: WHERE_2.md
[5]: README.md
================================================
FILE: docs/api/DbExtensions/SqlBuilder/WHERE_1.md
================================================
SqlBuilder.WHERE(SqlBuilder.ClauseStringHandler<SqlClause.WHERE>) Method
===========================================================================
Appends the WHERE clause using the provided interpolated string *handler*.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| --------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
| [WHERE()][2] | Sets WHERE as the next clause, to be used by subsequent calls to clause continuation methods, such as [_If(Boolean, ConditionalStringHandler)][3]. |
| **WHERE(SqlBuilder.ClauseStringHandler<WHERE>)** | Appends the WHERE clause using the provided interpolated string *handler*. |
| [WHERE(String)][4] | Appends the WHERE clause using the provided *text*. |
Syntax
------
```csharp
public SqlBuilder WHERE(
ref ClauseStringHandler handler
)
```
#### Parameters
##### *handler* ClauseStringHandler<WHERE>
The interpolated string that represents the body of the WHERE clause.
#### Return Value
[SqlBuilder][5]
A reference to this instance after the append operation has completed.
See Also
--------
#### Reference
[SqlBuilder Class][5]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: WHERE.md
[3]: _If.md
[4]: WHERE_2.md
[5]: README.md
================================================
FILE: docs/api/DbExtensions/SqlBuilder/WHERE_2.md
================================================
SqlBuilder.WHERE(String) Method
===============================
Appends the WHERE clause using the provided *text*.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ---------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
| [WHERE()][2] | Sets WHERE as the next clause, to be used by subsequent calls to clause continuation methods, such as [_If(Boolean, ConditionalStringHandler)][3]. |
| [WHERE(SqlBuilder.ClauseStringHandler<WHERE>)][4] | Appends the WHERE clause using the provided interpolated string *handler*. |
| **WHERE(String)** | Appends the WHERE clause using the provided *text*. |
Syntax
------
```csharp
public SqlBuilder WHERE(
string? text
)
```
#### Parameters
##### *text* [String][5]
The text that represents the body of the WHERE clause.
#### Return Value
[SqlBuilder][6]
A reference to this instance after the append operation has completed.
See Also
--------
#### Reference
[SqlBuilder Class][6]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: WHERE.md
[3]: _If.md
[4]: WHERE_1.md
[5]: https://learn.microsoft.com/dotnet/api/system.string
[6]: README.md
================================================
FILE: docs/api/DbExtensions/SqlBuilder/WITH.md
================================================
SqlBuilder.WITH(SqlBuilder.ClauseStringHandler<SqlClause.WITH>) Method
=========================================================================
Appends the WITH clause using the provided interpolated string *handler*.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ------------------------------------------------- | ---------------------------------------------------------------------------------- |
| **WITH(SqlBuilder.ClauseStringHandler<WITH>)** | Appends the WITH clause using the provided interpolated string *handler*. |
| [WITH(String)][2] | Appends the WITH clause using the provided *text*. |
| [WITH(String, SqlBuilder)][3] | Appends the WITH clause using the provided *subQuery* as body named after *alias*. |
| [WITH(String, SqlSet)][4] | Appends the WITH clause using the provided *subQuery* as body named after *alias*. |
Syntax
------
```csharp
public SqlBuilder WITH(
ref ClauseStringHandler handler
)
```
#### Parameters
##### *handler* ClauseStringHandler<WITH>
The interpolated string that represents the body of the WITH clause.
#### Return Value
[SqlBuilder][5]
A reference to this instance after the append operation has completed.
See Also
--------
#### Reference
[SqlBuilder Class][5]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: WITH_1.md
[3]: WITH_2.md
[4]: WITH_3.md
[5]: README.md
================================================
FILE: docs/api/DbExtensions/SqlBuilder/WITH_1.md
================================================
SqlBuilder.WITH(String) Method
==============================
Appends the WITH clause using the provided *text*.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| -------------------------------------------------- | ---------------------------------------------------------------------------------- |
| [WITH(SqlBuilder.ClauseStringHandler<WITH>)][2] | Appends the WITH clause using the provided interpolated string *handler*. |
| **WITH(String)** | Appends the WITH clause using the provided *text*. |
| [WITH(String, SqlBuilder)][3] | Appends the WITH clause using the provided *subQuery* as body named after *alias*. |
| [WITH(String, SqlSet)][4] | Appends the WITH clause using the provided *subQuery* as body named after *alias*. |
Syntax
------
```csharp
public SqlBuilder WITH(
string? text
)
```
#### Parameters
##### *text* [String][5]
The text that represents the body of the WITH clause.
#### Return Value
[SqlBuilder][6]
A reference to this instance after the append operation has completed.
See Also
--------
#### Reference
[SqlBuilder Class][6]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: WITH.md
[3]: WITH_2.md
[4]: WITH_3.md
[5]: https://learn.microsoft.com/dotnet/api/system.string
[6]: README.md
================================================
FILE: docs/api/DbExtensions/SqlBuilder/WITH_2.md
================================================
SqlBuilder.WITH(String, SqlBuilder) Method
==========================================
Appends the WITH clause using the provided *subQuery* as body named after *alias*.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| -------------------------------------------------- | ---------------------------------------------------------------------------------- |
| [WITH(SqlBuilder.ClauseStringHandler<WITH>)][2] | Appends the WITH clause using the provided interpolated string *handler*. |
| [WITH(String)][3] | Appends the WITH clause using the provided *text*. |
| **WITH(String, SqlBuilder)** | Appends the WITH clause using the provided *subQuery* as body named after *alias*. |
| [WITH(String, SqlSet)][4] | Appends the WITH clause using the provided *subQuery* as body named after *alias*. |
Syntax
------
```csharp
public SqlBuilder WITH(
string alias,
SqlBuilder subQuery
)
```
#### Parameters
##### *alias* [String][5]
The alias of the sub-query.
##### *subQuery* [SqlBuilder][6]
The sub-query to use as the body of the WITH clause.
#### Return Value
[SqlBuilder][6]
A reference to this instance after the append operation has completed.
See Also
--------
#### Reference
[SqlBuilder Class][6]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: WITH.md
[3]: WITH_1.md
[4]: WITH_3.md
[5]: https://learn.microsoft.com/dotnet/api/system.string
[6]: README.md
================================================
FILE: docs/api/DbExtensions/SqlBuilder/WITH_3.md
================================================
SqlBuilder.WITH(String, SqlSet) Method
======================================
Appends the WITH clause using the provided *subQuery* as body named after *alias*.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| -------------------------------------------------- | ---------------------------------------------------------------------------------- |
| [WITH(SqlBuilder.ClauseStringHandler<WITH>)][2] | Appends the WITH clause using the provided interpolated string *handler*. |
| [WITH(String)][3] | Appends the WITH clause using the provided *text*. |
| [WITH(String, SqlBuilder)][4] | Appends the WITH clause using the provided *subQuery* as body named after *alias*. |
| **WITH(String, SqlSet)** | Appends the WITH clause using the provided *subQuery* as body named after *alias*. |
Syntax
------
```csharp
public SqlBuilder WITH(
string alias,
SqlSet subQuery
)
```
#### Parameters
##### *alias* [String][5]
The alias of the sub-query.
##### *subQuery* [SqlSet][6]
The sub-query to use as the body of the WITH clause.
#### Return Value
[SqlBuilder][7]
A reference to this instance after the append operation has completed.
See Also
--------
#### Reference
[SqlBuilder Class][7]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: WITH.md
[3]: WITH_1.md
[4]: WITH_2.md
[5]: https://learn.microsoft.com/dotnet/api/system.string
[6]: ../SqlSet/README.md
[7]: README.md
================================================
FILE: docs/api/DbExtensions/SqlBuilder/_.md
================================================
SqlBuilder._(SqlBuilder.ClauseStringHandler<SqlClause.Current>) Method
=========================================================================
Appends the interpolated string *handler* to the current clause.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ------------------------------------------------- | ---------------------------------------------------------------- |
| **_(SqlBuilder.ClauseStringHandler<Current>)** | Appends the interpolated string *handler* to the current clause. |
| [_(String)][2] | Appends the *text* to the current clause. |
Syntax
------
```csharp
public SqlBuilder _(
ref ClauseStringHandler handler
)
```
#### Parameters
##### *handler* ClauseStringHandler<Current>
The interpolated string that represents the body of the current clause.
#### Return Value
[SqlBuilder][3]
A reference to this instance after the append operation has completed.
See Also
--------
#### Reference
[SqlBuilder Class][3]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: __1.md
[3]: README.md
================================================
FILE: docs/api/DbExtensions/SqlBuilder/_Else.md
================================================
SqlBuilder._Else Method
=======================
Appends *handler* to the current clause if an antecedent call to [_If(Boolean, ConditionalStringHandler)][1] or [_ElseIf(Boolean, ConditionalElseStringHandler)][2] used a `false` condition
**Namespace:** [DbExtensions][3]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public SqlBuilder _Else(
ref ConditionalElseStringHandler handler
)
```
#### Parameters
##### *handler* ConditionalElseStringHandler
The interpolated string that represents the body of the current clause.
#### Return Value
[SqlBuilder][4]
A reference to this instance after the append operation has completed.
See Also
--------
#### Reference
[SqlBuilder Class][4]
[DbExtensions Namespace][3]
[1]: _If.md
[2]: _ElseIf.md
[3]: ../README.md
[4]: README.md
================================================
FILE: docs/api/DbExtensions/SqlBuilder/_ElseIf.md
================================================
SqlBuilder._ElseIf Method
=========================
Appends *handler* to the current clause if *condition* is `true` and an antecedent call to [_If(Boolean, ConditionalStringHandler)][1] or **_ElseIf(Boolean, ConditionalElseStringHandler)** used a `false` condition.
**Namespace:** [DbExtensions][2]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public SqlBuilder _ElseIf(
bool condition,
ref ConditionalElseStringHandler handler
)
```
#### Parameters
##### *condition* [Boolean][3]
`true` to append *handler* to the current clause; otherwise, `false`.
##### *handler* ConditionalElseStringHandler
The interpolated string that represents the body of the current clause.
#### Return Value
[SqlBuilder][4]
A reference to this instance after the append operation has completed.
See Also
--------
#### Reference
[SqlBuilder Class][4]
[DbExtensions Namespace][2]
[1]: _If.md
[2]: ../README.md
[3]: https://learn.microsoft.com/dotnet/api/system.boolean
[4]: README.md
================================================
FILE: docs/api/DbExtensions/SqlBuilder/_If.md
================================================
SqlBuilder._If Method
=====================
Appends the interpolated string *handler* to the current clause if *condition* is `true`.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public SqlBuilder _If(
bool condition,
ref ConditionalStringHandler handler
)
```
#### Parameters
##### *condition* [Boolean][2]
`true` to append *handler* to the current clause; otherwise, `false`.
##### *handler* ConditionalStringHandler
The interpolated string that represents the body of the current clause.
#### Return Value
[SqlBuilder][3]
A reference to this instance after the append operation has completed.
See Also
--------
#### Reference
[SqlBuilder Class][3]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: https://learn.microsoft.com/dotnet/api/system.boolean
[3]: README.md
================================================
FILE: docs/api/DbExtensions/SqlBuilder/__1.md
================================================
SqlBuilder._(String) Method
===========================
Appends the *text* to the current clause.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| -------------------------------------------------- | ---------------------------------------------------------------- |
| [_(SqlBuilder.ClauseStringHandler<Current>)][2] | Appends the interpolated string *handler* to the current clause. |
| **_(String)** | Appends the *text* to the current clause. |
Syntax
------
```csharp
public SqlBuilder _(
string? text
)
```
#### Parameters
##### *text* [String][3]
The text that represents the body of the current clause.
#### Return Value
[SqlBuilder][4]
A reference to this instance after the append operation has completed.
See Also
--------
#### Reference
[SqlBuilder Class][4]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: _.md
[3]: https://learn.microsoft.com/dotnet/api/system.string
[4]: README.md
================================================
FILE: docs/api/DbExtensions/SqlClause/Instance__1.md
================================================
SqlClause.Instance<TClause> Method
=====================================
Gets a singleton instance of the clause identified by TClause.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public static TClause Instance()
where TClause : new(), SqlClause
```
#### Type Parameters
##### *TClause*
The type of the clause.
#### Return Value
**TClause**
An instance of TClause.
See Also
--------
#### Reference
[SqlClause Class][2]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: README.md
================================================
FILE: docs/api/DbExtensions/SqlClause/Name.md
================================================
SqlClause.Name Property
=======================
The name of the clause.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public string? Name { get; init; }
```
#### Property Value
[String][2]
See Also
--------
#### Reference
[SqlClause Class][3]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: https://learn.microsoft.com/dotnet/api/system.string
[3]: README.md
================================================
FILE: docs/api/DbExtensions/SqlClause/README.md
================================================
SqlClause Class
===============
Provides information about a SQL clause. Used by [SqlBuilder][1].
Inheritance Hierarchy
---------------------
[System.Object][2]
**DbExtensions.SqlClause**
**Namespace:** [DbExtensions][3]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public abstract class SqlClause : IEquatable
```
The **SqlClause** type exposes the following members.
Constructors
------------
| Name | Description |
| -------------- | ----------------------------------------------------------------- |
| [SqlClause][4] | Provides information about a SQL clause. Used by [SqlBuilder][1]. |
Properties
----------
| Name | Description |
| -------------- | ---------------------------------------- |
| [Name][5] | The name of the clause. |
| [Separator][6] | The string to use for consecutive calls. |
Methods
-------
| Name | Description |
| ------------------------- | -------------------------------------------------------------- |
| [Instance<TClause>][7] | Gets a singleton instance of the clause identified by TClause. |
See Also
--------
#### Reference
[DbExtensions Namespace][3]
[1]: ../SqlBuilder/README.md
[2]: https://learn.microsoft.com/dotnet/api/system.object
[3]: ../README.md
[4]: _ctor.md
[5]: Name.md
[6]: Separator.md
[7]: Instance__1.md
================================================
FILE: docs/api/DbExtensions/SqlClause/Separator.md
================================================
SqlClause.Separator Property
============================
The string to use for consecutive calls.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public string? Separator { get; init; }
```
#### Property Value
[String][2]
See Also
--------
#### Reference
[SqlClause Class][3]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: https://learn.microsoft.com/dotnet/api/system.string
[3]: README.md
================================================
FILE: docs/api/DbExtensions/SqlClause/_ctor.md
================================================
SqlClause Constructor
=====================
Provides information about a SQL clause. Used by [SqlBuilder][1].
**Namespace:** [DbExtensions][2]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
protected SqlClause(
string? Name,
string? Separator
)
```
#### Parameters
##### *Name* [String][3]
The name of the clause.
##### *Separator* [String][3]
The string to use for consecutive calls.
See Also
--------
#### Reference
[SqlClause Class][4]
[DbExtensions Namespace][2]
[1]: ../SqlBuilder/README.md
[2]: ../README.md
[3]: https://learn.microsoft.com/dotnet/api/system.string
[4]: README.md
================================================
FILE: docs/api/DbExtensions/SqlSet/All.md
================================================
SqlSet.All(SqlSet.OperatorStringHandler) Method
===============================================
Determines whether all elements of the set satisfy a condition.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ------------------------------ | --------------------------------------------------------------- |
| **All(OperatorStringHandler)** | Determines whether all elements of the set satisfy a condition. |
| [All(String)][2] | Determines whether all elements of the set satisfy a condition. |
Syntax
------
```csharp
public bool All(
ref OperatorStringHandler predicate
)
```
#### Parameters
##### *predicate* OperatorStringHandler
A SQL expression to test each row for a condition.
#### Return Value
[Boolean][3]
`true` if every element of the set passes the test in the specified *predicate*, or if the set is empty; otherwise, `false`.
See Also
--------
#### Reference
[SqlSet Class][4]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: All_1.md
[3]: https://learn.microsoft.com/dotnet/api/system.boolean
[4]: README.md
================================================
FILE: docs/api/DbExtensions/SqlSet/AllAsync.md
================================================
SqlSet.AllAsync(SqlSet.OperatorStringHandler, CancellationToken) Method
=======================================================================
Determines whether all elements of the set satisfy a condition.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ------------------------------------------------------ | --------------------------------------------------------------- |
| **AllAsync(OperatorStringHandler, CancellationToken)** | Determines whether all elements of the set satisfy a condition. |
| [AllAsync(String, CancellationToken)][2] | Determines whether all elements of the set satisfy a condition. |
Syntax
------
```csharp
public ValueTask AllAsync(
OperatorStringHandler predicate,
CancellationToken cancellationToken = default
)
```
#### Parameters
##### *predicate* OperatorStringHandler
A SQL expression to test each row for a condition.
##### *cancellationToken* [CancellationToken][3] (Optional)
The [CancellationToken][3] to monitor for cancellation requests. The default is [None][4].
#### Return Value
[ValueTask][5]<[Boolean][6]>
`true` if every element of the set passes the test in the specified *predicate*, or if the set is empty; otherwise, `false`.
See Also
--------
#### Reference
[SqlSet Class][7]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: AllAsync_1.md
[3]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken
[4]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken.none
[5]: https://learn.microsoft.com/dotnet/api/system.threading.tasks.valuetask-1
[6]: https://learn.microsoft.com/dotnet/api/system.boolean
[7]: README.md
================================================
FILE: docs/api/DbExtensions/SqlSet/AllAsync_1.md
================================================
SqlSet.AllAsync(String, CancellationToken) Method
=================================================
Determines whether all elements of the set satisfy a condition.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ------------------------------------------------------- | --------------------------------------------------------------- |
| [AllAsync(OperatorStringHandler, CancellationToken)][2] | Determines whether all elements of the set satisfy a condition. |
| **AllAsync(String, CancellationToken)** | Determines whether all elements of the set satisfy a condition. |
Syntax
------
```csharp
public ValueTask AllAsync(
string predicate,
CancellationToken cancellationToken = default
)
```
#### Parameters
##### *predicate* [String][3]
A SQL expression to test each row for a condition.
##### *cancellationToken* [CancellationToken][4] (Optional)
The [CancellationToken][4] to monitor for cancellation requests. The default is [None][5].
#### Return Value
[ValueTask][6]<[Boolean][7]>
`true` if every element of the set passes the test in the specified *predicate*, or if the set is empty; otherwise, `false`.
See Also
--------
#### Reference
[SqlSet Class][8]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: AllAsync.md
[3]: https://learn.microsoft.com/dotnet/api/system.string
[4]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken
[5]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken.none
[6]: https://learn.microsoft.com/dotnet/api/system.threading.tasks.valuetask-1
[7]: https://learn.microsoft.com/dotnet/api/system.boolean
[8]: README.md
================================================
FILE: docs/api/DbExtensions/SqlSet/All_1.md
================================================
SqlSet.All(String) Method
=========================
Determines whether all elements of the set satisfy a condition.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ------------------------------- | --------------------------------------------------------------- |
| [All(OperatorStringHandler)][2] | Determines whether all elements of the set satisfy a condition. |
| **All(String)** | Determines whether all elements of the set satisfy a condition. |
Syntax
------
```csharp
public bool All(
string predicate
)
```
#### Parameters
##### *predicate* [String][3]
A SQL expression to test each row for a condition.
#### Return Value
[Boolean][4]
`true` if every element of the set passes the test in the specified *predicate*, or if the set is empty; otherwise, `false`.
See Also
--------
#### Reference
[SqlSet Class][5]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: All.md
[3]: https://learn.microsoft.com/dotnet/api/system.string
[4]: https://learn.microsoft.com/dotnet/api/system.boolean
[5]: README.md
================================================
FILE: docs/api/DbExtensions/SqlSet/Any.md
================================================
SqlSet.Any Method
=================
Determines whether the set contains any elements.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ------------------------------- | ---------------------------------------------------------------- |
| **Any()** | Determines whether the set contains any elements. |
| [Any(OperatorStringHandler)][2] | Determines whether any element of the set satisfies a condition. |
| [Any(String)][3] | Determines whether any element of the set satisfies a condition. |
Syntax
------
```csharp
public bool Any()
```
#### Return Value
[Boolean][4]
`true` if the sequence contains any elements; otherwise, `false`.
See Also
--------
#### Reference
[SqlSet Class][5]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: Any_1.md
[3]: Any_2.md
[4]: https://learn.microsoft.com/dotnet/api/system.boolean
[5]: README.md
================================================
FILE: docs/api/DbExtensions/SqlSet/AnyAsync.md
================================================
SqlSet.AnyAsync(SqlSet.OperatorStringHandler, CancellationToken) Method
=======================================================================
Determines whether any element of the set satisfies a condition.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ------------------------------------------------------ | ---------------------------------------------------------------- |
| [AnyAsync(CancellationToken)][2] | Determines whether the set contains any elements. |
| **AnyAsync(OperatorStringHandler, CancellationToken)** | Determines whether any element of the set satisfies a condition. |
| [AnyAsync(String, CancellationToken)][3] | Determines whether any element of the set satisfies a condition. |
Syntax
------
```csharp
public ValueTask AnyAsync(
OperatorStringHandler predicate,
CancellationToken cancellationToken = default
)
```
#### Parameters
##### *predicate* OperatorStringHandler
A SQL expression to test each row for a condition.
##### *cancellationToken* [CancellationToken][4] (Optional)
The [CancellationToken][4] to monitor for cancellation requests. The default is [None][5].
#### Return Value
[ValueTask][6]<[Boolean][7]>
`true` if any elements in the set pass the test in the specified *predicate*; otherwise, `false`.
See Also
--------
#### Reference
[SqlSet Class][8]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: AnyAsync_2.md
[3]: AnyAsync_1.md
[4]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken
[5]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken.none
[6]: https://learn.microsoft.com/dotnet/api/system.threading.tasks.valuetask-1
[7]: https://learn.microsoft.com/dotnet/api/system.boolean
[8]: README.md
================================================
FILE: docs/api/DbExtensions/SqlSet/AnyAsync_1.md
================================================
SqlSet.AnyAsync(String, CancellationToken) Method
=================================================
Determines whether any element of the set satisfies a condition.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ------------------------------------------------------- | ---------------------------------------------------------------- |
| [AnyAsync(CancellationToken)][2] | Determines whether the set contains any elements. |
| [AnyAsync(OperatorStringHandler, CancellationToken)][3] | Determines whether any element of the set satisfies a condition. |
| **AnyAsync(String, CancellationToken)** | Determines whether any element of the set satisfies a condition. |
Syntax
------
```csharp
public ValueTask AnyAsync(
string predicate,
CancellationToken cancellationToken = default
)
```
#### Parameters
##### *predicate* [String][4]
A SQL expression to test each row for a condition.
##### *cancellationToken* [CancellationToken][5] (Optional)
The [CancellationToken][5] to monitor for cancellation requests. The default is [None][6].
#### Return Value
[ValueTask][7]<[Boolean][8]>
`true` if any elements in the set pass the test in the specified *predicate*; otherwise, `false`.
See Also
--------
#### Reference
[SqlSet Class][9]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: AnyAsync_2.md
[3]: AnyAsync.md
[4]: https://learn.microsoft.com/dotnet/api/system.string
[5]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken
[6]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken.none
[7]: https://learn.microsoft.com/dotnet/api/system.threading.tasks.valuetask-1
[8]: https://learn.microsoft.com/dotnet/api/system.boolean
[9]: README.md
================================================
FILE: docs/api/DbExtensions/SqlSet/AnyAsync_2.md
================================================
SqlSet.AnyAsync(CancellationToken) Method
=========================================
Determines whether the set contains any elements.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ------------------------------------------------------- | ---------------------------------------------------------------- |
| **AnyAsync(CancellationToken)** | Determines whether the set contains any elements. |
| [AnyAsync(OperatorStringHandler, CancellationToken)][2] | Determines whether any element of the set satisfies a condition. |
| [AnyAsync(String, CancellationToken)][3] | Determines whether any element of the set satisfies a condition. |
Syntax
------
```csharp
public ValueTask AnyAsync(
CancellationToken cancellationToken = default
)
```
#### Parameters
##### *cancellationToken* [CancellationToken][4] (Optional)
The [CancellationToken][4] to monitor for cancellation requests. The default is [None][5].
#### Return Value
[ValueTask][6]<[Boolean][7]>
`true` if the sequence contains any elements; otherwise, `false`.
See Also
--------
#### Reference
[SqlSet Class][8]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: AnyAsync.md
[3]: AnyAsync_1.md
[4]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken
[5]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken.none
[6]: https://learn.microsoft.com/dotnet/api/system.threading.tasks.valuetask-1
[7]: https://learn.microsoft.com/dotnet/api/system.boolean
[8]: README.md
================================================
FILE: docs/api/DbExtensions/SqlSet/Any_1.md
================================================
SqlSet.Any(SqlSet.OperatorStringHandler) Method
===============================================
Determines whether any element of the set satisfies a condition.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ------------------------------ | ---------------------------------------------------------------- |
| [Any()][2] | Determines whether the set contains any elements. |
| **Any(OperatorStringHandler)** | Determines whether any element of the set satisfies a condition. |
| [Any(String)][3] | Determines whether any element of the set satisfies a condition. |
Syntax
------
```csharp
public bool Any(
ref OperatorStringHandler predicate
)
```
#### Parameters
##### *predicate* OperatorStringHandler
A SQL expression to test each row for a condition.
#### Return Value
[Boolean][4]
`true` if any elements in the set pass the test in the specified *predicate*; otherwise, `false`.
See Also
--------
#### Reference
[SqlSet Class][5]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: Any.md
[3]: Any_2.md
[4]: https://learn.microsoft.com/dotnet/api/system.boolean
[5]: README.md
================================================
FILE: docs/api/DbExtensions/SqlSet/Any_2.md
================================================
SqlSet.Any(String) Method
=========================
Determines whether any element of the set satisfies a condition.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ------------------------------- | ---------------------------------------------------------------- |
| [Any()][2] | Determines whether the set contains any elements. |
| [Any(OperatorStringHandler)][3] | Determines whether any element of the set satisfies a condition. |
| **Any(String)** | Determines whether any element of the set satisfies a condition. |
Syntax
------
```csharp
public bool Any(
string predicate
)
```
#### Parameters
##### *predicate* [String][4]
A SQL expression to test each row for a condition.
#### Return Value
[Boolean][5]
`true` if any elements in the set pass the test in the specified *predicate*; otherwise, `false`.
See Also
--------
#### Reference
[SqlSet Class][6]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: Any.md
[3]: Any_1.md
[4]: https://learn.microsoft.com/dotnet/api/system.string
[5]: https://learn.microsoft.com/dotnet/api/system.boolean
[6]: README.md
================================================
FILE: docs/api/DbExtensions/SqlSet/AsAsyncEnumerable.md
================================================
SqlSet.AsAsyncEnumerable Method
===============================
Gets all elements in the set. The query is deferred-executed.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public IAsyncEnumerable AsAsyncEnumerable()
```
#### Return Value
[IAsyncEnumerable][2]<[Object][3]>
All elements in the set.
See Also
--------
#### Reference
[SqlSet Class][4]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: https://learn.microsoft.com/dotnet/api/system.collections.generic.iasyncenumerable-1
[3]: https://learn.microsoft.com/dotnet/api/system.object
[4]: README.md
================================================
FILE: docs/api/DbExtensions/SqlSet/AsEnumerable.md
================================================
SqlSet.AsEnumerable Method
==========================
Gets all elements in the set. The query is deferred-executed.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public IEnumerable AsEnumerable()
```
#### Return Value
[IEnumerable][2]<[Object][3]>
All elements in the set.
See Also
--------
#### Reference
[SqlSet Class][4]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1
[3]: https://learn.microsoft.com/dotnet/api/system.object
[4]: README.md
================================================
FILE: docs/api/DbExtensions/SqlSet/Cast.md
================================================
SqlSet.Cast(Type) Method
========================
Casts the elements of the set to the specified type.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ----------------------- | ---------------------------------------------------- |
| **Cast(Type)** | Casts the elements of the set to the specified type. |
| [Cast<TResult>()][2] | Casts the elements of the set to the specified type. |
Syntax
------
```csharp
public SqlSet Cast(
Type resultType
)
```
#### Parameters
##### *resultType* [Type][3]
The type to cast the elements of the set to.
#### Return Value
[SqlSet][4]
A new [SqlSet][4] that contains each element of the current set cast to the specified type.
See Also
--------
#### Reference
[SqlSet Class][4]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: Cast__1.md
[3]: https://learn.microsoft.com/dotnet/api/system.type
[4]: README.md
================================================
FILE: docs/api/DbExtensions/SqlSet/Cast__1.md
================================================
SqlSet.Cast<TResult> Method
==============================
Casts the elements of the set to the specified type.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ---------------------- | ---------------------------------------------------- |
| [Cast(Type)][2] | Casts the elements of the set to the specified type. |
| **Cast<TResult>()** | Casts the elements of the set to the specified type. |
Syntax
------
```csharp
public SqlSet Cast()
```
#### Type Parameters
##### *TResult*
The type to cast the elements of the set to.
#### Return Value
[SqlSet][3]<**TResult**>
A new [SqlSet<TResult>][3] that contains each element of the current set cast to the specified type.
See Also
--------
#### Reference
[SqlSet Class][4]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: Cast.md
[3]: ../SqlSet_1/README.md
[4]: README.md
================================================
FILE: docs/api/DbExtensions/SqlSet/Contains.md
================================================
SqlSet.Contains Method
======================
Checks the existance of the *entity*, using the primary key value.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public bool Contains(
Object entity
)
```
#### Parameters
##### *entity* [Object][2]
The entity whose existance is to be checked.
#### Return Value
[Boolean][3]
`true` if the primary key value exists in the database; otherwise, `false`.
Exceptions
----------
| Exception | Condition |
| ------------------------------ | --------------------------------------------------------------------------------- |
| [InvalidOperationException][4] | This method can only be used on sets where the result type is an annotated class. |
See Also
--------
#### Reference
[SqlSet Class][5]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: https://learn.microsoft.com/dotnet/api/system.object
[3]: https://learn.microsoft.com/dotnet/api/system.boolean
[4]: https://learn.microsoft.com/dotnet/api/system.invalidoperationexception
[5]: README.md
================================================
FILE: docs/api/DbExtensions/SqlSet/ContainsAsync.md
================================================
SqlSet.ContainsAsync Method
===========================
Checks the existance of the *entity*, using the primary key value.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public ValueTask ContainsAsync(
Object entity,
CancellationToken cancellationToken = default
)
```
#### Parameters
##### *entity* [Object][2]
The entity whose existance is to be checked.
##### *cancellationToken* [CancellationToken][3] (Optional)
The [CancellationToken][3] to monitor for cancellation requests. The default is [None][4].
#### Return Value
[ValueTask][5]<[Boolean][6]>
`true` if the primary key value exists in the database; otherwise, `false`.
Exceptions
----------
| Exception | Condition |
| ------------------------------ | --------------------------------------------------------------------------------- |
| [InvalidOperationException][7] | This method can only be used on sets where the result type is an annotated class. |
See Also
--------
#### Reference
[SqlSet Class][8]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: https://learn.microsoft.com/dotnet/api/system.object
[3]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken
[4]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken.none
[5]: https://learn.microsoft.com/dotnet/api/system.threading.tasks.valuetask-1
[6]: https://learn.microsoft.com/dotnet/api/system.boolean
[7]: https://learn.microsoft.com/dotnet/api/system.invalidoperationexception
[8]: README.md
================================================
FILE: docs/api/DbExtensions/SqlSet/ContainsKey.md
================================================
SqlSet.ContainsKey Method
=========================
Checks the existance of an entity whose primary matches the *id* parameter.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public bool ContainsKey(
Object id
)
```
#### Parameters
##### *id* [Object][2]
The primary key value.
#### Return Value
[Boolean][3]
`true` if the primary key value exists in the database; otherwise, `false`.
Exceptions
----------
| Exception | Condition |
| ------------------------------ | --------------------------------------------------------------------------------- |
| [InvalidOperationException][4] | This method can only be used on sets where the result type is an annotated class. |
See Also
--------
#### Reference
[SqlSet Class][5]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: https://learn.microsoft.com/dotnet/api/system.object
[3]: https://learn.microsoft.com/dotnet/api/system.boolean
[4]: https://learn.microsoft.com/dotnet/api/system.invalidoperationexception
[5]: README.md
================================================
FILE: docs/api/DbExtensions/SqlSet/ContainsKeyAsync.md
================================================
SqlSet.ContainsKeyAsync Method
==============================
Checks the existance of an entity whose primary matches the *id* parameter.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public ValueTask ContainsKeyAsync(
Object id,
CancellationToken cancellationToken = default
)
```
#### Parameters
##### *id* [Object][2]
The primary key value.
##### *cancellationToken* [CancellationToken][3] (Optional)
The [CancellationToken][3] to monitor for cancellation requests. The default is [None][4].
#### Return Value
[ValueTask][5]<[Boolean][6]>
`true` if the primary key value exists in the database; otherwise, `false`.
Exceptions
----------
| Exception | Condition |
| ------------------------------ | --------------------------------------------------------------------------------- |
| [InvalidOperationException][7] | This method can only be used on sets where the result type is an annotated class. |
See Also
--------
#### Reference
[SqlSet Class][8]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: https://learn.microsoft.com/dotnet/api/system.object
[3]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken
[4]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken.none
[5]: https://learn.microsoft.com/dotnet/api/system.threading.tasks.valuetask-1
[6]: https://learn.microsoft.com/dotnet/api/system.boolean
[7]: https://learn.microsoft.com/dotnet/api/system.invalidoperationexception
[8]: README.md
================================================
FILE: docs/api/DbExtensions/SqlSet/Count.md
================================================
SqlSet.Count Method
===================
Returns the number of elements in the set.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| --------------------------------- | ---------------------------------------------------------------------------------- |
| **Count()** | Returns the number of elements in the set. |
| [Count(OperatorStringHandler)][2] | Returns a number that represents how many elements in the set satisfy a condition. |
| [Count(String)][3] | Returns a number that represents how many elements in the set satisfy a condition. |
Syntax
------
```csharp
public int Count()
```
#### Return Value
[Int32][4]
The number of elements in the set.
Exceptions
----------
| Exception | Condition |
| ---------------------- | ---------------------------------------------------- |
| [OverflowException][5] | The number of elements is larger than [MaxValue][6]. |
See Also
--------
#### Reference
[SqlSet Class][7]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: Count_1.md
[3]: Count_2.md
[4]: https://learn.microsoft.com/dotnet/api/system.int32
[5]: https://learn.microsoft.com/dotnet/api/system.overflowexception
[6]: https://learn.microsoft.com/dotnet/api/system.int32.maxvalue
[7]: README.md
================================================
FILE: docs/api/DbExtensions/SqlSet/CountAsync.md
================================================
SqlSet.CountAsync(SqlSet.OperatorStringHandler, CancellationToken) Method
=========================================================================
Returns a number that represents how many elements in the set satisfy a condition.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| -------------------------------------------------------- | ---------------------------------------------------------------------------------- |
| [CountAsync(CancellationToken)][2] | Returns the number of elements in the set. |
| **CountAsync(OperatorStringHandler, CancellationToken)** | Returns a number that represents how many elements in the set satisfy a condition. |
| [CountAsync(String, CancellationToken)][3] | Returns a number that represents how many elements in the set satisfy a condition. |
Syntax
------
```csharp
public ValueTask CountAsync(
OperatorStringHandler predicate,
CancellationToken cancellationToken = default
)
```
#### Parameters
##### *predicate* OperatorStringHandler
A SQL expression to test each row for a condition.
##### *cancellationToken* [CancellationToken][4] (Optional)
The [CancellationToken][4] to monitor for cancellation requests. The default is [None][5].
#### Return Value
[ValueTask][6]<[Int32][7]>
A number that represents how many elements in the set satisfy the condition in the *predicate*.
Exceptions
----------
| Exception | Condition |
| ---------------------- | ------------------------------------------------------ |
| [OverflowException][8] | The number of matching elements exceeds [MaxValue][9]. |
See Also
--------
#### Reference
[SqlSet Class][10]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: CountAsync_2.md
[3]: CountAsync_1.md
[4]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken
[5]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken.none
[6]: https://learn.microsoft.com/dotnet/api/system.threading.tasks.valuetask-1
[7]: https://learn.microsoft.com/dotnet/api/system.int32
[8]: https://learn.microsoft.com/dotnet/api/system.overflowexception
[9]: https://learn.microsoft.com/dotnet/api/system.int32.maxvalue
[10]: README.md
================================================
FILE: docs/api/DbExtensions/SqlSet/CountAsync_1.md
================================================
SqlSet.CountAsync(String, CancellationToken) Method
===================================================
Returns a number that represents how many elements in the set satisfy a condition.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| --------------------------------------------------------- | ---------------------------------------------------------------------------------- |
| [CountAsync(CancellationToken)][2] | Returns the number of elements in the set. |
| [CountAsync(OperatorStringHandler, CancellationToken)][3] | Returns a number that represents how many elements in the set satisfy a condition. |
| **CountAsync(String, CancellationToken)** | Returns a number that represents how many elements in the set satisfy a condition. |
Syntax
------
```csharp
public ValueTask CountAsync(
string predicate,
CancellationToken cancellationToken = default
)
```
#### Parameters
##### *predicate* [String][4]
A SQL expression to test each row for a condition.
##### *cancellationToken* [CancellationToken][5] (Optional)
The [CancellationToken][5] to monitor for cancellation requests. The default is [None][6].
#### Return Value
[ValueTask][7]<[Int32][8]>
A number that represents how many elements in the set satisfy the condition in the *predicate*.
Exceptions
----------
| Exception | Condition |
| ---------------------- | ------------------------------------------------------- |
| [OverflowException][9] | The number of matching elements exceeds [MaxValue][10]. |
See Also
--------
#### Reference
[SqlSet Class][11]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: CountAsync_2.md
[3]: CountAsync.md
[4]: https://learn.microsoft.com/dotnet/api/system.string
[5]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken
[6]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken.none
[7]: https://learn.microsoft.com/dotnet/api/system.threading.tasks.valuetask-1
[8]: https://learn.microsoft.com/dotnet/api/system.int32
[9]: https://learn.microsoft.com/dotnet/api/system.overflowexception
[10]: https://learn.microsoft.com/dotnet/api/system.int32.maxvalue
[11]: README.md
================================================
FILE: docs/api/DbExtensions/SqlSet/CountAsync_2.md
================================================
SqlSet.CountAsync(CancellationToken) Method
===========================================
Returns the number of elements in the set.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| --------------------------------------------------------- | ---------------------------------------------------------------------------------- |
| **CountAsync(CancellationToken)** | Returns the number of elements in the set. |
| [CountAsync(OperatorStringHandler, CancellationToken)][2] | Returns a number that represents how many elements in the set satisfy a condition. |
| [CountAsync(String, CancellationToken)][3] | Returns a number that represents how many elements in the set satisfy a condition. |
Syntax
------
```csharp
public ValueTask CountAsync(
CancellationToken cancellationToken = default
)
```
#### Parameters
##### *cancellationToken* [CancellationToken][4] (Optional)
The [CancellationToken][4] to monitor for cancellation requests. The default is [None][5].
#### Return Value
[ValueTask][6]<[Int32][7]>
The number of elements in the set.
Exceptions
----------
| Exception | Condition |
| ---------------------- | ---------------------------------------------------- |
| [OverflowException][8] | The number of elements is larger than [MaxValue][9]. |
See Also
--------
#### Reference
[SqlSet Class][10]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: CountAsync.md
[3]: CountAsync_1.md
[4]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken
[5]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken.none
[6]: https://learn.microsoft.com/dotnet/api/system.threading.tasks.valuetask-1
[7]: https://learn.microsoft.com/dotnet/api/system.int32
[8]: https://learn.microsoft.com/dotnet/api/system.overflowexception
[9]: https://learn.microsoft.com/dotnet/api/system.int32.maxvalue
[10]: README.md
================================================
FILE: docs/api/DbExtensions/SqlSet/Count_1.md
================================================
SqlSet.Count(SqlSet.OperatorStringHandler) Method
=================================================
Returns a number that represents how many elements in the set satisfy a condition.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| -------------------------------- | ---------------------------------------------------------------------------------- |
| [Count()][2] | Returns the number of elements in the set. |
| **Count(OperatorStringHandler)** | Returns a number that represents how many elements in the set satisfy a condition. |
| [Count(String)][3] | Returns a number that represents how many elements in the set satisfy a condition. |
Syntax
------
```csharp
public int Count(
ref OperatorStringHandler predicate
)
```
#### Parameters
##### *predicate* OperatorStringHandler
A SQL expression to test each row for a condition.
#### Return Value
[Int32][4]
A number that represents how many elements in the set satisfy the condition in the *predicate*.
Exceptions
----------
| Exception | Condition |
| ---------------------- | ------------------------------------------------------ |
| [OverflowException][5] | The number of matching elements exceeds [MaxValue][6]. |
See Also
--------
#### Reference
[SqlSet Class][7]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: Count.md
[3]: Count_2.md
[4]: https://learn.microsoft.com/dotnet/api/system.int32
[5]: https://learn.microsoft.com/dotnet/api/system.overflowexception
[6]: https://learn.microsoft.com/dotnet/api/system.int32.maxvalue
[7]: README.md
================================================
FILE: docs/api/DbExtensions/SqlSet/Count_2.md
================================================
SqlSet.Count(String) Method
===========================
Returns a number that represents how many elements in the set satisfy a condition.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| --------------------------------- | ---------------------------------------------------------------------------------- |
| [Count()][2] | Returns the number of elements in the set. |
| [Count(OperatorStringHandler)][3] | Returns a number that represents how many elements in the set satisfy a condition. |
| **Count(String)** | Returns a number that represents how many elements in the set satisfy a condition. |
Syntax
------
```csharp
public int Count(
string predicate
)
```
#### Parameters
##### *predicate* [String][4]
A SQL expression to test each row for a condition.
#### Return Value
[Int32][5]
A number that represents how many elements in the set satisfy the condition in the *predicate*.
Exceptions
----------
| Exception | Condition |
| ---------------------- | ------------------------------------------------------ |
| [OverflowException][6] | The number of matching elements exceeds [MaxValue][7]. |
See Also
--------
#### Reference
[SqlSet Class][8]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: Count.md
[3]: Count_1.md
[4]: https://learn.microsoft.com/dotnet/api/system.string
[5]: https://learn.microsoft.com/dotnet/api/system.int32
[6]: https://learn.microsoft.com/dotnet/api/system.overflowexception
[7]: https://learn.microsoft.com/dotnet/api/system.int32.maxvalue
[8]: README.md
================================================
FILE: docs/api/DbExtensions/SqlSet/Database.md
================================================
SqlSet.Database Property
========================
The [Database][1] this set is connected to.
**Namespace:** [DbExtensions][2]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public Database Database { get; }
```
#### Property Value
[Database][1]
See Also
--------
#### Reference
[SqlSet Class][3]
[DbExtensions Namespace][2]
[1]: ../Database/README.md
[2]: ../README.md
[3]: README.md
================================================
FILE: docs/api/DbExtensions/SqlSet/Find.md
================================================
SqlSet.Find Method
==================
Gets the entity whose primary key matches the *id* parameter.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public Object? Find(
Object id
)
```
#### Parameters
##### *id* [Object][2]
The primary key value.
#### Return Value
[Object][2]
The entity whose primary key matches the *id* parameter, or null if the *id* does not exist.
Exceptions
----------
| Exception | Condition |
| ------------------------------ | --------------------------------------------------------------------------------- |
| [InvalidOperationException][3] | This method can only be used on sets where the result type is an annotated class. |
See Also
--------
#### Reference
[SqlSet Class][4]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: https://learn.microsoft.com/dotnet/api/system.object
[3]: https://learn.microsoft.com/dotnet/api/system.invalidoperationexception
[4]: README.md
================================================
FILE: docs/api/DbExtensions/SqlSet/FindAsync.md
================================================
SqlSet.FindAsync Method
=======================
Gets the entity whose primary key matches the *id* parameter.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public ValueTask FindAsync(
Object id,
CancellationToken cancellationToken = default
)
```
#### Parameters
##### *id* [Object][2]
The primary key value.
##### *cancellationToken* [CancellationToken][3] (Optional)
The [CancellationToken][3] to monitor for cancellation requests. The default is [None][4].
#### Return Value
[ValueTask][5]<[Object][2]>
The entity whose primary key matches the *id* parameter, or null if the *id* does not exist.
Exceptions
----------
| Exception | Condition |
| ------------------------------ | --------------------------------------------------------------------------------- |
| [InvalidOperationException][6] | This method can only be used on sets where the result type is an annotated class. |
See Also
--------
#### Reference
[SqlSet Class][7]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: https://learn.microsoft.com/dotnet/api/system.object
[3]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken
[4]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken.none
[5]: https://learn.microsoft.com/dotnet/api/system.threading.tasks.valuetask-1
[6]: https://learn.microsoft.com/dotnet/api/system.invalidoperationexception
[7]: README.md
================================================
FILE: docs/api/DbExtensions/SqlSet/First.md
================================================
SqlSet.First Method
===================
Returns the first element of the set.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| --------------------------------- | -------------------------------------------------------------------------- |
| **First()** | Returns the first element of the set. |
| [First(OperatorStringHandler)][2] | Returns the first element in the set that satisfies a specified condition. |
| [First(String)][3] | Returns the first element in the set that satisfies a specified condition. |
Syntax
------
```csharp
public Object First()
```
#### Return Value
[Object][4]
The first element in the set.
Exceptions
----------
| Exception | Condition |
| ------------------------------ | ----------------- |
| [InvalidOperationException][5] | The set is empty. |
See Also
--------
#### Reference
[SqlSet Class][6]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: First_1.md
[3]: First_2.md
[4]: https://learn.microsoft.com/dotnet/api/system.object
[5]: https://learn.microsoft.com/dotnet/api/system.invalidoperationexception
[6]: README.md
================================================
FILE: docs/api/DbExtensions/SqlSet/FirstAsync.md
================================================
SqlSet.FirstAsync(SqlSet.OperatorStringHandler, CancellationToken) Method
=========================================================================
Returns the first element in the set that satisfies a specified condition.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| -------------------------------------------------------- | -------------------------------------------------------------------------- |
| [FirstAsync(CancellationToken)][2] | Returns the first element of the set. |
| **FirstAsync(OperatorStringHandler, CancellationToken)** | Returns the first element in the set that satisfies a specified condition. |
| [FirstAsync(String, CancellationToken)][3] | Returns the first element in the set that satisfies a specified condition. |
Syntax
------
```csharp
public ValueTask FirstAsync(
OperatorStringHandler predicate,
CancellationToken cancellationToken = default
)
```
#### Parameters
##### *predicate* OperatorStringHandler
A SQL expression to test each row for a condition.
##### *cancellationToken* [CancellationToken][4] (Optional)
The [CancellationToken][4] to monitor for cancellation requests. The default is [None][5].
#### Return Value
[ValueTask][6]<[Object][7]>
The first element in the set that passes the test in the specified *predicate*.
Exceptions
----------
| Exception | Condition |
| ------------------------------ | ----------------------------------------------------------------------- |
| [InvalidOperationException][8] | No element satisfies the condition in *predicate*.-or-The set is empty. |
See Also
--------
#### Reference
[SqlSet Class][9]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: FirstAsync_2.md
[3]: FirstAsync_1.md
[4]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken
[5]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken.none
[6]: https://learn.microsoft.com/dotnet/api/system.threading.tasks.valuetask-1
[7]: https://learn.microsoft.com/dotnet/api/system.object
[8]: https://learn.microsoft.com/dotnet/api/system.invalidoperationexception
[9]: README.md
================================================
FILE: docs/api/DbExtensions/SqlSet/FirstAsync_1.md
================================================
SqlSet.FirstAsync(String, CancellationToken) Method
===================================================
Returns the first element in the set that satisfies a specified condition.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| --------------------------------------------------------- | -------------------------------------------------------------------------- |
| [FirstAsync(CancellationToken)][2] | Returns the first element of the set. |
| [FirstAsync(OperatorStringHandler, CancellationToken)][3] | Returns the first element in the set that satisfies a specified condition. |
| **FirstAsync(String, CancellationToken)** | Returns the first element in the set that satisfies a specified condition. |
Syntax
------
```csharp
public ValueTask FirstAsync(
string predicate,
CancellationToken cancellationToken = default
)
```
#### Parameters
##### *predicate* [String][4]
A SQL expression to test each row for a condition.
##### *cancellationToken* [CancellationToken][5] (Optional)
The [CancellationToken][5] to monitor for cancellation requests. The default is [None][6].
#### Return Value
[ValueTask][7]<[Object][8]>
The first element in the set that passes the test in the specified *predicate*.
Exceptions
----------
| Exception | Condition |
| ------------------------------ | ----------------------------------------------------------------------- |
| [InvalidOperationException][9] | No element satisfies the condition in *predicate*.-or-The set is empty. |
See Also
--------
#### Reference
[SqlSet Class][10]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: FirstAsync_2.md
[3]: FirstAsync.md
[4]: https://learn.microsoft.com/dotnet/api/system.string
[5]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken
[6]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken.none
[7]: https://learn.microsoft.com/dotnet/api/system.threading.tasks.valuetask-1
[8]: https://learn.microsoft.com/dotnet/api/system.object
[9]: https://learn.microsoft.com/dotnet/api/system.invalidoperationexception
[10]: README.md
================================================
FILE: docs/api/DbExtensions/SqlSet/FirstAsync_2.md
================================================
SqlSet.FirstAsync(CancellationToken) Method
===========================================
Returns the first element of the set.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| --------------------------------------------------------- | -------------------------------------------------------------------------- |
| **FirstAsync(CancellationToken)** | Returns the first element of the set. |
| [FirstAsync(OperatorStringHandler, CancellationToken)][2] | Returns the first element in the set that satisfies a specified condition. |
| [FirstAsync(String, CancellationToken)][3] | Returns the first element in the set that satisfies a specified condition. |
Syntax
------
```csharp
public ValueTask FirstAsync(
CancellationToken cancellationToken = default
)
```
#### Parameters
##### *cancellationToken* [CancellationToken][4] (Optional)
The [CancellationToken][4] to monitor for cancellation requests. The default is [None][5].
#### Return Value
[ValueTask][6]<[Object][7]>
The first element in the set.
Exceptions
----------
| Exception | Condition |
| ------------------------------ | ----------------- |
| [InvalidOperationException][8] | The set is empty. |
See Also
--------
#### Reference
[SqlSet Class][9]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: FirstAsync.md
[3]: FirstAsync_1.md
[4]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken
[5]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken.none
[6]: https://learn.microsoft.com/dotnet/api/system.threading.tasks.valuetask-1
[7]: https://learn.microsoft.com/dotnet/api/system.object
[8]: https://learn.microsoft.com/dotnet/api/system.invalidoperationexception
[9]: README.md
================================================
FILE: docs/api/DbExtensions/SqlSet/FirstOrDefault.md
================================================
SqlSet.FirstOrDefault Method
============================
Returns the first element of the set, or a default value if the set contains no elements.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ------------------------------------------ | --------------------------------------------------------------------------------------------------------------- |
| **FirstOrDefault()** | Returns the first element of the set, or a default value if the set contains no elements. |
| [FirstOrDefault(OperatorStringHandler)][2] | Returns the first element of the set that satisfies a condition or a default value if no such element is found. |
| [FirstOrDefault(String)][3] | Returns the first element of the set that satisfies a condition or a default value if no such element is found. |
Syntax
------
```csharp
public Object? FirstOrDefault()
```
#### Return Value
[Object][4]
A default value if the set is empty; otherwise, the first element.
See Also
--------
#### Reference
[SqlSet Class][5]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: FirstOrDefault_1.md
[3]: FirstOrDefault_2.md
[4]: https://learn.microsoft.com/dotnet/api/system.object
[5]: README.md
================================================
FILE: docs/api/DbExtensions/SqlSet/FirstOrDefaultAsync.md
================================================
SqlSet.FirstOrDefaultAsync(SqlSet.OperatorStringHandler, CancellationToken) Method
==================================================================================
Returns the first element of the set that satisfies a condition or a default value if no such element is found.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ----------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- |
| [FirstOrDefaultAsync(CancellationToken)][2] | Returns the first element of the set, or a default value if the set contains no elements. |
| **FirstOrDefaultAsync(OperatorStringHandler, CancellationToken)** | Returns the first element of the set that satisfies a condition or a default value if no such element is found. |
| [FirstOrDefaultAsync(String, CancellationToken)][3] | Returns the first element of the set that satisfies a condition or a default value if no such element is found. |
Syntax
------
```csharp
public ValueTask FirstOrDefaultAsync(
OperatorStringHandler predicate,
CancellationToken cancellationToken = default
)
```
#### Parameters
##### *predicate* OperatorStringHandler
A SQL expression to test each row for a condition.
##### *cancellationToken* [CancellationToken][4] (Optional)
The [CancellationToken][4] to monitor for cancellation requests. The default is [None][5].
#### Return Value
[ValueTask][6]<[Object][7]>
A default value if the set is empty or if no element passes the test specified by *predicate*; otherwise, the first element that passes the test specified by *predicate*.
See Also
--------
#### Reference
[SqlSet Class][8]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: FirstOrDefaultAsync_2.md
[3]: FirstOrDefaultAsync_1.md
[4]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken
[5]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken.none
[6]: https://learn.microsoft.com/dotnet/api/system.threading.tasks.valuetask-1
[7]: https://learn.microsoft.com/dotnet/api/system.object
[8]: README.md
================================================
FILE: docs/api/DbExtensions/SqlSet/FirstOrDefaultAsync_1.md
================================================
SqlSet.FirstOrDefaultAsync(String, CancellationToken) Method
============================================================
Returns the first element of the set that satisfies a condition or a default value if no such element is found.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------- |
| [FirstOrDefaultAsync(CancellationToken)][2] | Returns the first element of the set, or a default value if the set contains no elements. |
| [FirstOrDefaultAsync(OperatorStringHandler, CancellationToken)][3] | Returns the first element of the set that satisfies a condition or a default value if no such element is found. |
| **FirstOrDefaultAsync(String, CancellationToken)** | Returns the first element of the set that satisfies a condition or a default value if no such element is found. |
Syntax
------
```csharp
public ValueTask FirstOrDefaultAsync(
string predicate,
CancellationToken cancellationToken = default
)
```
#### Parameters
##### *predicate* [String][4]
A SQL expression to test each row for a condition.
##### *cancellationToken* [CancellationToken][5] (Optional)
The [CancellationToken][5] to monitor for cancellation requests. The default is [None][6].
#### Return Value
[ValueTask][7]<[Object][8]>
A default value if the set is empty or if no element passes the test specified by *predicate*; otherwise, the first element that passes the test specified by *predicate*.
See Also
--------
#### Reference
[SqlSet Class][9]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: FirstOrDefaultAsync_2.md
[3]: FirstOrDefaultAsync.md
[4]: https://learn.microsoft.com/dotnet/api/system.string
[5]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken
[6]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken.none
[7]: https://learn.microsoft.com/dotnet/api/system.threading.tasks.valuetask-1
[8]: https://learn.microsoft.com/dotnet/api/system.object
[9]: README.md
================================================
FILE: docs/api/DbExtensions/SqlSet/FirstOrDefaultAsync_2.md
================================================
SqlSet.FirstOrDefaultAsync(CancellationToken) Method
====================================================
Returns the first element of the set, or a default value if the set contains no elements.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------- |
| **FirstOrDefaultAsync(CancellationToken)** | Returns the first element of the set, or a default value if the set contains no elements. |
| [FirstOrDefaultAsync(OperatorStringHandler, CancellationToken)][2] | Returns the first element of the set that satisfies a condition or a default value if no such element is found. |
| [FirstOrDefaultAsync(String, CancellationToken)][3] | Returns the first element of the set that satisfies a condition or a default value if no such element is found. |
Syntax
------
```csharp
public ValueTask FirstOrDefaultAsync(
CancellationToken cancellationToken = default
)
```
#### Parameters
##### *cancellationToken* [CancellationToken][4] (Optional)
The [CancellationToken][4] to monitor for cancellation requests. The default is [None][5].
#### Return Value
[ValueTask][6]<[Object][7]>
A default value if the set is empty; otherwise, the first element.
See Also
--------
#### Reference
[SqlSet Class][8]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: FirstOrDefaultAsync.md
[3]: FirstOrDefaultAsync_1.md
[4]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken
[5]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken.none
[6]: https://learn.microsoft.com/dotnet/api/system.threading.tasks.valuetask-1
[7]: https://learn.microsoft.com/dotnet/api/system.object
[8]: README.md
================================================
FILE: docs/api/DbExtensions/SqlSet/FirstOrDefault_1.md
================================================
SqlSet.FirstOrDefault(SqlSet.OperatorStringHandler) Method
==========================================================
Returns the first element of the set that satisfies a condition or a default value if no such element is found.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ----------------------------------------- | --------------------------------------------------------------------------------------------------------------- |
| [FirstOrDefault()][2] | Returns the first element of the set, or a default value if the set contains no elements. |
| **FirstOrDefault(OperatorStringHandler)** | Returns the first element of the set that satisfies a condition or a default value if no such element is found. |
| [FirstOrDefault(String)][3] | Returns the first element of the set that satisfies a condition or a default value if no such element is found. |
Syntax
------
```csharp
public Object? FirstOrDefault(
ref OperatorStringHandler? predicate
)
```
#### Parameters
##### *predicate* OperatorStringHandler
A SQL expression to test each row for a condition.
#### Return Value
[Object][4]
A default value if the set is empty or if no element passes the test specified by *predicate*; otherwise, the first element that passes the test specified by *predicate*.
See Also
--------
#### Reference
[SqlSet Class][5]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: FirstOrDefault.md
[3]: FirstOrDefault_2.md
[4]: https://learn.microsoft.com/dotnet/api/system.object
[5]: README.md
================================================
FILE: docs/api/DbExtensions/SqlSet/FirstOrDefault_2.md
================================================
SqlSet.FirstOrDefault(String) Method
====================================
Returns the first element of the set that satisfies a condition or a default value if no such element is found.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ------------------------------------------ | --------------------------------------------------------------------------------------------------------------- |
| [FirstOrDefault()][2] | Returns the first element of the set, or a default value if the set contains no elements. |
| [FirstOrDefault(OperatorStringHandler)][3] | Returns the first element of the set that satisfies a condition or a default value if no such element is found. |
| **FirstOrDefault(String)** | Returns the first element of the set that satisfies a condition or a default value if no such element is found. |
Syntax
------
```csharp
public Object? FirstOrDefault(
string predicate
)
```
#### Parameters
##### *predicate* [String][4]
A SQL expression to test each row for a condition.
#### Return Value
[Object][5]
A default value if the set is empty or if no element passes the test specified by *predicate*; otherwise, the first element that passes the test specified by *predicate*.
See Also
--------
#### Reference
[SqlSet Class][6]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: FirstOrDefault.md
[3]: FirstOrDefault_1.md
[4]: https://learn.microsoft.com/dotnet/api/system.string
[5]: https://learn.microsoft.com/dotnet/api/system.object
[6]: README.md
================================================
FILE: docs/api/DbExtensions/SqlSet/First_1.md
================================================
SqlSet.First(SqlSet.OperatorStringHandler) Method
=================================================
Returns the first element in the set that satisfies a specified condition.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| -------------------------------- | -------------------------------------------------------------------------- |
| [First()][2] | Returns the first element of the set. |
| **First(OperatorStringHandler)** | Returns the first element in the set that satisfies a specified condition. |
| [First(String)][3] | Returns the first element in the set that satisfies a specified condition. |
Syntax
------
```csharp
public Object First(
ref OperatorStringHandler predicate
)
```
#### Parameters
##### *predicate* OperatorStringHandler
A SQL expression to test each row for a condition.
#### Return Value
[Object][4]
The first element in the set that passes the test in the specified *predicate*.
Exceptions
----------
| Exception | Condition |
| ------------------------------ | ----------------------------------------------------------------------- |
| [InvalidOperationException][5] | No element satisfies the condition in *predicate*.-or-The set is empty. |
See Also
--------
#### Reference
[SqlSet Class][6]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: First.md
[3]: First_2.md
[4]: https://learn.microsoft.com/dotnet/api/system.object
[5]: https://learn.microsoft.com/dotnet/api/system.invalidoperationexception
[6]: README.md
================================================
FILE: docs/api/DbExtensions/SqlSet/First_2.md
================================================
SqlSet.First(String) Method
===========================
Returns the first element in the set that satisfies a specified condition.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| --------------------------------- | -------------------------------------------------------------------------- |
| [First()][2] | Returns the first element of the set. |
| [First(OperatorStringHandler)][3] | Returns the first element in the set that satisfies a specified condition. |
| **First(String)** | Returns the first element in the set that satisfies a specified condition. |
Syntax
------
```csharp
public Object First(
string predicate
)
```
#### Parameters
##### *predicate* [String][4]
A SQL expression to test each row for a condition.
#### Return Value
[Object][5]
The first element in the set that passes the test in the specified *predicate*.
Exceptions
----------
| Exception | Condition |
| ------------------------------ | ----------------------------------------------------------------------- |
| [InvalidOperationException][6] | No element satisfies the condition in *predicate*.-or-The set is empty. |
See Also
--------
#### Reference
[SqlSet Class][7]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: First.md
[3]: First_1.md
[4]: https://learn.microsoft.com/dotnet/api/system.string
[5]: https://learn.microsoft.com/dotnet/api/system.object
[6]: https://learn.microsoft.com/dotnet/api/system.invalidoperationexception
[7]: README.md
================================================
FILE: docs/api/DbExtensions/SqlSet/GetAsyncEnumerator.md
================================================
SqlSet.GetAsyncEnumerator Method
================================
Returns an async enumerator that iterates through the set.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public IAsyncEnumerator GetAsyncEnumerator(
CancellationToken cancellationToken = default
)
```
#### Parameters
##### *cancellationToken* [CancellationToken][2] (Optional)
The [CancellationToken][2] to monitor for cancellation requests. The default is [None][3].
#### Return Value
[IAsyncEnumerator][4]<[Object][5]>
A [IAsyncEnumerator<T>][4] for the set.
See Also
--------
#### Reference
[SqlSet Class][6]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken
[3]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken.none
[4]: https://learn.microsoft.com/dotnet/api/system.collections.generic.iasyncenumerator-1
[5]: https://learn.microsoft.com/dotnet/api/system.object
[6]: README.md
================================================
FILE: docs/api/DbExtensions/SqlSet/GetDefiningQuery.md
================================================
SqlSet.GetDefiningQuery Method
==============================
Returns the SQL query that is the source of data for the set.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public SqlBuilder GetDefiningQuery()
```
#### Return Value
[SqlBuilder][2]
The SQL query that is the source of data for the set
See Also
--------
#### Reference
[SqlSet Class][3]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: ../SqlBuilder/README.md
[3]: README.md
================================================
FILE: docs/api/DbExtensions/SqlSet/GetEnumerator.md
================================================
SqlSet.GetEnumerator Method
===========================
Returns an enumerator that iterates through the set.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public IEnumerator GetEnumerator()
```
#### Return Value
[IEnumerator][2]<[Object][3]>
A [IEnumerator<T>][2] for the set.
See Also
--------
#### Reference
[SqlSet Class][4]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerator-1
[3]: https://learn.microsoft.com/dotnet/api/system.object
[4]: README.md
================================================
FILE: docs/api/DbExtensions/SqlSet/Include.md
================================================
SqlSet.Include Method
=====================
Specifies the related objects to include in the query results.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public SqlSet Include(
string path
)
```
#### Parameters
##### *path* [String][2]
Dot-separated list of related objects to return in the query results.
#### Return Value
[SqlSet][3]
A new [SqlSet][3] with the defined query path.
Exceptions
----------
| Exception | Condition |
| ------------------------------ | --------------------------------------------------------------------------------- |
| [InvalidOperationException][4] | This method can only be used on sets where the result type is an annotated class. |
See Also
--------
#### Reference
[SqlSet Class][3]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: https://learn.microsoft.com/dotnet/api/system.string
[3]: README.md
[4]: https://learn.microsoft.com/dotnet/api/system.invalidoperationexception
================================================
FILE: docs/api/DbExtensions/SqlSet/IncludeMany.md
================================================
SqlSet.IncludeMany Method
=========================
Specifies which collections to include in the query results.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public SqlSet IncludeMany(
string path,
Func? manySetup = null
)
```
#### Parameters
##### *path* [String][2]
Dot-separated list of one or more related objects that ends with the collection to load.
##### *manySetup* [Func][3]<[SqlSet][4], [SqlSet][4]> (Optional)
A function to customize how the collection is loaded.
#### Return Value
[SqlSet][4]
A new [SqlSet][4].
Exceptions
----------
| Exception | Condition |
| ------------------------------ | --------------------------------------------------------------------------------- |
| [InvalidOperationException][5] | This method can only be used on sets where the result type is an annotated class. |
See Also
--------
#### Reference
[SqlSet Class][4]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: https://learn.microsoft.com/dotnet/api/system.string
[3]: https://learn.microsoft.com/dotnet/api/system.func-2
[4]: README.md
[5]: https://learn.microsoft.com/dotnet/api/system.invalidoperationexception
================================================
FILE: docs/api/DbExtensions/SqlSet/LongCount.md
================================================
SqlSet.LongCount Method
=======================
Returns an [Int64][1] that represents the total number of elements in the set.
**Namespace:** [DbExtensions][2]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ------------------------------------- | --------------------------------------------------------------------------------------- |
| **LongCount()** | Returns an [Int64][1] that represents the total number of elements in the set. |
| [LongCount(OperatorStringHandler)][3] | Returns an [Int64][1] that represents how many elements in the set satisfy a condition. |
| [LongCount(String)][4] | Returns an [Int64][1] that represents how many elements in the set satisfy a condition. |
Syntax
------
```csharp
public long LongCount()
```
#### Return Value
[Int64][1]
The number of elements in the set.
Exceptions
----------
| Exception | Condition |
| ---------------------- | ---------------------------------------------------- |
| [OverflowException][5] | The number of elements is larger than [MaxValue][6]. |
See Also
--------
#### Reference
[SqlSet Class][7]
[DbExtensions Namespace][2]
[1]: https://learn.microsoft.com/dotnet/api/system.int64
[2]: ../README.md
[3]: LongCount_1.md
[4]: LongCount_2.md
[5]: https://learn.microsoft.com/dotnet/api/system.overflowexception
[6]: https://learn.microsoft.com/dotnet/api/system.int64.maxvalue
[7]: README.md
================================================
FILE: docs/api/DbExtensions/SqlSet/LongCountAsync.md
================================================
SqlSet.LongCountAsync(SqlSet.OperatorStringHandler, CancellationToken) Method
=============================================================================
Returns an [Int64][1] that represents how many elements in the set satisfy a condition.
**Namespace:** [DbExtensions][2]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ------------------------------------------------------------ | --------------------------------------------------------------------------------------- |
| [LongCountAsync(CancellationToken)][3] | Returns an [Int64][1] that represents the total number of elements in the set. |
| **LongCountAsync(OperatorStringHandler, CancellationToken)** | Returns an [Int64][1] that represents how many elements in the set satisfy a condition. |
| [LongCountAsync(String, CancellationToken)][4] | Returns an [Int64][1] that represents how many elements in the set satisfy a condition. |
Syntax
------
```csharp
public ValueTask LongCountAsync(
OperatorStringHandler predicate,
CancellationToken cancellationToken = default
)
```
#### Parameters
##### *predicate* OperatorStringHandler
A SQL expression to test each row for a condition.
##### *cancellationToken* [CancellationToken][5] (Optional)
The [CancellationToken][5] to monitor for cancellation requests. The default is [None][6].
#### Return Value
[ValueTask][7]<[Int64][1]>
A number that represents how many elements in the set satisfy the condition in the *predicate*.
Exceptions
----------
| Exception | Condition |
| ---------------------- | ------------------------------------------------------ |
| [OverflowException][8] | The number of matching elements exceeds [MaxValue][9]. |
See Also
--------
#### Reference
[SqlSet Class][10]
[DbExtensions Namespace][2]
[1]: https://learn.microsoft.com/dotnet/api/system.int64
[2]: ../README.md
[3]: LongCountAsync_2.md
[4]: LongCountAsync_1.md
[5]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken
[6]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken.none
[7]: https://learn.microsoft.com/dotnet/api/system.threading.tasks.valuetask-1
[8]: https://learn.microsoft.com/dotnet/api/system.overflowexception
[9]: https://learn.microsoft.com/dotnet/api/system.int64.maxvalue
[10]: README.md
================================================
FILE: docs/api/DbExtensions/SqlSet/LongCountAsync_1.md
================================================
SqlSet.LongCountAsync(String, CancellationToken) Method
=======================================================
Returns an [Int64][1] that represents how many elements in the set satisfy a condition.
**Namespace:** [DbExtensions][2]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ------------------------------------------------------------- | --------------------------------------------------------------------------------------- |
| [LongCountAsync(CancellationToken)][3] | Returns an [Int64][1] that represents the total number of elements in the set. |
| [LongCountAsync(OperatorStringHandler, CancellationToken)][4] | Returns an [Int64][1] that represents how many elements in the set satisfy a condition. |
| **LongCountAsync(String, CancellationToken)** | Returns an [Int64][1] that represents how many elements in the set satisfy a condition. |
Syntax
------
```csharp
public ValueTask LongCountAsync(
string predicate,
CancellationToken cancellationToken = default
)
```
#### Parameters
##### *predicate* [String][5]
A SQL expression to test each row for a condition.
##### *cancellationToken* [CancellationToken][6] (Optional)
The [CancellationToken][6] to monitor for cancellation requests. The default is [None][7].
#### Return Value
[ValueTask][8]<[Int64][1]>
A number that represents how many elements in the set satisfy the condition in the *predicate*.
Exceptions
----------
| Exception | Condition |
| ---------------------- | ------------------------------------------------------- |
| [OverflowException][9] | The number of matching elements exceeds [MaxValue][10]. |
See Also
--------
#### Reference
[SqlSet Class][11]
[DbExtensions Namespace][2]
[1]: https://learn.microsoft.com/dotnet/api/system.int64
[2]: ../README.md
[3]: LongCountAsync_2.md
[4]: LongCountAsync.md
[5]: https://learn.microsoft.com/dotnet/api/system.string
[6]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken
[7]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken.none
[8]: https://learn.microsoft.com/dotnet/api/system.threading.tasks.valuetask-1
[9]: https://learn.microsoft.com/dotnet/api/system.overflowexception
[10]: https://learn.microsoft.com/dotnet/api/system.int64.maxvalue
[11]: README.md
================================================
FILE: docs/api/DbExtensions/SqlSet/LongCountAsync_2.md
================================================
SqlSet.LongCountAsync(CancellationToken) Method
===============================================
Returns an [Int64][1] that represents the total number of elements in the set.
**Namespace:** [DbExtensions][2]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ------------------------------------------------------------- | --------------------------------------------------------------------------------------- |
| **LongCountAsync(CancellationToken)** | Returns an [Int64][1] that represents the total number of elements in the set. |
| [LongCountAsync(OperatorStringHandler, CancellationToken)][3] | Returns an [Int64][1] that represents how many elements in the set satisfy a condition. |
| [LongCountAsync(String, CancellationToken)][4] | Returns an [Int64][1] that represents how many elements in the set satisfy a condition. |
Syntax
------
```csharp
public ValueTask LongCountAsync(
CancellationToken cancellationToken = default
)
```
#### Parameters
##### *cancellationToken* [CancellationToken][5] (Optional)
The [CancellationToken][5] to monitor for cancellation requests. The default is [None][6].
#### Return Value
[ValueTask][7]<[Int64][1]>
The number of elements in the set.
Exceptions
----------
| Exception | Condition |
| ---------------------- | ---------------------------------------------------- |
| [OverflowException][8] | The number of elements is larger than [MaxValue][9]. |
See Also
--------
#### Reference
[SqlSet Class][10]
[DbExtensions Namespace][2]
[1]: https://learn.microsoft.com/dotnet/api/system.int64
[2]: ../README.md
[3]: LongCountAsync.md
[4]: LongCountAsync_1.md
[5]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken
[6]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken.none
[7]: https://learn.microsoft.com/dotnet/api/system.threading.tasks.valuetask-1
[8]: https://learn.microsoft.com/dotnet/api/system.overflowexception
[9]: https://learn.microsoft.com/dotnet/api/system.int64.maxvalue
[10]: README.md
================================================
FILE: docs/api/DbExtensions/SqlSet/LongCount_1.md
================================================
SqlSet.LongCount(SqlSet.OperatorStringHandler) Method
=====================================================
Returns an [Int64][1] that represents how many elements in the set satisfy a condition.
**Namespace:** [DbExtensions][2]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ------------------------------------ | --------------------------------------------------------------------------------------- |
| [LongCount()][3] | Returns an [Int64][1] that represents the total number of elements in the set. |
| **LongCount(OperatorStringHandler)** | Returns an [Int64][1] that represents how many elements in the set satisfy a condition. |
| [LongCount(String)][4] | Returns an [Int64][1] that represents how many elements in the set satisfy a condition. |
Syntax
------
```csharp
public long LongCount(
ref OperatorStringHandler predicate
)
```
#### Parameters
##### *predicate* OperatorStringHandler
A SQL expression to test each row for a condition.
#### Return Value
[Int64][1]
A number that represents how many elements in the set satisfy the condition in the *predicate*.
Exceptions
----------
| Exception | Condition |
| ---------------------- | ------------------------------------------------------ |
| [OverflowException][5] | The number of matching elements exceeds [MaxValue][6]. |
See Also
--------
#### Reference
[SqlSet Class][7]
[DbExtensions Namespace][2]
[1]: https://learn.microsoft.com/dotnet/api/system.int64
[2]: ../README.md
[3]: LongCount.md
[4]: LongCount_2.md
[5]: https://learn.microsoft.com/dotnet/api/system.overflowexception
[6]: https://learn.microsoft.com/dotnet/api/system.int64.maxvalue
[7]: README.md
================================================
FILE: docs/api/DbExtensions/SqlSet/LongCount_2.md
================================================
SqlSet.LongCount(String) Method
===============================
Returns an [Int64][1] that represents how many elements in the set satisfy a condition.
**Namespace:** [DbExtensions][2]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ------------------------------------- | --------------------------------------------------------------------------------------- |
| [LongCount()][3] | Returns an [Int64][1] that represents the total number of elements in the set. |
| [LongCount(OperatorStringHandler)][4] | Returns an [Int64][1] that represents how many elements in the set satisfy a condition. |
| **LongCount(String)** | Returns an [Int64][1] that represents how many elements in the set satisfy a condition. |
Syntax
------
```csharp
public long LongCount(
string predicate
)
```
#### Parameters
##### *predicate* [String][5]
A SQL expression to test each row for a condition.
#### Return Value
[Int64][1]
A number that represents how many elements in the set satisfy the condition in the *predicate*.
Exceptions
----------
| Exception | Condition |
| ---------------------- | ------------------------------------------------------ |
| [OverflowException][6] | The number of matching elements exceeds [MaxValue][7]. |
See Also
--------
#### Reference
[SqlSet Class][8]
[DbExtensions Namespace][2]
[1]: https://learn.microsoft.com/dotnet/api/system.int64
[2]: ../README.md
[3]: LongCount.md
[4]: LongCount_1.md
[5]: https://learn.microsoft.com/dotnet/api/system.string
[6]: https://learn.microsoft.com/dotnet/api/system.overflowexception
[7]: https://learn.microsoft.com/dotnet/api/system.int64.maxvalue
[8]: README.md
================================================
FILE: docs/api/DbExtensions/SqlSet/OrderBy.md
================================================
SqlSet.OrderBy(SqlSet.OperatorStringHandler) Method
===================================================
Sorts the elements of the set according to the *columnList*.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ---------------------------------- | ------------------------------------------------------------ |
| **OrderBy(OperatorStringHandler)** | Sorts the elements of the set according to the *columnList*. |
| [OrderBy(String)][2] | Sorts the elements of the set according to the *columnList*. |
Syntax
------
```csharp
public SqlSet OrderBy(
ref OperatorStringHandler columnList
)
```
#### Parameters
##### *columnList* OperatorStringHandler
The list of columns to base the sort on.
#### Return Value
[SqlSet][3]
A new [SqlSet][3] whose elements are sorted according to *columnList*.
See Also
--------
#### Reference
[SqlSet Class][3]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: OrderBy_1.md
[3]: README.md
================================================
FILE: docs/api/DbExtensions/SqlSet/OrderBy_1.md
================================================
SqlSet.OrderBy(String) Method
=============================
Sorts the elements of the set according to the *columnList*.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ----------------------------------- | ------------------------------------------------------------ |
| [OrderBy(OperatorStringHandler)][2] | Sorts the elements of the set according to the *columnList*. |
| **OrderBy(String)** | Sorts the elements of the set according to the *columnList*. |
Syntax
------
```csharp
public SqlSet OrderBy(
string columnList
)
```
#### Parameters
##### *columnList* [String][3]
The list of columns to base the sort on.
#### Return Value
[SqlSet][4]
A new [SqlSet][4] whose elements are sorted according to *columnList*.
See Also
--------
#### Reference
[SqlSet Class][4]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: OrderBy.md
[3]: https://learn.microsoft.com/dotnet/api/system.string
[4]: README.md
================================================
FILE: docs/api/DbExtensions/SqlSet/README.md
================================================
SqlSet Class
============
Represents an immutable, connected SQL query. This class cannot be instantiated, to get an instance use one of the [Database.From][1] or [Database.FromQuery][2] overloads.
Inheritance Hierarchy
---------------------
[System.Object][3]
**DbExtensions.SqlSet**
[DbExtensions.SqlSet<TResult>][4]
[DbExtensions.SqlTable][5]
**Namespace:** [DbExtensions][6]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public class SqlSet
```
The **SqlSet** type exposes the following members.
Properties
----------
| Name | Description |
| --------------- | ---------------------------------------------------------------- |
| [Database][7] | The [Database][8] this set is connected to. |
| [ResultType][9] | The type of objects this set returns. This property can be null. |
Methods
-------
| Name | Description |
| ------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [All(OperatorStringHandler)][10] | Determines whether all elements of the set satisfy a condition. |
| [All(String)][11] | Determines whether all elements of the set satisfy a condition. |
| [AllAsync(OperatorStringHandler, CancellationToken)][12] | Determines whether all elements of the set satisfy a condition. |
| [AllAsync(String, CancellationToken)][13] | Determines whether all elements of the set satisfy a condition. |
| [Any()][14] | Determines whether the set contains any elements. |
| [Any(OperatorStringHandler)][15] | Determines whether any element of the set satisfies a condition. |
| [Any(String)][16] | Determines whether any element of the set satisfies a condition. |
| [AnyAsync(CancellationToken)][17] | Determines whether the set contains any elements. |
| [AnyAsync(OperatorStringHandler, CancellationToken)][18] | Determines whether any element of the set satisfies a condition. |
| [AnyAsync(String, CancellationToken)][19] | Determines whether any element of the set satisfies a condition. |
| [AsAsyncEnumerable][20] | Gets all elements in the set. The query is deferred-executed. |
| [AsEnumerable][21] | Gets all elements in the set. The query is deferred-executed. |
| [Cast(Type)][22] | Casts the elements of the set to the specified type. |
| [Cast<TResult>()][23] | Casts the elements of the set to the specified type. |
| [Contains][24] | Checks the existance of the *entity*, using the primary key value. |
| [ContainsAsync][25] | Checks the existance of the *entity*, using the primary key value. |
| [ContainsKey][26] | Checks the existance of an entity whose primary matches the *id* parameter. |
| [ContainsKeyAsync][27] | Checks the existance of an entity whose primary matches the *id* parameter. |
| [Count()][28] | Returns the number of elements in the set. |
| [Count(OperatorStringHandler)][29] | Returns a number that represents how many elements in the set satisfy a condition. |
| [Count(String)][30] | Returns a number that represents how many elements in the set satisfy a condition. |
| [CountAsync(CancellationToken)][31] | Returns the number of elements in the set. |
| [CountAsync(OperatorStringHandler, CancellationToken)][32] | Returns a number that represents how many elements in the set satisfy a condition. |
| [CountAsync(String, CancellationToken)][33] | Returns a number that represents how many elements in the set satisfy a condition. |
| [Find][34] | Gets the entity whose primary key matches the *id* parameter. |
| [FindAsync][35] | Gets the entity whose primary key matches the *id* parameter. |
| [First()][36] | Returns the first element of the set. |
| [First(OperatorStringHandler)][37] | Returns the first element in the set that satisfies a specified condition. |
| [First(String)][38] | Returns the first element in the set that satisfies a specified condition. |
| [FirstAsync(CancellationToken)][39] | Returns the first element of the set. |
| [FirstAsync(OperatorStringHandler, CancellationToken)][40] | Returns the first element in the set that satisfies a specified condition. |
| [FirstAsync(String, CancellationToken)][41] | Returns the first element in the set that satisfies a specified condition. |
| [FirstOrDefault()][42] | Returns the first element of the set, or a default value if the set contains no elements. |
| [FirstOrDefault(OperatorStringHandler)][43] | Returns the first element of the set that satisfies a condition or a default value if no such element is found. |
| [FirstOrDefault(String)][44] | Returns the first element of the set that satisfies a condition or a default value if no such element is found. |
| [FirstOrDefaultAsync(CancellationToken)][45] | Returns the first element of the set, or a default value if the set contains no elements. |
| [FirstOrDefaultAsync(OperatorStringHandler, CancellationToken)][46] | Returns the first element of the set that satisfies a condition or a default value if no such element is found. |
| [FirstOrDefaultAsync(String, CancellationToken)][47] | Returns the first element of the set that satisfies a condition or a default value if no such element is found. |
| [GetAsyncEnumerator][48] | Returns an async enumerator that iterates through the set. |
| [GetDefiningQuery][49] | Returns the SQL query that is the source of data for the set. |
| [GetEnumerator][50] | Returns an enumerator that iterates through the set. |
| [Include][51] | Specifies the related objects to include in the query results. |
| [IncludeMany][52] | Specifies which collections to include in the query results. |
| [LongCount()][53] | Returns an [Int64][54] that represents the total number of elements in the set. |
| [LongCount(OperatorStringHandler)][55] | Returns an [Int64][54] that represents how many elements in the set satisfy a condition. |
| [LongCount(String)][56] | Returns an [Int64][54] that represents how many elements in the set satisfy a condition. |
| [LongCountAsync(CancellationToken)][57] | Returns an [Int64][54] that represents the total number of elements in the set. |
| [LongCountAsync(OperatorStringHandler, CancellationToken)][58] | Returns an [Int64][54] that represents how many elements in the set satisfy a condition. |
| [LongCountAsync(String, CancellationToken)][59] | Returns an [Int64][54] that represents how many elements in the set satisfy a condition. |
| [OrderBy(OperatorStringHandler)][60] | Sorts the elements of the set according to the *columnList*. |
| [OrderBy(String)][61] | Sorts the elements of the set according to the *columnList*. |
| [Select(OperatorStringHandler)][62] | Projects each element of the set into a new form. |
| [Select(String)][63] | Projects each element of the set into a new form. |
| [Select(OperatorStringHandler, Type)][64] | Projects each element of the set into a new form. |
| [Select(String, Type)][65] | Projects each element of the set into a new form. |
| [Select<TResult>(OperatorStringHandler)][66] | Projects each element of the set into a new form. |
| [Select<TResult>(String)][67] | Projects each element of the set into a new form. |
| [Select<TResult>(OperatorStringHandler, Func<DbDataReader, TResult>)][68] | Projects each element of the set into a new form. |
| [Select<TResult>(String, Func<DbDataReader, TResult>)][69] | Projects each element of the set into a new form. |
| [Single()][70] | The single element of the set. |
| [Single(OperatorStringHandler)][71] | Returns the only element of the set that satisfies a specified condition, and throws an exception if more than one such element exists. |
| [Single(String)][72] | Returns the only element of the set that satisfies a specified condition, and throws an exception if more than one such element exists. |
| [SingleAsync(CancellationToken)][73] | The single element of the set. |
| [SingleAsync(OperatorStringHandler, CancellationToken)][74] | Returns the only element of the set that satisfies a specified condition, and throws an exception if more than one such element exists. |
| [SingleAsync(String, CancellationToken)][75] | Returns the only element of the set that satisfies a specified condition, and throws an exception if more than one such element exists. |
| [SingleOrDefault()][76] | Returns the only element of the set, or a default value if the set is empty; this method throws an exception if there is more than one element in the set. |
| [SingleOrDefault(OperatorStringHandler)][77] | Returns the only element of the set that satisfies a specified condition or a default value if no such element exists; this method throws an exception if more than one element satisfies the condition. |
| [SingleOrDefault(String)][78] | Returns the only element of the set that satisfies a specified condition or a default value if no such element exists; this method throws an exception if more than one element satisfies the condition. |
| [SingleOrDefaultAsync(CancellationToken)][79] | Returns the only element of the set, or a default value if the set is empty; this method throws an exception if there is more than one element in the set. |
| [SingleOrDefaultAsync(OperatorStringHandler, CancellationToken)][80] | Returns the only element of the set that satisfies a specified condition or a default value if no such element exists; this method throws an exception if more than one element satisfies the condition. |
| [SingleOrDefaultAsync(String, CancellationToken)][81] | Returns the only element of the set that satisfies a specified condition or a default value if no such element exists; this method throws an exception if more than one element satisfies the condition. |
| [Skip][82] | Bypasses a specified number of elements in the set and then returns the remaining elements. |
| [Take][83] | Returns a specified number of contiguous elements from the start of the set. |
| [ToArray][84] | Creates an array from the set. |
| [ToArrayAsync][85] | Creates an array from the set. |
| [ToList][86] | Creates a [List<T>][87] from the set. |
| [ToListAsync][88] | Creates a [List<T>][87] from the set. |
| [ToString][89] | Returns the SQL query of the set. (Overrides [Object.ToString()][90]) |
| [Where(OperatorStringHandler)][91] | Filters the set based on a predicate. |
| [Where(String)][92] | Filters the set based on a predicate. |
Remarks
-------
For information on how to use SqlSet see [SqlSet Tutorial][93].
See Also
--------
#### Reference
[DbExtensions Namespace][6]
[1]: ../Database/From.md
[2]: ../Database/FromQuery.md
[3]: https://learn.microsoft.com/dotnet/api/system.object
[4]: ../SqlSet_1/README.md
[5]: ../SqlTable/README.md
[6]: ../README.md
[7]: Database.md
[8]: ../Database/README.md
[9]: ResultType.md
[10]: All.md
[11]: All_1.md
[12]: AllAsync.md
[13]: AllAsync_1.md
[14]: Any.md
[15]: Any_1.md
[16]: Any_2.md
[17]: AnyAsync_2.md
[18]: AnyAsync.md
[19]: AnyAsync_1.md
[20]: AsAsyncEnumerable.md
[21]: AsEnumerable.md
[22]: Cast.md
[23]: Cast__1.md
[24]: Contains.md
[25]: ContainsAsync.md
[26]: ContainsKey.md
[27]: ContainsKeyAsync.md
[28]: Count.md
[29]: Count_1.md
[30]: Count_2.md
[31]: CountAsync_2.md
[32]: CountAsync.md
[33]: CountAsync_1.md
[34]: Find.md
[35]: FindAsync.md
[36]: First.md
[37]: First_1.md
[38]: First_2.md
[39]: FirstAsync_2.md
[40]: FirstAsync.md
[41]: FirstAsync_1.md
[42]: FirstOrDefault.md
[43]: FirstOrDefault_1.md
[44]: FirstOrDefault_2.md
[45]: FirstOrDefaultAsync_2.md
[46]: FirstOrDefaultAsync.md
[47]: FirstOrDefaultAsync_1.md
[48]: GetAsyncEnumerator.md
[49]: GetDefiningQuery.md
[50]: GetEnumerator.md
[51]: Include.md
[52]: IncludeMany.md
[53]: LongCount.md
[54]: https://learn.microsoft.com/dotnet/api/system.int64
[55]: LongCount_1.md
[56]: LongCount_2.md
[57]: LongCountAsync_2.md
[58]: LongCountAsync.md
[59]: LongCountAsync_1.md
[60]: OrderBy.md
[61]: OrderBy_1.md
[62]: Select.md
[63]: Select_2.md
[64]: Select_1.md
[65]: Select_3.md
[66]: Select__1.md
[67]: Select__1_2.md
[68]: Select__1_1.md
[69]: Select__1_3.md
[70]: Single.md
[71]: Single_1.md
[72]: Single_2.md
[73]: SingleAsync_2.md
[74]: SingleAsync.md
[75]: SingleAsync_1.md
[76]: SingleOrDefault.md
[77]: SingleOrDefault_1.md
[78]: SingleOrDefault_2.md
[79]: SingleOrDefaultAsync_2.md
[80]: SingleOrDefaultAsync.md
[81]: SingleOrDefaultAsync_1.md
[82]: Skip.md
[83]: Take.md
[84]: ToArray.md
[85]: ToArrayAsync.md
[86]: ToList.md
[87]: https://learn.microsoft.com/dotnet/api/system.collections.generic.list-1
[88]: ToListAsync.md
[89]: ToString.md
[90]: https://learn.microsoft.com/dotnet/api/system.object.tostring
[91]: Where.md
[92]: Where_1.md
[93]: https://maxtoroq.github.io/DbExtensions/docs/7/SqlSet.html
================================================
FILE: docs/api/DbExtensions/SqlSet/ResultType.md
================================================
SqlSet.ResultType Property
==========================
The type of objects this set returns. This property can be null.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public Type? ResultType { get; }
```
#### Property Value
[Type][2]
See Also
--------
#### Reference
[SqlSet Class][3]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: https://learn.microsoft.com/dotnet/api/system.type
[3]: README.md
================================================
FILE: docs/api/DbExtensions/SqlSet/Select.md
================================================
SqlSet.Select(SqlSet.OperatorStringHandler) Method
==================================================
Projects each element of the set into a new form.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ------------------------------------------------------------------------------ | ------------------------------------------------- |
| **Select(OperatorStringHandler)** | Projects each element of the set into a new form. |
| [Select(String)][2] | Projects each element of the set into a new form. |
| [Select(OperatorStringHandler, Type)][3] | Projects each element of the set into a new form. |
| [Select(String, Type)][4] | Projects each element of the set into a new form. |
| [Select<TResult>(OperatorStringHandler)][5] | Projects each element of the set into a new form. |
| [Select<TResult>(String)][6] | Projects each element of the set into a new form. |
| [Select<TResult>(OperatorStringHandler, Func<DbDataReader, TResult>)][7] | Projects each element of the set into a new form. |
| [Select<TResult>(String, Func<DbDataReader, TResult>)][8] | Projects each element of the set into a new form. |
Syntax
------
```csharp
public SqlSet Select(
ref OperatorStringHandler columnList
)
```
#### Parameters
##### *columnList* OperatorStringHandler
The list of columns to select.
#### Return Value
[SqlSet][9]
A new [SqlSet][9].
See Also
--------
#### Reference
[SqlSet Class][9]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: Select_2.md
[3]: Select_1.md
[4]: Select_3.md
[5]: Select__1.md
[6]: Select__1_2.md
[7]: Select__1_1.md
[8]: Select__1_3.md
[9]: README.md
================================================
FILE: docs/api/DbExtensions/SqlSet/Select_1.md
================================================
SqlSet.Select(SqlSet.OperatorStringHandler, Type) Method
========================================================
Projects each element of the set into a new form.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ------------------------------------------------------------------------------ | ------------------------------------------------- |
| [Select(OperatorStringHandler)][2] | Projects each element of the set into a new form. |
| [Select(String)][3] | Projects each element of the set into a new form. |
| **Select(OperatorStringHandler, Type)** | Projects each element of the set into a new form. |
| [Select(String, Type)][4] | Projects each element of the set into a new form. |
| [Select<TResult>(OperatorStringHandler)][5] | Projects each element of the set into a new form. |
| [Select<TResult>(String)][6] | Projects each element of the set into a new form. |
| [Select<TResult>(OperatorStringHandler, Func<DbDataReader, TResult>)][7] | Projects each element of the set into a new form. |
| [Select<TResult>(String, Func<DbDataReader, TResult>)][8] | Projects each element of the set into a new form. |
Syntax
------
```csharp
public SqlSet Select(
ref OperatorStringHandler columnList,
Type resultType
)
```
#### Parameters
##### *columnList* OperatorStringHandler
The list of columns that maps to properties on *resultType*.
##### *resultType* [Type][9]
The type that *columnList* maps to.
#### Return Value
[SqlSet][10]
A new [SqlSet][10].
See Also
--------
#### Reference
[SqlSet Class][10]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: Select.md
[3]: Select_2.md
[4]: Select_3.md
[5]: Select__1.md
[6]: Select__1_2.md
[7]: Select__1_1.md
[8]: Select__1_3.md
[9]: https://learn.microsoft.com/dotnet/api/system.type
[10]: README.md
================================================
FILE: docs/api/DbExtensions/SqlSet/Select_2.md
================================================
SqlSet.Select(String) Method
============================
Projects each element of the set into a new form.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ------------------------------------------------------------------------------ | ------------------------------------------------- |
| [Select(OperatorStringHandler)][2] | Projects each element of the set into a new form. |
| **Select(String)** | Projects each element of the set into a new form. |
| [Select(OperatorStringHandler, Type)][3] | Projects each element of the set into a new form. |
| [Select(String, Type)][4] | Projects each element of the set into a new form. |
| [Select<TResult>(OperatorStringHandler)][5] | Projects each element of the set into a new form. |
| [Select<TResult>(String)][6] | Projects each element of the set into a new form. |
| [Select<TResult>(OperatorStringHandler, Func<DbDataReader, TResult>)][7] | Projects each element of the set into a new form. |
| [Select<TResult>(String, Func<DbDataReader, TResult>)][8] | Projects each element of the set into a new form. |
Syntax
------
```csharp
public SqlSet Select(
string columnList
)
```
#### Parameters
##### *columnList* [String][9]
The list of columns to select.
#### Return Value
[SqlSet][10]
A new [SqlSet][10].
See Also
--------
#### Reference
[SqlSet Class][10]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: Select.md
[3]: Select_1.md
[4]: Select_3.md
[5]: Select__1.md
[6]: Select__1_2.md
[7]: Select__1_1.md
[8]: Select__1_3.md
[9]: https://learn.microsoft.com/dotnet/api/system.string
[10]: README.md
================================================
FILE: docs/api/DbExtensions/SqlSet/Select_3.md
================================================
SqlSet.Select(String, Type) Method
==================================
Projects each element of the set into a new form.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ------------------------------------------------------------------------------ | ------------------------------------------------- |
| [Select(OperatorStringHandler)][2] | Projects each element of the set into a new form. |
| [Select(String)][3] | Projects each element of the set into a new form. |
| [Select(OperatorStringHandler, Type)][4] | Projects each element of the set into a new form. |
| **Select(String, Type)** | Projects each element of the set into a new form. |
| [Select<TResult>(OperatorStringHandler)][5] | Projects each element of the set into a new form. |
| [Select<TResult>(String)][6] | Projects each element of the set into a new form. |
| [Select<TResult>(OperatorStringHandler, Func<DbDataReader, TResult>)][7] | Projects each element of the set into a new form. |
| [Select<TResult>(String, Func<DbDataReader, TResult>)][8] | Projects each element of the set into a new form. |
Syntax
------
```csharp
public SqlSet Select(
string columnList,
Type resultType
)
```
#### Parameters
##### *columnList* [String][9]
The list of columns that maps to properties on *resultType*.
##### *resultType* [Type][10]
The type that *columnList* maps to.
#### Return Value
[SqlSet][11]
A new [SqlSet][11].
See Also
--------
#### Reference
[SqlSet Class][11]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: Select.md
[3]: Select_2.md
[4]: Select_1.md
[5]: Select__1.md
[6]: Select__1_2.md
[7]: Select__1_1.md
[8]: Select__1_3.md
[9]: https://learn.microsoft.com/dotnet/api/system.string
[10]: https://learn.microsoft.com/dotnet/api/system.type
[11]: README.md
================================================
FILE: docs/api/DbExtensions/SqlSet/Select__1.md
================================================
SqlSet.Select<TResult>(SqlSet.OperatorStringHandler) Method
==============================================================
Projects each element of the set into a new form.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ------------------------------------------------------------------------------ | ------------------------------------------------- |
| [Select(OperatorStringHandler)][2] | Projects each element of the set into a new form. |
| [Select(String)][3] | Projects each element of the set into a new form. |
| [Select(OperatorStringHandler, Type)][4] | Projects each element of the set into a new form. |
| [Select(String, Type)][5] | Projects each element of the set into a new form. |
| **Select<TResult>(OperatorStringHandler)** | Projects each element of the set into a new form. |
| [Select<TResult>(String)][6] | Projects each element of the set into a new form. |
| [Select<TResult>(OperatorStringHandler, Func<DbDataReader, TResult>)][7] | Projects each element of the set into a new form. |
| [Select<TResult>(String, Func<DbDataReader, TResult>)][8] | Projects each element of the set into a new form. |
Syntax
------
```csharp
public SqlSet Select(
ref OperatorStringHandler columnList
)
```
#### Parameters
##### *columnList* OperatorStringHandler
The list of columns that maps to properties on TResult.
#### Type Parameters
##### *TResult*
The type that *columnList* maps to.
#### Return Value
[SqlSet][9]<**TResult**>
A new [SqlSet<TResult>][9].
See Also
--------
#### Reference
[SqlSet Class][10]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: Select.md
[3]: Select_2.md
[4]: Select_1.md
[5]: Select_3.md
[6]: Select__1_2.md
[7]: Select__1_1.md
[8]: Select__1_3.md
[9]: ../SqlSet_1/README.md
[10]: README.md
================================================
FILE: docs/api/DbExtensions/SqlSet/Select__1_1.md
================================================
SqlSet.Select<TResult>(SqlSet.OperatorStringHandler, Func<DbDataReader, TResult>) Method
==============================================================================================
Projects each element of the set into a new form.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ----------------------------------------------------------------------------- | ------------------------------------------------- |
| [Select(OperatorStringHandler)][2] | Projects each element of the set into a new form. |
| [Select(String)][3] | Projects each element of the set into a new form. |
| [Select(OperatorStringHandler, Type)][4] | Projects each element of the set into a new form. |
| [Select(String, Type)][5] | Projects each element of the set into a new form. |
| [Select<TResult>(OperatorStringHandler)][6] | Projects each element of the set into a new form. |
| [Select<TResult>(String)][7] | Projects each element of the set into a new form. |
| **Select<TResult>(OperatorStringHandler, Func<DbDataReader, TResult>)** | Projects each element of the set into a new form. |
| [Select<TResult>(String, Func<DbDataReader, TResult>)][8] | Projects each element of the set into a new form. |
Syntax
------
```csharp
public SqlSet Select(
ref OperatorStringHandler columnList,
Func mapper
)
```
#### Parameters
##### *columnList* OperatorStringHandler
The list of columns that are used by *mapper*.
##### *mapper* [Func][9]<[DbDataReader][10], **TResult**>
A custom mapper function that creates TResult instances from the rows in the set.
#### Type Parameters
##### *TResult*
The type that *mapper* returns.
#### Return Value
[SqlSet][11]<**TResult**>
A new [SqlSet<TResult>][11].
See Also
--------
#### Reference
[SqlSet Class][12]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: Select.md
[3]: Select_2.md
[4]: Select_1.md
[5]: Select_3.md
[6]: Select__1.md
[7]: Select__1_2.md
[8]: Select__1_3.md
[9]: https://learn.microsoft.com/dotnet/api/system.func-2
[10]: https://learn.microsoft.com/dotnet/api/system.data.common.dbdatareader
[11]: ../SqlSet_1/README.md
[12]: README.md
================================================
FILE: docs/api/DbExtensions/SqlSet/Select__1_2.md
================================================
SqlSet.Select<TResult>(String) Method
========================================
Projects each element of the set into a new form.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ------------------------------------------------------------------------------ | ------------------------------------------------- |
| [Select(OperatorStringHandler)][2] | Projects each element of the set into a new form. |
| [Select(String)][3] | Projects each element of the set into a new form. |
| [Select(OperatorStringHandler, Type)][4] | Projects each element of the set into a new form. |
| [Select(String, Type)][5] | Projects each element of the set into a new form. |
| [Select<TResult>(OperatorStringHandler)][6] | Projects each element of the set into a new form. |
| **Select<TResult>(String)** | Projects each element of the set into a new form. |
| [Select<TResult>(OperatorStringHandler, Func<DbDataReader, TResult>)][7] | Projects each element of the set into a new form. |
| [Select<TResult>(String, Func<DbDataReader, TResult>)][8] | Projects each element of the set into a new form. |
Syntax
------
```csharp
public SqlSet Select(
string columnList
)
```
#### Parameters
##### *columnList* [String][9]
The list of columns that maps to properties on TResult.
#### Type Parameters
##### *TResult*
The type that *columnList* maps to.
#### Return Value
[SqlSet][10]<**TResult**>
A new [SqlSet<TResult>][10].
See Also
--------
#### Reference
[SqlSet Class][11]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: Select.md
[3]: Select_2.md
[4]: Select_1.md
[5]: Select_3.md
[6]: Select__1.md
[7]: Select__1_1.md
[8]: Select__1_3.md
[9]: https://learn.microsoft.com/dotnet/api/system.string
[10]: ../SqlSet_1/README.md
[11]: README.md
================================================
FILE: docs/api/DbExtensions/SqlSet/Select__1_3.md
================================================
SqlSet.Select<TResult>(String, Func<DbDataReader, TResult>) Method
========================================================================
Projects each element of the set into a new form.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ------------------------------------------------------------------------------ | ------------------------------------------------- |
| [Select(OperatorStringHandler)][2] | Projects each element of the set into a new form. |
| [Select(String)][3] | Projects each element of the set into a new form. |
| [Select(OperatorStringHandler, Type)][4] | Projects each element of the set into a new form. |
| [Select(String, Type)][5] | Projects each element of the set into a new form. |
| [Select<TResult>(OperatorStringHandler)][6] | Projects each element of the set into a new form. |
| [Select<TResult>(String)][7] | Projects each element of the set into a new form. |
| [Select<TResult>(OperatorStringHandler, Func<DbDataReader, TResult>)][8] | Projects each element of the set into a new form. |
| **Select<TResult>(String, Func<DbDataReader, TResult>)** | Projects each element of the set into a new form. |
Syntax
------
```csharp
public SqlSet Select(
string columnList,
Func mapper
)
```
#### Parameters
##### *columnList* [String][9]
The list of columns that are used by *mapper*.
##### *mapper* [Func][10]<[DbDataReader][11], **TResult**>
A custom mapper function that creates TResult instances from the rows in the set.
#### Type Parameters
##### *TResult*
The type that *mapper* returns.
#### Return Value
[SqlSet][12]<**TResult**>
A new [SqlSet<TResult>][12].
See Also
--------
#### Reference
[SqlSet Class][13]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: Select.md
[3]: Select_2.md
[4]: Select_1.md
[5]: Select_3.md
[6]: Select__1.md
[7]: Select__1_2.md
[8]: Select__1_1.md
[9]: https://learn.microsoft.com/dotnet/api/system.string
[10]: https://learn.microsoft.com/dotnet/api/system.func-2
[11]: https://learn.microsoft.com/dotnet/api/system.data.common.dbdatareader
[12]: ../SqlSet_1/README.md
[13]: README.md
================================================
FILE: docs/api/DbExtensions/SqlSet/Single.md
================================================
SqlSet.Single Method
====================
The single element of the set.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ---------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
| **Single()** | The single element of the set. |
| [Single(OperatorStringHandler)][2] | Returns the only element of the set that satisfies a specified condition, and throws an exception if more than one such element exists. |
| [Single(String)][3] | Returns the only element of the set that satisfies a specified condition, and throws an exception if more than one such element exists. |
Syntax
------
```csharp
public Object Single()
```
#### Return Value
[Object][4]
The single element of the set.
Exceptions
----------
| Exception | Condition |
| ------------------------------ | ------------------------------------------------------------ |
| [InvalidOperationException][5] | The set contains more than one element.-or-The set is empty. |
See Also
--------
#### Reference
[SqlSet Class][6]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: Single_1.md
[3]: Single_2.md
[4]: https://learn.microsoft.com/dotnet/api/system.object
[5]: https://learn.microsoft.com/dotnet/api/system.invalidoperationexception
[6]: README.md
================================================
FILE: docs/api/DbExtensions/SqlSet/SingleAsync.md
================================================
SqlSet.SingleAsync(SqlSet.OperatorStringHandler, CancellationToken) Method
==========================================================================
Returns the only element of the set that satisfies a specified condition, and throws an exception if more than one such element exists.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| --------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
| [SingleAsync(CancellationToken)][2] | The single element of the set. |
| **SingleAsync(OperatorStringHandler, CancellationToken)** | Returns the only element of the set that satisfies a specified condition, and throws an exception if more than one such element exists. |
| [SingleAsync(String, CancellationToken)][3] | Returns the only element of the set that satisfies a specified condition, and throws an exception if more than one such element exists. |
Syntax
------
```csharp
public ValueTask SingleAsync(
OperatorStringHandler predicate,
CancellationToken cancellationToken = default
)
```
#### Parameters
##### *predicate* OperatorStringHandler
A SQL expression to test each row for a condition.
##### *cancellationToken* [CancellationToken][4] (Optional)
The [CancellationToken][4] to monitor for cancellation requests. The default is [None][5].
#### Return Value
[ValueTask][6]<[Object][7]>
The single element of the set that passes the test in the specified *predicate*.
Exceptions
----------
| Exception | Condition |
| ------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------- |
| [InvalidOperationException][8] | No element satisfies the condition in *predicate*.-or-More than one element satisfies the condition in *predicate*.-or-The set is empty. |
See Also
--------
#### Reference
[SqlSet Class][9]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: SingleAsync_2.md
[3]: SingleAsync_1.md
[4]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken
[5]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken.none
[6]: https://learn.microsoft.com/dotnet/api/system.threading.tasks.valuetask-1
[7]: https://learn.microsoft.com/dotnet/api/system.object
[8]: https://learn.microsoft.com/dotnet/api/system.invalidoperationexception
[9]: README.md
================================================
FILE: docs/api/DbExtensions/SqlSet/SingleAsync_1.md
================================================
SqlSet.SingleAsync(String, CancellationToken) Method
====================================================
Returns the only element of the set that satisfies a specified condition, and throws an exception if more than one such element exists.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ---------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
| [SingleAsync(CancellationToken)][2] | The single element of the set. |
| [SingleAsync(OperatorStringHandler, CancellationToken)][3] | Returns the only element of the set that satisfies a specified condition, and throws an exception if more than one such element exists. |
| **SingleAsync(String, CancellationToken)** | Returns the only element of the set that satisfies a specified condition, and throws an exception if more than one such element exists. |
Syntax
------
```csharp
public ValueTask SingleAsync(
string predicate,
CancellationToken cancellationToken = default
)
```
#### Parameters
##### *predicate* [String][4]
A SQL expression to test each row for a condition.
##### *cancellationToken* [CancellationToken][5] (Optional)
The [CancellationToken][5] to monitor for cancellation requests. The default is [None][6].
#### Return Value
[ValueTask][7]<[Object][8]>
The single element of the set that passes the test in the specified *predicate*.
Exceptions
----------
| Exception | Condition |
| ------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------- |
| [InvalidOperationException][9] | No element satisfies the condition in *predicate*.-or-More than one element satisfies the condition in *predicate*.-or-The set is empty. |
See Also
--------
#### Reference
[SqlSet Class][10]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: SingleAsync_2.md
[3]: SingleAsync.md
[4]: https://learn.microsoft.com/dotnet/api/system.string
[5]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken
[6]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken.none
[7]: https://learn.microsoft.com/dotnet/api/system.threading.tasks.valuetask-1
[8]: https://learn.microsoft.com/dotnet/api/system.object
[9]: https://learn.microsoft.com/dotnet/api/system.invalidoperationexception
[10]: README.md
================================================
FILE: docs/api/DbExtensions/SqlSet/SingleAsync_2.md
================================================
SqlSet.SingleAsync(CancellationToken) Method
============================================
The single element of the set.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ---------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
| **SingleAsync(CancellationToken)** | The single element of the set. |
| [SingleAsync(OperatorStringHandler, CancellationToken)][2] | Returns the only element of the set that satisfies a specified condition, and throws an exception if more than one such element exists. |
| [SingleAsync(String, CancellationToken)][3] | Returns the only element of the set that satisfies a specified condition, and throws an exception if more than one such element exists. |
Syntax
------
```csharp
public ValueTask SingleAsync(
CancellationToken cancellationToken = default
)
```
#### Parameters
##### *cancellationToken* [CancellationToken][4] (Optional)
The [CancellationToken][4] to monitor for cancellation requests. The default is [None][5].
#### Return Value
[ValueTask][6]<[Object][7]>
The single element of the set.
Exceptions
----------
| Exception | Condition |
| ------------------------------ | ------------------------------------------------------------ |
| [InvalidOperationException][8] | The set contains more than one element.-or-The set is empty. |
See Also
--------
#### Reference
[SqlSet Class][9]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: SingleAsync.md
[3]: SingleAsync_1.md
[4]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken
[5]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken.none
[6]: https://learn.microsoft.com/dotnet/api/system.threading.tasks.valuetask-1
[7]: https://learn.microsoft.com/dotnet/api/system.object
[8]: https://learn.microsoft.com/dotnet/api/system.invalidoperationexception
[9]: README.md
================================================
FILE: docs/api/DbExtensions/SqlSet/SingleOrDefault.md
================================================
SqlSet.SingleOrDefault Method
=============================
Returns the only element of the set, or a default value if the set is empty; this method throws an exception if there is more than one element in the set.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **SingleOrDefault()** | Returns the only element of the set, or a default value if the set is empty; this method throws an exception if there is more than one element in the set. |
| [SingleOrDefault(OperatorStringHandler)][2] | Returns the only element of the set that satisfies a specified condition or a default value if no such element exists; this method throws an exception if more than one element satisfies the condition. |
| [SingleOrDefault(String)][3] | Returns the only element of the set that satisfies a specified condition or a default value if no such element exists; this method throws an exception if more than one element satisfies the condition. |
Syntax
------
```csharp
public Object? SingleOrDefault()
```
#### Return Value
[Object][4]
The single element of the set, or a default value if the set contains no elements.
Exceptions
----------
| Exception | Condition |
| ------------------------------ | --------------------------------------- |
| [InvalidOperationException][5] | The set contains more than one element. |
See Also
--------
#### Reference
[SqlSet Class][6]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: SingleOrDefault_1.md
[3]: SingleOrDefault_2.md
[4]: https://learn.microsoft.com/dotnet/api/system.object
[5]: https://learn.microsoft.com/dotnet/api/system.invalidoperationexception
[6]: README.md
================================================
FILE: docs/api/DbExtensions/SqlSet/SingleOrDefaultAsync.md
================================================
SqlSet.SingleOrDefaultAsync(SqlSet.OperatorStringHandler, CancellationToken) Method
===================================================================================
Returns the only element of the set that satisfies a specified condition or a default value if no such element exists; this method throws an exception if more than one element satisfies the condition.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [SingleOrDefaultAsync(CancellationToken)][2] | Returns the only element of the set, or a default value if the set is empty; this method throws an exception if there is more than one element in the set. |
| **SingleOrDefaultAsync(OperatorStringHandler, CancellationToken)** | Returns the only element of the set that satisfies a specified condition or a default value if no such element exists; this method throws an exception if more than one element satisfies the condition. |
| [SingleOrDefaultAsync(String, CancellationToken)][3] | Returns the only element of the set that satisfies a specified condition or a default value if no such element exists; this method throws an exception if more than one element satisfies the condition. |
Syntax
------
```csharp
public ValueTask SingleOrDefaultAsync(
OperatorStringHandler predicate,
CancellationToken cancellationToken = default
)
```
#### Parameters
##### *predicate* OperatorStringHandler
A SQL expression to test each row for a condition.
##### *cancellationToken* [CancellationToken][4] (Optional)
The [CancellationToken][4] to monitor for cancellation requests. The default is [None][5].
#### Return Value
[ValueTask][6]<[Object][7]>
The single element of the set that satisfies the condition, or a default value if no such element is found.
See Also
--------
#### Reference
[SqlSet Class][8]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: SingleOrDefaultAsync_2.md
[3]: SingleOrDefaultAsync_1.md
[4]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken
[5]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken.none
[6]: https://learn.microsoft.com/dotnet/api/system.threading.tasks.valuetask-1
[7]: https://learn.microsoft.com/dotnet/api/system.object
[8]: README.md
================================================
FILE: docs/api/DbExtensions/SqlSet/SingleOrDefaultAsync_1.md
================================================
SqlSet.SingleOrDefaultAsync(String, CancellationToken) Method
=============================================================
Returns the only element of the set that satisfies a specified condition or a default value if no such element exists; this method throws an exception if more than one element satisfies the condition.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [SingleOrDefaultAsync(CancellationToken)][2] | Returns the only element of the set, or a default value if the set is empty; this method throws an exception if there is more than one element in the set. |
| [SingleOrDefaultAsync(OperatorStringHandler, CancellationToken)][3] | Returns the only element of the set that satisfies a specified condition or a default value if no such element exists; this method throws an exception if more than one element satisfies the condition. |
| **SingleOrDefaultAsync(String, CancellationToken)** | Returns the only element of the set that satisfies a specified condition or a default value if no such element exists; this method throws an exception if more than one element satisfies the condition. |
Syntax
------
```csharp
public ValueTask SingleOrDefaultAsync(
string predicate,
CancellationToken cancellationToken = default
)
```
#### Parameters
##### *predicate* [String][4]
A SQL expression to test each row for a condition.
##### *cancellationToken* [CancellationToken][5] (Optional)
The [CancellationToken][5] to monitor for cancellation requests. The default is [None][6].
#### Return Value
[ValueTask][7]<[Object][8]>
The single element of the set that satisfies the condition, or a default value if no such element is found.
See Also
--------
#### Reference
[SqlSet Class][9]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: SingleOrDefaultAsync_2.md
[3]: SingleOrDefaultAsync.md
[4]: https://learn.microsoft.com/dotnet/api/system.string
[5]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken
[6]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken.none
[7]: https://learn.microsoft.com/dotnet/api/system.threading.tasks.valuetask-1
[8]: https://learn.microsoft.com/dotnet/api/system.object
[9]: README.md
================================================
FILE: docs/api/DbExtensions/SqlSet/SingleOrDefaultAsync_2.md
================================================
SqlSet.SingleOrDefaultAsync(CancellationToken) Method
=====================================================
Returns the only element of the set, or a default value if the set is empty; this method throws an exception if there is more than one element in the set.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **SingleOrDefaultAsync(CancellationToken)** | Returns the only element of the set, or a default value if the set is empty; this method throws an exception if there is more than one element in the set. |
| [SingleOrDefaultAsync(OperatorStringHandler, CancellationToken)][2] | Returns the only element of the set that satisfies a specified condition or a default value if no such element exists; this method throws an exception if more than one element satisfies the condition. |
| [SingleOrDefaultAsync(String, CancellationToken)][3] | Returns the only element of the set that satisfies a specified condition or a default value if no such element exists; this method throws an exception if more than one element satisfies the condition. |
Syntax
------
```csharp
public ValueTask SingleOrDefaultAsync(
CancellationToken cancellationToken = default
)
```
#### Parameters
##### *cancellationToken* [CancellationToken][4] (Optional)
The [CancellationToken][4] to monitor for cancellation requests. The default is [None][5].
#### Return Value
[ValueTask][6]<[Object][7]>
The single element of the set, or a default value if the set contains no elements.
Exceptions
----------
| Exception | Condition |
| ------------------------------ | --------------------------------------- |
| [InvalidOperationException][8] | The set contains more than one element. |
See Also
--------
#### Reference
[SqlSet Class][9]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: SingleOrDefaultAsync.md
[3]: SingleOrDefaultAsync_1.md
[4]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken
[5]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken.none
[6]: https://learn.microsoft.com/dotnet/api/system.threading.tasks.valuetask-1
[7]: https://learn.microsoft.com/dotnet/api/system.object
[8]: https://learn.microsoft.com/dotnet/api/system.invalidoperationexception
[9]: README.md
================================================
FILE: docs/api/DbExtensions/SqlSet/SingleOrDefault_1.md
================================================
SqlSet.SingleOrDefault(SqlSet.OperatorStringHandler) Method
===========================================================
Returns the only element of the set that satisfies a specified condition or a default value if no such element exists; this method throws an exception if more than one element satisfies the condition.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [SingleOrDefault()][2] | Returns the only element of the set, or a default value if the set is empty; this method throws an exception if there is more than one element in the set. |
| **SingleOrDefault(OperatorStringHandler)** | Returns the only element of the set that satisfies a specified condition or a default value if no such element exists; this method throws an exception if more than one element satisfies the condition. |
| [SingleOrDefault(String)][3] | Returns the only element of the set that satisfies a specified condition or a default value if no such element exists; this method throws an exception if more than one element satisfies the condition. |
Syntax
------
```csharp
public Object? SingleOrDefault(
ref OperatorStringHandler? predicate
)
```
#### Parameters
##### *predicate* OperatorStringHandler
A SQL expression to test each row for a condition.
#### Return Value
[Object][4]
The single element of the set that satisfies the condition, or a default value if no such element is found.
See Also
--------
#### Reference
[SqlSet Class][5]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: SingleOrDefault.md
[3]: SingleOrDefault_2.md
[4]: https://learn.microsoft.com/dotnet/api/system.object
[5]: README.md
================================================
FILE: docs/api/DbExtensions/SqlSet/SingleOrDefault_2.md
================================================
SqlSet.SingleOrDefault(String) Method
=====================================
Returns the only element of the set that satisfies a specified condition or a default value if no such element exists; this method throws an exception if more than one element satisfies the condition.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [SingleOrDefault()][2] | Returns the only element of the set, or a default value if the set is empty; this method throws an exception if there is more than one element in the set. |
| [SingleOrDefault(OperatorStringHandler)][3] | Returns the only element of the set that satisfies a specified condition or a default value if no such element exists; this method throws an exception if more than one element satisfies the condition. |
| **SingleOrDefault(String)** | Returns the only element of the set that satisfies a specified condition or a default value if no such element exists; this method throws an exception if more than one element satisfies the condition. |
Syntax
------
```csharp
public Object? SingleOrDefault(
string predicate
)
```
#### Parameters
##### *predicate* [String][4]
A SQL expression to test each row for a condition.
#### Return Value
[Object][5]
The single element of the set that satisfies the condition, or a default value if no such element is found.
See Also
--------
#### Reference
[SqlSet Class][6]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: SingleOrDefault.md
[3]: SingleOrDefault_1.md
[4]: https://learn.microsoft.com/dotnet/api/system.string
[5]: https://learn.microsoft.com/dotnet/api/system.object
[6]: README.md
================================================
FILE: docs/api/DbExtensions/SqlSet/Single_1.md
================================================
SqlSet.Single(SqlSet.OperatorStringHandler) Method
==================================================
Returns the only element of the set that satisfies a specified condition, and throws an exception if more than one such element exists.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
| [Single()][2] | The single element of the set. |
| **Single(OperatorStringHandler)** | Returns the only element of the set that satisfies a specified condition, and throws an exception if more than one such element exists. |
| [Single(String)][3] | Returns the only element of the set that satisfies a specified condition, and throws an exception if more than one such element exists. |
Syntax
------
```csharp
public Object Single(
ref OperatorStringHandler predicate
)
```
#### Parameters
##### *predicate* OperatorStringHandler
A SQL expression to test each row for a condition.
#### Return Value
[Object][4]
The single element of the set that passes the test in the specified *predicate*.
Exceptions
----------
| Exception | Condition |
| ------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------- |
| [InvalidOperationException][5] | No element satisfies the condition in *predicate*.-or-More than one element satisfies the condition in *predicate*.-or-The set is empty. |
See Also
--------
#### Reference
[SqlSet Class][6]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: Single.md
[3]: Single_2.md
[4]: https://learn.microsoft.com/dotnet/api/system.object
[5]: https://learn.microsoft.com/dotnet/api/system.invalidoperationexception
[6]: README.md
================================================
FILE: docs/api/DbExtensions/SqlSet/Single_2.md
================================================
SqlSet.Single(String) Method
============================
Returns the only element of the set that satisfies a specified condition, and throws an exception if more than one such element exists.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ---------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
| [Single()][2] | The single element of the set. |
| [Single(OperatorStringHandler)][3] | Returns the only element of the set that satisfies a specified condition, and throws an exception if more than one such element exists. |
| **Single(String)** | Returns the only element of the set that satisfies a specified condition, and throws an exception if more than one such element exists. |
Syntax
------
```csharp
public Object Single(
string predicate
)
```
#### Parameters
##### *predicate* [String][4]
A SQL expression to test each row for a condition.
#### Return Value
[Object][5]
The single element of the set that passes the test in the specified *predicate*.
Exceptions
----------
| Exception | Condition |
| ------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------- |
| [InvalidOperationException][6] | No element satisfies the condition in *predicate*.-or-More than one element satisfies the condition in *predicate*.-or-The set is empty. |
See Also
--------
#### Reference
[SqlSet Class][7]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: Single.md
[3]: Single_1.md
[4]: https://learn.microsoft.com/dotnet/api/system.string
[5]: https://learn.microsoft.com/dotnet/api/system.object
[6]: https://learn.microsoft.com/dotnet/api/system.invalidoperationexception
[7]: README.md
================================================
FILE: docs/api/DbExtensions/SqlSet/Skip.md
================================================
SqlSet.Skip Method
==================
Bypasses a specified number of elements in the set and then returns the remaining elements.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public SqlSet Skip(
int count
)
```
#### Parameters
##### *count* [Int32][2]
The number of elements to skip before returning the remaining elements.
#### Return Value
[SqlSet][3]
A new [SqlSet][3] that contains the elements that occur after the specified index in the current set.
See Also
--------
#### Reference
[SqlSet Class][3]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: https://learn.microsoft.com/dotnet/api/system.int32
[3]: README.md
================================================
FILE: docs/api/DbExtensions/SqlSet/Take.md
================================================
SqlSet.Take Method
==================
Returns a specified number of contiguous elements from the start of the set.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public SqlSet Take(
int count
)
```
#### Parameters
##### *count* [Int32][2]
The number of elements to return.
#### Return Value
[SqlSet][3]
A new [SqlSet][3] that contains the specified number of elements from the start of the current set.
See Also
--------
#### Reference
[SqlSet Class][3]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: https://learn.microsoft.com/dotnet/api/system.int32
[3]: README.md
================================================
FILE: docs/api/DbExtensions/SqlSet/ToArray.md
================================================
SqlSet.ToArray Method
=====================
Creates an array from the set.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public Object[] ToArray()
```
#### Return Value
[Object][2][]
An array that contains the elements from the set.
See Also
--------
#### Reference
[SqlSet Class][3]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: https://learn.microsoft.com/dotnet/api/system.object
[3]: README.md
================================================
FILE: docs/api/DbExtensions/SqlSet/ToArrayAsync.md
================================================
SqlSet.ToArrayAsync Method
==========================
Creates an array from the set.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public ValueTask ToArrayAsync(
CancellationToken cancellationToken = default
)
```
#### Parameters
##### *cancellationToken* [CancellationToken][2] (Optional)
The [CancellationToken][2] to monitor for cancellation requests. The default is [None][3].
#### Return Value
[ValueTask][4]<[Object][5][]>
An array that contains the elements from the set.
See Also
--------
#### Reference
[SqlSet Class][6]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken
[3]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken.none
[4]: https://learn.microsoft.com/dotnet/api/system.threading.tasks.valuetask-1
[5]: https://learn.microsoft.com/dotnet/api/system.object
[6]: README.md
================================================
FILE: docs/api/DbExtensions/SqlSet/ToList.md
================================================
SqlSet.ToList Method
====================
Creates a [List<T>][1] from the set.
**Namespace:** [DbExtensions][2]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public List ToList()
```
#### Return Value
[List][1]<[Object][3]>
A [List<T>][1] that contains elements from the set.
See Also
--------
#### Reference
[SqlSet Class][4]
[DbExtensions Namespace][2]
[1]: https://learn.microsoft.com/dotnet/api/system.collections.generic.list-1
[2]: ../README.md
[3]: https://learn.microsoft.com/dotnet/api/system.object
[4]: README.md
================================================
FILE: docs/api/DbExtensions/SqlSet/ToListAsync.md
================================================
SqlSet.ToListAsync Method
=========================
Creates a [List<T>][1] from the set.
**Namespace:** [DbExtensions][2]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public ValueTask> ToListAsync(
CancellationToken cancellationToken = default
)
```
#### Parameters
##### *cancellationToken* [CancellationToken][3] (Optional)
The [CancellationToken][3] to monitor for cancellation requests. The default is [None][4].
#### Return Value
[ValueTask][5]<[List][1]<[Object][6]>>
A [List<T>][1] that contains elements from the set.
See Also
--------
#### Reference
[SqlSet Class][7]
[DbExtensions Namespace][2]
[1]: https://learn.microsoft.com/dotnet/api/system.collections.generic.list-1
[2]: ../README.md
[3]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken
[4]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken.none
[5]: https://learn.microsoft.com/dotnet/api/system.threading.tasks.valuetask-1
[6]: https://learn.microsoft.com/dotnet/api/system.object
[7]: README.md
================================================
FILE: docs/api/DbExtensions/SqlSet/ToString.md
================================================
SqlSet.ToString Method
======================
Returns the SQL query of the set.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public override string ToString()
```
#### Return Value
[String][2]
The SQL query of the set.
See Also
--------
#### Reference
[SqlSet Class][3]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: https://learn.microsoft.com/dotnet/api/system.string
[3]: README.md
================================================
FILE: docs/api/DbExtensions/SqlSet/Where.md
================================================
SqlSet.Where(SqlSet.OperatorStringHandler) Method
=================================================
Filters the set based on a predicate.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| -------------------------------- | ------------------------------------- |
| **Where(OperatorStringHandler)** | Filters the set based on a predicate. |
| [Where(String)][2] | Filters the set based on a predicate. |
Syntax
------
```csharp
public SqlSet Where(
ref OperatorStringHandler predicate
)
```
#### Parameters
##### *predicate* OperatorStringHandler
A SQL expression to test each row for a condition.
#### Return Value
[SqlSet][3]
A new [SqlSet][3] that contains elements from the current set that satisfy the condition.
See Also
--------
#### Reference
[SqlSet Class][3]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: Where_1.md
[3]: README.md
================================================
FILE: docs/api/DbExtensions/SqlSet/Where_1.md
================================================
SqlSet.Where(String) Method
===========================
Filters the set based on a predicate.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| --------------------------------- | ------------------------------------- |
| [Where(OperatorStringHandler)][2] | Filters the set based on a predicate. |
| **Where(String)** | Filters the set based on a predicate. |
Syntax
------
```csharp
public SqlSet Where(
string predicate
)
```
#### Parameters
##### *predicate* [String][3]
A SQL expression to test each row for a condition.
#### Return Value
[SqlSet][4]
A new [SqlSet][4] that contains elements from the current set that satisfy the condition.
See Also
--------
#### Reference
[SqlSet Class][4]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: Where.md
[3]: https://learn.microsoft.com/dotnet/api/system.string
[4]: README.md
================================================
FILE: docs/api/DbExtensions/SqlSet_1/AsAsyncEnumerable.md
================================================
SqlSet<TResult>.AsAsyncEnumerable Method
===========================================
Gets all TResult objects in the set. The query is deferred-executed.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public IAsyncEnumerable AsAsyncEnumerable()
```
#### Return Value
[IAsyncEnumerable][2]<[TResult][3]>
All TResult objects in the set.
See Also
--------
#### Reference
[SqlSet<TResult> Class][3]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: https://learn.microsoft.com/dotnet/api/system.collections.generic.iasyncenumerable-1
[3]: README.md
================================================
FILE: docs/api/DbExtensions/SqlSet_1/AsEnumerable.md
================================================
SqlSet<TResult>.AsEnumerable Method
======================================
Gets all TResult objects in the set. The query is deferred-executed.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public IEnumerable AsEnumerable()
```
#### Return Value
[IEnumerable][2]<[TResult][3]>
All TResult objects in the set.
See Also
--------
#### Reference
[SqlSet<TResult> Class][3]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1
[3]: README.md
================================================
FILE: docs/api/DbExtensions/SqlSet_1/Contains.md
================================================
SqlSet<TResult>.Contains(TResult) Method
===========================================
Checks the existance of the *entity*, using the primary key value.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| --------------------- | ------------------------------------------------------------------ |
| [Contains(Object)][2] | Checks the existance of the *entity*, using the primary key value. |
| **Contains(TResult)** | Checks the existance of the *entity*, using the primary key value. |
Syntax
------
```csharp
public bool Contains(
TResult entity
)
```
#### Parameters
##### *entity* [TResult][3]
The entity whose existance is to be checked.
#### Return Value
[Boolean][4]
`true` if the primary key value exists in the database; otherwise, `false`.
Exceptions
----------
| Exception | Condition |
| ------------------------------ | --------------------------------------------------------------------------------- |
| [InvalidOperationException][5] | This method can only be used on sets where the result type is an annotated class. |
See Also
--------
#### Reference
[SqlSet<TResult> Class][3]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: ../SqlSet/Contains.md
[3]: README.md
[4]: https://learn.microsoft.com/dotnet/api/system.boolean
[5]: https://learn.microsoft.com/dotnet/api/system.invalidoperationexception
================================================
FILE: docs/api/DbExtensions/SqlSet_1/ContainsAsync.md
================================================
SqlSet<TResult>.ContainsAsync(TResult, CancellationToken) Method
===================================================================
Checks the existance of the *entity*, using the primary key value.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| --------------------------------------------- | ------------------------------------------------------------------ |
| [ContainsAsync(Object, CancellationToken)][2] | Checks the existance of the *entity*, using the primary key value. |
| **ContainsAsync(TResult, CancellationToken)** | Checks the existance of the *entity*, using the primary key value. |
Syntax
------
```csharp
public ValueTask ContainsAsync(
TResult entity,
CancellationToken cancellationToken = default
)
```
#### Parameters
##### *entity* [TResult][3]
The entity whose existance is to be checked.
##### *cancellationToken* [CancellationToken][4] (Optional)
The [CancellationToken][4] to monitor for cancellation requests. The default is [None][5].
#### Return Value
[ValueTask][6]<[Boolean][7]>
`true` if the primary key value exists in the database; otherwise, `false`.
Exceptions
----------
| Exception | Condition |
| ------------------------------ | --------------------------------------------------------------------------------- |
| [InvalidOperationException][8] | This method can only be used on sets where the result type is an annotated class. |
See Also
--------
#### Reference
[SqlSet<TResult> Class][3]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: ../SqlSet/ContainsAsync.md
[3]: README.md
[4]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken
[5]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken.none
[6]: https://learn.microsoft.com/dotnet/api/system.threading.tasks.valuetask-1
[7]: https://learn.microsoft.com/dotnet/api/system.boolean
[8]: https://learn.microsoft.com/dotnet/api/system.invalidoperationexception
================================================
FILE: docs/api/DbExtensions/SqlSet_1/Find.md
================================================
SqlSet<TResult>.Find Method
==============================
Gets the entity whose primary key matches the *id* parameter.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public TResult Find(
Object id
)
```
#### Parameters
##### *id* [Object][2]
The primary key value.
#### Return Value
[TResult][3]
The entity whose primary key matches the *id* parameter, or null if the *id* does not exist.
Exceptions
----------
| Exception | Condition |
| ------------------------------ | --------------------------------------------------------------------------------- |
| [InvalidOperationException][4] | This method can only be used on sets where the result type is an annotated class. |
See Also
--------
#### Reference
[SqlSet<TResult> Class][3]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: https://learn.microsoft.com/dotnet/api/system.object
[3]: README.md
[4]: https://learn.microsoft.com/dotnet/api/system.invalidoperationexception
================================================
FILE: docs/api/DbExtensions/SqlSet_1/FindAsync.md
================================================
SqlSet<TResult>.FindAsync Method
===================================
Gets the entity whose primary key matches the *id* parameter.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public ValueTask FindAsync(
Object id,
CancellationToken cancellationToken = default
)
```
#### Parameters
##### *id* [Object][2]
The primary key value.
##### *cancellationToken* [CancellationToken][3] (Optional)
The [CancellationToken][3] to monitor for cancellation requests. The default is [None][4].
#### Return Value
[ValueTask][5]<[TResult][6]>
The entity whose primary key matches the *id* parameter, or null if the *id* does not exist.
Exceptions
----------
| Exception | Condition |
| ------------------------------ | --------------------------------------------------------------------------------- |
| [InvalidOperationException][7] | This method can only be used on sets where the result type is an annotated class. |
See Also
--------
#### Reference
[SqlSet<TResult> Class][6]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: https://learn.microsoft.com/dotnet/api/system.object
[3]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken
[4]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken.none
[5]: https://learn.microsoft.com/dotnet/api/system.threading.tasks.valuetask-1
[6]: README.md
[7]: https://learn.microsoft.com/dotnet/api/system.invalidoperationexception
================================================
FILE: docs/api/DbExtensions/SqlSet_1/First.md
================================================
SqlSet<TResult>.First Method
===============================
Returns the first element of the set.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| --------------------------------- | -------------------------------------------------------------------------- |
| **First()** | Returns the first element of the set. |
| [First(OperatorStringHandler)][2] | Returns the first element in the set that satisfies a specified condition. |
| [First(String)][3] | Returns the first element in the set that satisfies a specified condition. |
Syntax
------
```csharp
public TResult First()
```
#### Return Value
[TResult][4]
The first element in the set.
Exceptions
----------
| Exception | Condition |
| ------------------------------ | ----------------- |
| [InvalidOperationException][5] | The set is empty. |
See Also
--------
#### Reference
[SqlSet<TResult> Class][4]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: First_1.md
[3]: First_2.md
[4]: README.md
[5]: https://learn.microsoft.com/dotnet/api/system.invalidoperationexception
================================================
FILE: docs/api/DbExtensions/SqlSet_1/FirstAsync.md
================================================
SqlSet<TResult>.FirstAsync(SqlSet.OperatorStringHandler, CancellationToken) Method
=====================================================================================
Returns the first element in the set that satisfies a specified condition.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| -------------------------------------------------------- | -------------------------------------------------------------------------- |
| [FirstAsync(CancellationToken)][2] | Returns the first element of the set. |
| **FirstAsync(OperatorStringHandler, CancellationToken)** | Returns the first element in the set that satisfies a specified condition. |
| [FirstAsync(String, CancellationToken)][3] | Returns the first element in the set that satisfies a specified condition. |
Syntax
------
```csharp
public ValueTask FirstAsync(
OperatorStringHandler predicate,
CancellationToken cancellationToken = default
)
```
#### Parameters
##### *predicate* OperatorStringHandler
A SQL expression to test each row for a condition.
##### *cancellationToken* [CancellationToken][4] (Optional)
The [CancellationToken][4] to monitor for cancellation requests. The default is [None][5].
#### Return Value
[ValueTask][6]<[TResult][7]>
The first element in the set that passes the test in the specified *predicate*.
Exceptions
----------
| Exception | Condition |
| ------------------------------ | ----------------------------------------------------------------------- |
| [InvalidOperationException][8] | No element satisfies the condition in *predicate*.-or-The set is empty. |
See Also
--------
#### Reference
[SqlSet<TResult> Class][7]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: FirstAsync_2.md
[3]: FirstAsync_1.md
[4]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken
[5]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken.none
[6]: https://learn.microsoft.com/dotnet/api/system.threading.tasks.valuetask-1
[7]: README.md
[8]: https://learn.microsoft.com/dotnet/api/system.invalidoperationexception
================================================
FILE: docs/api/DbExtensions/SqlSet_1/FirstAsync_1.md
================================================
SqlSet<TResult>.FirstAsync(String, CancellationToken) Method
===============================================================
Returns the first element in the set that satisfies a specified condition.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| --------------------------------------------------------- | -------------------------------------------------------------------------- |
| [FirstAsync(CancellationToken)][2] | Returns the first element of the set. |
| [FirstAsync(OperatorStringHandler, CancellationToken)][3] | Returns the first element in the set that satisfies a specified condition. |
| **FirstAsync(String, CancellationToken)** | Returns the first element in the set that satisfies a specified condition. |
Syntax
------
```csharp
public ValueTask FirstAsync(
string predicate,
CancellationToken cancellationToken = default
)
```
#### Parameters
##### *predicate* [String][4]
A SQL expression to test each row for a condition.
##### *cancellationToken* [CancellationToken][5] (Optional)
The [CancellationToken][5] to monitor for cancellation requests. The default is [None][6].
#### Return Value
[ValueTask][7]<[TResult][8]>
The first element in the set that passes the test in the specified *predicate*.
Exceptions
----------
| Exception | Condition |
| ------------------------------ | ----------------------------------------------------------------------- |
| [InvalidOperationException][9] | No element satisfies the condition in *predicate*.-or-The set is empty. |
See Also
--------
#### Reference
[SqlSet<TResult> Class][8]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: FirstAsync_2.md
[3]: FirstAsync.md
[4]: https://learn.microsoft.com/dotnet/api/system.string
[5]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken
[6]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken.none
[7]: https://learn.microsoft.com/dotnet/api/system.threading.tasks.valuetask-1
[8]: README.md
[9]: https://learn.microsoft.com/dotnet/api/system.invalidoperationexception
================================================
FILE: docs/api/DbExtensions/SqlSet_1/FirstAsync_2.md
================================================
SqlSet<TResult>.FirstAsync(CancellationToken) Method
=======================================================
Returns the first element of the set.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| --------------------------------------------------------- | -------------------------------------------------------------------------- |
| **FirstAsync(CancellationToken)** | Returns the first element of the set. |
| [FirstAsync(OperatorStringHandler, CancellationToken)][2] | Returns the first element in the set that satisfies a specified condition. |
| [FirstAsync(String, CancellationToken)][3] | Returns the first element in the set that satisfies a specified condition. |
Syntax
------
```csharp
public ValueTask FirstAsync(
CancellationToken cancellationToken = default
)
```
#### Parameters
##### *cancellationToken* [CancellationToken][4] (Optional)
The [CancellationToken][4] to monitor for cancellation requests. The default is [None][5].
#### Return Value
[ValueTask][6]<[TResult][7]>
The first element in the set.
Exceptions
----------
| Exception | Condition |
| ------------------------------ | ----------------- |
| [InvalidOperationException][8] | The set is empty. |
See Also
--------
#### Reference
[SqlSet<TResult> Class][7]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: FirstAsync.md
[3]: FirstAsync_1.md
[4]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken
[5]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken.none
[6]: https://learn.microsoft.com/dotnet/api/system.threading.tasks.valuetask-1
[7]: README.md
[8]: https://learn.microsoft.com/dotnet/api/system.invalidoperationexception
================================================
FILE: docs/api/DbExtensions/SqlSet_1/FirstOrDefault.md
================================================
SqlSet<TResult>.FirstOrDefault Method
========================================
Returns the first element of the set, or a default value if the set contains no elements.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ------------------------------------------ | --------------------------------------------------------------------------------------------------------------- |
| **FirstOrDefault()** | Returns the first element of the set, or a default value if the set contains no elements. |
| [FirstOrDefault(OperatorStringHandler)][2] | Returns the first element of the set that satisfies a condition or a default value if no such element is found. |
| [FirstOrDefault(String)][3] | Returns the first element of the set that satisfies a condition or a default value if no such element is found. |
Syntax
------
```csharp
public TResult FirstOrDefault()
```
#### Return Value
[TResult][4]
A default value if the set is empty; otherwise, the first element.
See Also
--------
#### Reference
[SqlSet<TResult> Class][4]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: FirstOrDefault_1.md
[3]: FirstOrDefault_2.md
[4]: README.md
================================================
FILE: docs/api/DbExtensions/SqlSet_1/FirstOrDefaultAsync.md
================================================
SqlSet<TResult>.FirstOrDefaultAsync(SqlSet.OperatorStringHandler, CancellationToken) Method
==============================================================================================
Returns the first element of the set that satisfies a condition or a default value if no such element is found.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ----------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- |
| [FirstOrDefaultAsync(CancellationToken)][2] | Returns the first element of the set, or a default value if the set contains no elements. |
| **FirstOrDefaultAsync(OperatorStringHandler, CancellationToken)** | Returns the first element of the set that satisfies a condition or a default value if no such element is found. |
| [FirstOrDefaultAsync(String, CancellationToken)][3] | Returns the first element of the set that satisfies a condition or a default value if no such element is found. |
Syntax
------
```csharp
public ValueTask FirstOrDefaultAsync(
OperatorStringHandler predicate,
CancellationToken cancellationToken = default
)
```
#### Parameters
##### *predicate* OperatorStringHandler
A SQL expression to test each row for a condition.
##### *cancellationToken* [CancellationToken][4] (Optional)
The [CancellationToken][4] to monitor for cancellation requests. The default is [None][5].
#### Return Value
[ValueTask][6]<[TResult][7]>
A default value if the set is empty or if no element passes the test specified by *predicate*; otherwise, the first element that passes the test specified by *predicate*.
See Also
--------
#### Reference
[SqlSet<TResult> Class][7]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: FirstOrDefaultAsync_2.md
[3]: FirstOrDefaultAsync_1.md
[4]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken
[5]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken.none
[6]: https://learn.microsoft.com/dotnet/api/system.threading.tasks.valuetask-1
[7]: README.md
================================================
FILE: docs/api/DbExtensions/SqlSet_1/FirstOrDefaultAsync_1.md
================================================
SqlSet<TResult>.FirstOrDefaultAsync(String, CancellationToken) Method
========================================================================
Returns the first element of the set that satisfies a condition or a default value if no such element is found.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------- |
| [FirstOrDefaultAsync(CancellationToken)][2] | Returns the first element of the set, or a default value if the set contains no elements. |
| [FirstOrDefaultAsync(OperatorStringHandler, CancellationToken)][3] | Returns the first element of the set that satisfies a condition or a default value if no such element is found. |
| **FirstOrDefaultAsync(String, CancellationToken)** | Returns the first element of the set that satisfies a condition or a default value if no such element is found. |
Syntax
------
```csharp
public ValueTask FirstOrDefaultAsync(
string predicate,
CancellationToken cancellationToken = default
)
```
#### Parameters
##### *predicate* [String][4]
A SQL expression to test each row for a condition.
##### *cancellationToken* [CancellationToken][5] (Optional)
The [CancellationToken][5] to monitor for cancellation requests. The default is [None][6].
#### Return Value
[ValueTask][7]<[TResult][8]>
A default value if the set is empty or if no element passes the test specified by *predicate*; otherwise, the first element that passes the test specified by *predicate*.
See Also
--------
#### Reference
[SqlSet<TResult> Class][8]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: FirstOrDefaultAsync_2.md
[3]: FirstOrDefaultAsync.md
[4]: https://learn.microsoft.com/dotnet/api/system.string
[5]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken
[6]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken.none
[7]: https://learn.microsoft.com/dotnet/api/system.threading.tasks.valuetask-1
[8]: README.md
================================================
FILE: docs/api/DbExtensions/SqlSet_1/FirstOrDefaultAsync_2.md
================================================
SqlSet<TResult>.FirstOrDefaultAsync(CancellationToken) Method
================================================================
Returns the first element of the set, or a default value if the set contains no elements.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------- |
| **FirstOrDefaultAsync(CancellationToken)** | Returns the first element of the set, or a default value if the set contains no elements. |
| [FirstOrDefaultAsync(OperatorStringHandler, CancellationToken)][2] | Returns the first element of the set that satisfies a condition or a default value if no such element is found. |
| [FirstOrDefaultAsync(String, CancellationToken)][3] | Returns the first element of the set that satisfies a condition or a default value if no such element is found. |
Syntax
------
```csharp
public ValueTask FirstOrDefaultAsync(
CancellationToken cancellationToken = default
)
```
#### Parameters
##### *cancellationToken* [CancellationToken][4] (Optional)
The [CancellationToken][4] to monitor for cancellation requests. The default is [None][5].
#### Return Value
[ValueTask][6]<[TResult][7]>
A default value if the set is empty; otherwise, the first element.
See Also
--------
#### Reference
[SqlSet<TResult> Class][7]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: FirstOrDefaultAsync.md
[3]: FirstOrDefaultAsync_1.md
[4]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken
[5]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken.none
[6]: https://learn.microsoft.com/dotnet/api/system.threading.tasks.valuetask-1
[7]: README.md
================================================
FILE: docs/api/DbExtensions/SqlSet_1/FirstOrDefault_1.md
================================================
SqlSet<TResult>.FirstOrDefault(SqlSet.OperatorStringHandler) Method
======================================================================
Returns the first element of the set that satisfies a condition or a default value if no such element is found.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ----------------------------------------- | --------------------------------------------------------------------------------------------------------------- |
| [FirstOrDefault()][2] | Returns the first element of the set, or a default value if the set contains no elements. |
| **FirstOrDefault(OperatorStringHandler)** | Returns the first element of the set that satisfies a condition or a default value if no such element is found. |
| [FirstOrDefault(String)][3] | Returns the first element of the set that satisfies a condition or a default value if no such element is found. |
Syntax
------
```csharp
public TResult FirstOrDefault(
ref OperatorStringHandler? predicate
)
```
#### Parameters
##### *predicate* OperatorStringHandler
A SQL expression to test each row for a condition.
#### Return Value
[TResult][4]
A default value if the set is empty or if no element passes the test specified by *predicate*; otherwise, the first element that passes the test specified by *predicate*.
See Also
--------
#### Reference
[SqlSet<TResult> Class][4]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: FirstOrDefault.md
[3]: FirstOrDefault_2.md
[4]: README.md
================================================
FILE: docs/api/DbExtensions/SqlSet_1/FirstOrDefault_2.md
================================================
SqlSet<TResult>.FirstOrDefault(String) Method
================================================
Returns the first element of the set that satisfies a condition or a default value if no such element is found.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ------------------------------------------ | --------------------------------------------------------------------------------------------------------------- |
| [FirstOrDefault()][2] | Returns the first element of the set, or a default value if the set contains no elements. |
| [FirstOrDefault(OperatorStringHandler)][3] | Returns the first element of the set that satisfies a condition or a default value if no such element is found. |
| **FirstOrDefault(String)** | Returns the first element of the set that satisfies a condition or a default value if no such element is found. |
Syntax
------
```csharp
public TResult FirstOrDefault(
string predicate
)
```
#### Parameters
##### *predicate* [String][4]
A SQL expression to test each row for a condition.
#### Return Value
[TResult][5]
A default value if the set is empty or if no element passes the test specified by *predicate*; otherwise, the first element that passes the test specified by *predicate*.
See Also
--------
#### Reference
[SqlSet<TResult> Class][5]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: FirstOrDefault.md
[3]: FirstOrDefault_1.md
[4]: https://learn.microsoft.com/dotnet/api/system.string
[5]: README.md
================================================
FILE: docs/api/DbExtensions/SqlSet_1/First_1.md
================================================
SqlSet<TResult>.First(SqlSet.OperatorStringHandler) Method
=============================================================
Returns the first element in the set that satisfies a specified condition.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| -------------------------------- | -------------------------------------------------------------------------- |
| [First()][2] | Returns the first element of the set. |
| **First(OperatorStringHandler)** | Returns the first element in the set that satisfies a specified condition. |
| [First(String)][3] | Returns the first element in the set that satisfies a specified condition. |
Syntax
------
```csharp
public TResult First(
ref OperatorStringHandler predicate
)
```
#### Parameters
##### *predicate* OperatorStringHandler
A SQL expression to test each row for a condition.
#### Return Value
[TResult][4]
The first element in the set that passes the test in the specified *predicate*.
Exceptions
----------
| Exception | Condition |
| ------------------------------ | ----------------------------------------------------------------------- |
| [InvalidOperationException][5] | No element satisfies the condition in *predicate*.-or-The set is empty. |
See Also
--------
#### Reference
[SqlSet<TResult> Class][4]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: First.md
[3]: First_2.md
[4]: README.md
[5]: https://learn.microsoft.com/dotnet/api/system.invalidoperationexception
================================================
FILE: docs/api/DbExtensions/SqlSet_1/First_2.md
================================================
SqlSet<TResult>.First(String) Method
=======================================
Returns the first element in the set that satisfies a specified condition.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| --------------------------------- | -------------------------------------------------------------------------- |
| [First()][2] | Returns the first element of the set. |
| [First(OperatorStringHandler)][3] | Returns the first element in the set that satisfies a specified condition. |
| **First(String)** | Returns the first element in the set that satisfies a specified condition. |
Syntax
------
```csharp
public TResult First(
string predicate
)
```
#### Parameters
##### *predicate* [String][4]
A SQL expression to test each row for a condition.
#### Return Value
[TResult][5]
The first element in the set that passes the test in the specified *predicate*.
Exceptions
----------
| Exception | Condition |
| ------------------------------ | ----------------------------------------------------------------------- |
| [InvalidOperationException][6] | No element satisfies the condition in *predicate*.-or-The set is empty. |
See Also
--------
#### Reference
[SqlSet<TResult> Class][5]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: First.md
[3]: First_1.md
[4]: https://learn.microsoft.com/dotnet/api/system.string
[5]: README.md
[6]: https://learn.microsoft.com/dotnet/api/system.invalidoperationexception
================================================
FILE: docs/api/DbExtensions/SqlSet_1/GetAsyncEnumerator.md
================================================
SqlSet<TResult>.GetAsyncEnumerator Method
============================================
Returns an async enumerator that iterates through the set.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public IAsyncEnumerator GetAsyncEnumerator(
CancellationToken cancellationToken = default
)
```
#### Parameters
##### *cancellationToken* [CancellationToken][2] (Optional)
The [CancellationToken][2] to monitor for cancellation requests. The default is [None][3].
#### Return Value
[IAsyncEnumerator][4]<[TResult][5]>
A [IAsyncEnumerator<T>][4] for the set.
See Also
--------
#### Reference
[SqlSet<TResult> Class][5]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken
[3]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken.none
[4]: https://learn.microsoft.com/dotnet/api/system.collections.generic.iasyncenumerator-1
[5]: README.md
================================================
FILE: docs/api/DbExtensions/SqlSet_1/GetEnumerator.md
================================================
SqlSet<TResult>.GetEnumerator Method
=======================================
Returns an enumerator that iterates through the set.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public IEnumerator GetEnumerator()
```
#### Return Value
[IEnumerator][2]<[TResult][3]>
A [IEnumerator<T>][2] for the set.
See Also
--------
#### Reference
[SqlSet<TResult> Class][3]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerator-1
[3]: README.md
================================================
FILE: docs/api/DbExtensions/SqlSet_1/Include.md
================================================
SqlSet<TResult>.Include(Func<TResult, Object>, String) Method
===================================================================
Specifies the related objects to include in the query results.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| --------------------------------------------- | -------------------------------------------------------------- |
| [Include(String)][2] | Specifies the related objects to include in the query results. |
| **Include(Func<TResult, Object>, String)** | Specifies the related objects to include in the query results. |
Syntax
------
```csharp
public SqlSet Include(
Func path,
string pathExpr = ""
)
```
#### Parameters
##### *path* [Func][3]<[TResult][4], [Object][5]>
Lambda expression that returns the deepest related object to return in the query results.
##### *pathExpr* [String][6] (Optional)
This argument is compiler generated.
#### Return Value
[SqlSet][4]<[TResult][4]>
A new [SqlSet<TResult>][4] with the defined query path.
Exceptions
----------
| Exception | Condition |
| ------------------------------ | --------------------------------------------------------------------------------- |
| [InvalidOperationException][7] | This method can only be used on sets where the result type is an annotated class. |
See Also
--------
#### Reference
[SqlSet<TResult> Class][4]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: Include_1.md
[3]: https://learn.microsoft.com/dotnet/api/system.func-2
[4]: README.md
[5]: https://learn.microsoft.com/dotnet/api/system.object
[6]: https://learn.microsoft.com/dotnet/api/system.string
[7]: https://learn.microsoft.com/dotnet/api/system.invalidoperationexception
================================================
FILE: docs/api/DbExtensions/SqlSet_1/IncludeMany.md
================================================
SqlSet<TResult>.IncludeMany(String, Func<SqlSet, SqlSet>) Method
======================================================================
Specifies which collections to include in the query results.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------ |
| **IncludeMany(String, Func<SqlSet, SqlSet>)** | Specifies which collections to include in the query results. |
| [IncludeMany<TElement>(Func<TResult, ICollection<TElement>>, Func<SqlSet<TElement>, SqlSet<TElement>>, String)][2] | Specifies which collections to include in the query results. |
Syntax
------
```csharp
public SqlSet IncludeMany(
string path,
Func? manySetup = null
)
```
#### Parameters
##### *path* [String][3]
Dot-separated list of one or more related objects that ends with the collection to load.
##### *manySetup* [Func][4]<[SqlSet][5], [SqlSet][5]> (Optional)
A function to customize how the collection is loaded.
#### Return Value
[SqlSet][6]<[TResult][6]>
A new [SqlSet<TResult>][6].
Exceptions
----------
| Exception | Condition |
| ------------------------------ | --------------------------------------------------------------------------------- |
| [InvalidOperationException][7] | This method can only be used on sets where the result type is an annotated class. |
See Also
--------
#### Reference
[SqlSet<TResult> Class][6]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: IncludeMany__1.md
[3]: https://learn.microsoft.com/dotnet/api/system.string
[4]: https://learn.microsoft.com/dotnet/api/system.func-2
[5]: ../SqlSet/README.md
[6]: README.md
[7]: https://learn.microsoft.com/dotnet/api/system.invalidoperationexception
================================================
FILE: docs/api/DbExtensions/SqlSet_1/IncludeMany__1.md
================================================
SqlSet<TResult>.IncludeMany<TElement>(Func<TResult, ICollection<TElement>>, Func<SqlSet<TElement>, SqlSet<TElement>>, String) Method
=========================================================================================================================================================
Specifies which collections to include in the query results.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ----------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------ |
| [IncludeMany(String, Func<SqlSet, SqlSet>)][2] | Specifies which collections to include in the query results. |
| **IncludeMany<TElement>(Func<TResult, ICollection<TElement>>, Func<SqlSet<TElement>, SqlSet<TElement>>, String)** | Specifies which collections to include in the query results. |
Syntax
------
```csharp
public SqlSet IncludeMany(
Func?> path,
Func, SqlSet>? manySetup = null,
string pathExpr = ""
)
```
#### Parameters
##### *path* [Func][3]<[TResult][4], [ICollection][5]<**TElement**>>
Lambda expression that returns the collection to load.
##### *manySetup* [Func][3]<[SqlSet][4]<**TElement**>, [SqlSet][4]<**TElement**>> (Optional)
A function to customize how the collection is loaded.
##### *pathExpr* [String][6] (Optional)
This argument is compiler generated.
#### Type Parameters
##### *TElement*
The type of objects the collection holds.
#### Return Value
[SqlSet][4]<[TResult][4]>
A new [SqlSet<TResult>][4].
Exceptions
----------
| Exception | Condition |
| ------------------------------ | --------------------------------------------------------------------------------- |
| [InvalidOperationException][7] | This method can only be used on sets where the result type is an annotated class. |
See Also
--------
#### Reference
[SqlSet<TResult> Class][4]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: IncludeMany.md
[3]: https://learn.microsoft.com/dotnet/api/system.func-2
[4]: README.md
[5]: https://learn.microsoft.com/dotnet/api/system.collections.generic.icollection-1
[6]: https://learn.microsoft.com/dotnet/api/system.string
[7]: https://learn.microsoft.com/dotnet/api/system.invalidoperationexception
================================================
FILE: docs/api/DbExtensions/SqlSet_1/Include_1.md
================================================
SqlSet<TResult>.Include(String) Method
=========================================
Specifies the related objects to include in the query results.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ---------------------------------------------- | -------------------------------------------------------------- |
| **Include(String)** | Specifies the related objects to include in the query results. |
| [Include(Func<TResult, Object>, String)][2] | Specifies the related objects to include in the query results. |
Syntax
------
```csharp
public SqlSet Include(
string path
)
```
#### Parameters
##### *path* [String][3]
Dot-separated list of related objects to return in the query results.
#### Return Value
[SqlSet][4]<[TResult][4]>
A new [SqlSet<TResult>][4] with the defined query path.
Exceptions
----------
| Exception | Condition |
| ------------------------------ | --------------------------------------------------------------------------------- |
| [InvalidOperationException][5] | This method can only be used on sets where the result type is an annotated class. |
See Also
--------
#### Reference
[SqlSet<TResult> Class][4]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: Include.md
[3]: https://learn.microsoft.com/dotnet/api/system.string
[4]: README.md
[5]: https://learn.microsoft.com/dotnet/api/system.invalidoperationexception
================================================
FILE: docs/api/DbExtensions/SqlSet_1/OrderBy.md
================================================
SqlSet<TResult>.OrderBy(SqlSet.OperatorStringHandler) Method
===============================================================
Sorts the elements of the set according to the *columnList*.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ---------------------------------- | ------------------------------------------------------------ |
| **OrderBy(OperatorStringHandler)** | Sorts the elements of the set according to the *columnList*. |
| [OrderBy(String)][2] | Sorts the elements of the set according to the *columnList*. |
Syntax
------
```csharp
public SqlSet OrderBy(
ref OperatorStringHandler columnList
)
```
#### Parameters
##### *columnList* OperatorStringHandler
The list of columns to base the sort on.
#### Return Value
[SqlSet][3]<[TResult][3]>
A new [SqlSet<TResult>][3] whose elements are sorted according to *columnList*.
See Also
--------
#### Reference
[SqlSet<TResult> Class][3]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: OrderBy_1.md
[3]: README.md
================================================
FILE: docs/api/DbExtensions/SqlSet_1/OrderBy_1.md
================================================
SqlSet<TResult>.OrderBy(String) Method
=========================================
Sorts the elements of the set according to the *columnList*.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ----------------------------------- | ------------------------------------------------------------ |
| [OrderBy(OperatorStringHandler)][2] | Sorts the elements of the set according to the *columnList*. |
| **OrderBy(String)** | Sorts the elements of the set according to the *columnList*. |
Syntax
------
```csharp
public SqlSet OrderBy(
string columnList
)
```
#### Parameters
##### *columnList* [String][3]
The list of columns to base the sort on.
#### Return Value
[SqlSet][4]<[TResult][4]>
A new [SqlSet<TResult>][4] whose elements are sorted according to *columnList*.
See Also
--------
#### Reference
[SqlSet<TResult> Class][4]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: OrderBy.md
[3]: https://learn.microsoft.com/dotnet/api/system.string
[4]: README.md
================================================
FILE: docs/api/DbExtensions/SqlSet_1/README.md
================================================
SqlSet<TResult> Class
========================
Represents an immutable, connected SQL query that maps to TResult objects. This class cannot be instantiated, to get an instance use one of the [Database.From<TResult>(String)][1] or [Database.FromQuery<TResult>(SqlBuilder)][2] overloads.
Inheritance Hierarchy
---------------------
[System.Object][3]
[DbExtensions.SqlSet][4]
**DbExtensions.SqlSet<TResult>**
[DbExtensions.SqlTable<TEntity>][5]
**Namespace:** [DbExtensions][6]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public class SqlSet : SqlSet
```
#### Type Parameters
##### *TResult*
The type of objects to map the results to.
The **SqlSet<TResult>** type exposes the following members.
Properties
----------
| Name | Description |
| --------------- | -------------------------------------------------------------------------------------------------- |
| [Database][7] | The [Database][8] this set is connected to. (Inherited from [SqlSet][4]) |
| [ResultType][9] | The type of objects this set returns. This property can be null. (Inherited from [SqlSet][4]) |
Methods
-------
| Name | Description |
| ------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [All(OperatorStringHandler)][10] | Determines whether all elements of the set satisfy a condition. (Inherited from [SqlSet][4]) |
| [All(String)][11] | Determines whether all elements of the set satisfy a condition. (Inherited from [SqlSet][4]) |
| [AllAsync(OperatorStringHandler, CancellationToken)][12] | Determines whether all elements of the set satisfy a condition. (Inherited from [SqlSet][4]) |
| [AllAsync(String, CancellationToken)][13] | Determines whether all elements of the set satisfy a condition. (Inherited from [SqlSet][4]) |
| [Any()][14] | Determines whether the set contains any elements. (Inherited from [SqlSet][4]) |
| [Any(OperatorStringHandler)][15] | Determines whether any element of the set satisfies a condition. (Inherited from [SqlSet][4]) |
| [Any(String)][16] | Determines whether any element of the set satisfies a condition. (Inherited from [SqlSet][4]) |
| [AnyAsync(CancellationToken)][17] | Determines whether the set contains any elements. (Inherited from [SqlSet][4]) |
| [AnyAsync(OperatorStringHandler, CancellationToken)][18] | Determines whether any element of the set satisfies a condition. (Inherited from [SqlSet][4]) |
| [AnyAsync(String, CancellationToken)][19] | Determines whether any element of the set satisfies a condition. (Inherited from [SqlSet][4]) |
| [AsAsyncEnumerable][20] | Gets all TResult objects in the set. The query is deferred-executed. |
| [AsEnumerable][21] | Gets all TResult objects in the set. The query is deferred-executed. |
| [Cast(Type)][22] | Casts the elements of the set to the specified type. (Inherited from [SqlSet][4]) |
| [Cast<TResult>()][23] | Casts the elements of the set to the specified type. (Inherited from [SqlSet][4]) |
| [Contains(Object)][24] | Checks the existance of the *entity*, using the primary key value. (Inherited from [SqlSet][4]) |
| [Contains(TResult)][25] | Checks the existance of the *entity*, using the primary key value. |
| [ContainsAsync(Object, CancellationToken)][26] | Checks the existance of the *entity*, using the primary key value. (Inherited from [SqlSet][4]) |
| [ContainsAsync(TResult, CancellationToken)][27] | Checks the existance of the *entity*, using the primary key value. |
| [ContainsKey][28] | Checks the existance of an entity whose primary matches the *id* parameter. (Inherited from [SqlSet][4]) |
| [ContainsKeyAsync][29] | Checks the existance of an entity whose primary matches the *id* parameter. (Inherited from [SqlSet][4]) |
| [Count()][30] | Returns the number of elements in the set. (Inherited from [SqlSet][4]) |
| [Count(OperatorStringHandler)][31] | Returns a number that represents how many elements in the set satisfy a condition. (Inherited from [SqlSet][4]) |
| [Count(String)][32] | Returns a number that represents how many elements in the set satisfy a condition. (Inherited from [SqlSet][4]) |
| [CountAsync(CancellationToken)][33] | Returns the number of elements in the set. (Inherited from [SqlSet][4]) |
| [CountAsync(OperatorStringHandler, CancellationToken)][34] | Returns a number that represents how many elements in the set satisfy a condition. (Inherited from [SqlSet][4]) |
| [CountAsync(String, CancellationToken)][35] | Returns a number that represents how many elements in the set satisfy a condition. (Inherited from [SqlSet][4]) |
| [Find][36] | Gets the entity whose primary key matches the *id* parameter. |
| [FindAsync][37] | Gets the entity whose primary key matches the *id* parameter. |
| [First()][38] | Returns the first element of the set. |
| [First(OperatorStringHandler)][39] | Returns the first element in the set that satisfies a specified condition. |
| [First(String)][40] | Returns the first element in the set that satisfies a specified condition. |
| [FirstAsync(CancellationToken)][41] | Returns the first element of the set. |
| [FirstAsync(OperatorStringHandler, CancellationToken)][42] | Returns the first element in the set that satisfies a specified condition. |
| [FirstAsync(String, CancellationToken)][43] | Returns the first element in the set that satisfies a specified condition. |
| [FirstOrDefault()][44] | Returns the first element of the set, or a default value if the set contains no elements. |
| [FirstOrDefault(OperatorStringHandler)][45] | Returns the first element of the set that satisfies a condition or a default value if no such element is found. |
| [FirstOrDefault(String)][46] | Returns the first element of the set that satisfies a condition or a default value if no such element is found. |
| [FirstOrDefaultAsync(CancellationToken)][47] | Returns the first element of the set, or a default value if the set contains no elements. |
| [FirstOrDefaultAsync(OperatorStringHandler, CancellationToken)][48] | Returns the first element of the set that satisfies a condition or a default value if no such element is found. |
| [FirstOrDefaultAsync(String, CancellationToken)][49] | Returns the first element of the set that satisfies a condition or a default value if no such element is found. |
| [GetAsyncEnumerator][50] | Returns an async enumerator that iterates through the set. |
| [GetDefiningQuery][51] | Returns the SQL query that is the source of data for the set. (Inherited from [SqlSet][4]) |
| [GetEnumerator][52] | Returns an enumerator that iterates through the set. |
| [Include(String)][53] | Specifies the related objects to include in the query results. |
| [Include(Func<TResult, Object>, String)][54] | Specifies the related objects to include in the query results. |
| [IncludeMany(String, Func<SqlSet, SqlSet>)][55] | Specifies which collections to include in the query results. |
| [IncludeMany<TElement>(Func<TResult, ICollection<TElement>>, Func<SqlSet<TElement>, SqlSet<TElement>>, String)][56] | Specifies which collections to include in the query results. |
| [LongCount()][57] | Returns an [Int64][58] that represents the total number of elements in the set. (Inherited from [SqlSet][4]) |
| [LongCount(OperatorStringHandler)][59] | Returns an [Int64][58] that represents how many elements in the set satisfy a condition. (Inherited from [SqlSet][4]) |
| [LongCount(String)][60] | Returns an [Int64][58] that represents how many elements in the set satisfy a condition. (Inherited from [SqlSet][4]) |
| [LongCountAsync(CancellationToken)][61] | Returns an [Int64][58] that represents the total number of elements in the set. (Inherited from [SqlSet][4]) |
| [LongCountAsync(OperatorStringHandler, CancellationToken)][62] | Returns an [Int64][58] that represents how many elements in the set satisfy a condition. (Inherited from [SqlSet][4]) |
| [LongCountAsync(String, CancellationToken)][63] | Returns an [Int64][58] that represents how many elements in the set satisfy a condition. (Inherited from [SqlSet][4]) |
| [OrderBy(OperatorStringHandler)][64] | Sorts the elements of the set according to the *columnList*. |
| [OrderBy(String)][65] | Sorts the elements of the set according to the *columnList*. |
| [Select(OperatorStringHandler, Type)][66] | Projects each element of the set into a new form. (Inherited from [SqlSet][4]) |
| [Select(String, Type)][67] | Projects each element of the set into a new form. (Inherited from [SqlSet][4]) |
| [Select<TResult>(OperatorStringHandler)][68] | Projects each element of the set into a new form. (Inherited from [SqlSet][4]) |
| [Select<TResult>(String)][69] | Projects each element of the set into a new form. (Inherited from [SqlSet][4]) |
| [Select<TResult>(OperatorStringHandler, Func<DbDataReader, TResult>)][70] | Projects each element of the set into a new form. (Inherited from [SqlSet][4]) |
| [Select<TResult>(String, Func<DbDataReader, TResult>)][71] | Projects each element of the set into a new form. (Inherited from [SqlSet][4]) |
| [Single()][72] | The single element of the set. |
| [Single(OperatorStringHandler)][73] | Returns the only element of the set that satisfies a specified condition, and throws an exception if more than one such element exists. |
| [Single(String)][74] | Returns the only element of the set that satisfies a specified condition, and throws an exception if more than one such element exists. |
| [SingleAsync(CancellationToken)][75] | The single element of the set. |
| [SingleAsync(OperatorStringHandler, CancellationToken)][76] | Returns the only element of the set that satisfies a specified condition, and throws an exception if more than one such element exists. |
| [SingleAsync(String, CancellationToken)][77] | Returns the only element of the set that satisfies a specified condition, and throws an exception if more than one such element exists. |
| [SingleOrDefault()][78] | Returns the only element of the set, or a default value if the set is empty; this method throws an exception if there is more than one element in the set. |
| [SingleOrDefault(OperatorStringHandler)][79] | Returns the only element of the set that satisfies a specified condition or a default value if no such element exists; this method throws an exception if more than one element satisfies the condition. |
| [SingleOrDefault(String)][80] | Returns the only element of the set that satisfies a specified condition or a default value if no such element exists; this method throws an exception if more than one element satisfies the condition. |
| [SingleOrDefaultAsync(CancellationToken)][81] | Returns the only element of the set, or a default value if the set is empty; this method throws an exception if there is more than one element in the set. |
| [SingleOrDefaultAsync(OperatorStringHandler, CancellationToken)][82] | Returns the only element of the set that satisfies a specified condition or a default value if no such element exists; this method throws an exception if more than one element satisfies the condition. |
| [SingleOrDefaultAsync(String, CancellationToken)][83] | Returns the only element of the set that satisfies a specified condition or a default value if no such element exists; this method throws an exception if more than one element satisfies the condition. |
| [Skip][84] | Bypasses a specified number of elements in the set and then returns the remaining elements. |
| [Take][85] | Returns a specified number of contiguous elements from the start of the set. |
| [ToArray][86] | Creates an array from the set. |
| [ToArrayAsync][87] | Creates an array from the set. |
| [ToList][88] | Creates a List<TResult> from the set. |
| [ToListAsync][89] | Creates a List<TResult> from the set. |
| [ToString][90] | Returns the SQL query of the set. (Inherited from [SqlSet][4]) |
| [Where(OperatorStringHandler)][91] | Filters the set based on a predicate. |
| [Where(String)][92] | Filters the set based on a predicate. |
Remarks
-------
For information on how to use SqlSet see [SqlSet Tutorial][93].
See Also
--------
#### Reference
[DbExtensions Namespace][6]
[1]: ../Database/From__1.md
[2]: ../Database/FromQuery__1.md
[3]: https://learn.microsoft.com/dotnet/api/system.object
[4]: ../SqlSet/README.md
[5]: ../SqlTable_1/README.md
[6]: ../README.md
[7]: ../SqlSet/Database.md
[8]: ../Database/README.md
[9]: ../SqlSet/ResultType.md
[10]: ../SqlSet/All.md
[11]: ../SqlSet/All_1.md
[12]: ../SqlSet/AllAsync.md
[13]: ../SqlSet/AllAsync_1.md
[14]: ../SqlSet/Any.md
[15]: ../SqlSet/Any_1.md
[16]: ../SqlSet/Any_2.md
[17]: ../SqlSet/AnyAsync_2.md
[18]: ../SqlSet/AnyAsync.md
[19]: ../SqlSet/AnyAsync_1.md
[20]: AsAsyncEnumerable.md
[21]: AsEnumerable.md
[22]: ../SqlSet/Cast.md
[23]: ../SqlSet/Cast__1.md
[24]: ../SqlSet/Contains.md
[25]: Contains.md
[26]: ../SqlSet/ContainsAsync.md
[27]: ContainsAsync.md
[28]: ../SqlSet/ContainsKey.md
[29]: ../SqlSet/ContainsKeyAsync.md
[30]: ../SqlSet/Count.md
[31]: ../SqlSet/Count_1.md
[32]: ../SqlSet/Count_2.md
[33]: ../SqlSet/CountAsync_2.md
[34]: ../SqlSet/CountAsync.md
[35]: ../SqlSet/CountAsync_1.md
[36]: Find.md
[37]: FindAsync.md
[38]: First.md
[39]: First_1.md
[40]: First_2.md
[41]: FirstAsync_2.md
[42]: FirstAsync.md
[43]: FirstAsync_1.md
[44]: FirstOrDefault.md
[45]: FirstOrDefault_1.md
[46]: FirstOrDefault_2.md
[47]: FirstOrDefaultAsync_2.md
[48]: FirstOrDefaultAsync.md
[49]: FirstOrDefaultAsync_1.md
[50]: GetAsyncEnumerator.md
[51]: ../SqlSet/GetDefiningQuery.md
[52]: GetEnumerator.md
[53]: Include_1.md
[54]: Include.md
[55]: IncludeMany.md
[56]: IncludeMany__1.md
[57]: ../SqlSet/LongCount.md
[58]: https://learn.microsoft.com/dotnet/api/system.int64
[59]: ../SqlSet/LongCount_1.md
[60]: ../SqlSet/LongCount_2.md
[61]: ../SqlSet/LongCountAsync_2.md
[62]: ../SqlSet/LongCountAsync.md
[63]: ../SqlSet/LongCountAsync_1.md
[64]: OrderBy.md
[65]: OrderBy_1.md
[66]: ../SqlSet/Select_1.md
[67]: ../SqlSet/Select_3.md
[68]: ../SqlSet/Select__1.md
[69]: ../SqlSet/Select__1_2.md
[70]: ../SqlSet/Select__1_1.md
[71]: ../SqlSet/Select__1_3.md
[72]: Single.md
[73]: Single_1.md
[74]: Single_2.md
[75]: SingleAsync_2.md
[76]: SingleAsync.md
[77]: SingleAsync_1.md
[78]: SingleOrDefault.md
[79]: SingleOrDefault_1.md
[80]: SingleOrDefault_2.md
[81]: SingleOrDefaultAsync_2.md
[82]: SingleOrDefaultAsync.md
[83]: SingleOrDefaultAsync_1.md
[84]: Skip.md
[85]: Take.md
[86]: ToArray.md
[87]: ToArrayAsync.md
[88]: ToList.md
[89]: ToListAsync.md
[90]: ../SqlSet/ToString.md
[91]: Where.md
[92]: Where_1.md
[93]: https://maxtoroq.github.io/DbExtensions/docs/7/SqlSet.html
================================================
FILE: docs/api/DbExtensions/SqlSet_1/Single.md
================================================
SqlSet<TResult>.Single Method
================================
The single element of the set.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ---------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
| **Single()** | The single element of the set. |
| [Single(OperatorStringHandler)][2] | Returns the only element of the set that satisfies a specified condition, and throws an exception if more than one such element exists. |
| [Single(String)][3] | Returns the only element of the set that satisfies a specified condition, and throws an exception if more than one such element exists. |
Syntax
------
```csharp
public TResult Single()
```
#### Return Value
[TResult][4]
The single element of the set.
Exceptions
----------
| Exception | Condition |
| ------------------------------ | ------------------------------------------------------------ |
| [InvalidOperationException][5] | The set contains more than one element.-or-The set is empty. |
See Also
--------
#### Reference
[SqlSet<TResult> Class][4]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: Single_1.md
[3]: Single_2.md
[4]: README.md
[5]: https://learn.microsoft.com/dotnet/api/system.invalidoperationexception
================================================
FILE: docs/api/DbExtensions/SqlSet_1/SingleAsync.md
================================================
SqlSet<TResult>.SingleAsync(SqlSet.OperatorStringHandler, CancellationToken) Method
======================================================================================
Returns the only element of the set that satisfies a specified condition, and throws an exception if more than one such element exists.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| --------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
| [SingleAsync(CancellationToken)][2] | The single element of the set. |
| **SingleAsync(OperatorStringHandler, CancellationToken)** | Returns the only element of the set that satisfies a specified condition, and throws an exception if more than one such element exists. |
| [SingleAsync(String, CancellationToken)][3] | Returns the only element of the set that satisfies a specified condition, and throws an exception if more than one such element exists. |
Syntax
------
```csharp
public ValueTask SingleAsync(
OperatorStringHandler predicate,
CancellationToken cancellationToken = default
)
```
#### Parameters
##### *predicate* OperatorStringHandler
A SQL expression to test each row for a condition.
##### *cancellationToken* [CancellationToken][4] (Optional)
The [CancellationToken][4] to monitor for cancellation requests. The default is [None][5].
#### Return Value
[ValueTask][6]<[TResult][7]>
The single element of the set that passes the test in the specified *predicate*.
Exceptions
----------
| Exception | Condition |
| ------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------- |
| [InvalidOperationException][8] | No element satisfies the condition in *predicate*.-or-More than one element satisfies the condition in *predicate*.-or-The set is empty. |
See Also
--------
#### Reference
[SqlSet<TResult> Class][7]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: SingleAsync_2.md
[3]: SingleAsync_1.md
[4]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken
[5]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken.none
[6]: https://learn.microsoft.com/dotnet/api/system.threading.tasks.valuetask-1
[7]: README.md
[8]: https://learn.microsoft.com/dotnet/api/system.invalidoperationexception
================================================
FILE: docs/api/DbExtensions/SqlSet_1/SingleAsync_1.md
================================================
SqlSet<TResult>.SingleAsync(String, CancellationToken) Method
================================================================
Returns the only element of the set that satisfies a specified condition, and throws an exception if more than one such element exists.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ---------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
| [SingleAsync(CancellationToken)][2] | The single element of the set. |
| [SingleAsync(OperatorStringHandler, CancellationToken)][3] | Returns the only element of the set that satisfies a specified condition, and throws an exception if more than one such element exists. |
| **SingleAsync(String, CancellationToken)** | Returns the only element of the set that satisfies a specified condition, and throws an exception if more than one such element exists. |
Syntax
------
```csharp
public ValueTask SingleAsync(
string predicate,
CancellationToken cancellationToken = default
)
```
#### Parameters
##### *predicate* [String][4]
A SQL expression to test each row for a condition.
##### *cancellationToken* [CancellationToken][5] (Optional)
The [CancellationToken][5] to monitor for cancellation requests. The default is [None][6].
#### Return Value
[ValueTask][7]<[TResult][8]>
The single element of the set that passes the test in the specified *predicate*.
Exceptions
----------
| Exception | Condition |
| ------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------- |
| [InvalidOperationException][9] | No element satisfies the condition in *predicate*.-or-More than one element satisfies the condition in *predicate*.-or-The set is empty. |
See Also
--------
#### Reference
[SqlSet<TResult> Class][8]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: SingleAsync_2.md
[3]: SingleAsync.md
[4]: https://learn.microsoft.com/dotnet/api/system.string
[5]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken
[6]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken.none
[7]: https://learn.microsoft.com/dotnet/api/system.threading.tasks.valuetask-1
[8]: README.md
[9]: https://learn.microsoft.com/dotnet/api/system.invalidoperationexception
================================================
FILE: docs/api/DbExtensions/SqlSet_1/SingleAsync_2.md
================================================
SqlSet<TResult>.SingleAsync(CancellationToken) Method
========================================================
The single element of the set.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ---------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
| **SingleAsync(CancellationToken)** | The single element of the set. |
| [SingleAsync(OperatorStringHandler, CancellationToken)][2] | Returns the only element of the set that satisfies a specified condition, and throws an exception if more than one such element exists. |
| [SingleAsync(String, CancellationToken)][3] | Returns the only element of the set that satisfies a specified condition, and throws an exception if more than one such element exists. |
Syntax
------
```csharp
public ValueTask SingleAsync(
CancellationToken cancellationToken = default
)
```
#### Parameters
##### *cancellationToken* [CancellationToken][4] (Optional)
The [CancellationToken][4] to monitor for cancellation requests. The default is [None][5].
#### Return Value
[ValueTask][6]<[TResult][7]>
The single element of the set.
Exceptions
----------
| Exception | Condition |
| ------------------------------ | ------------------------------------------------------------ |
| [InvalidOperationException][8] | The set contains more than one element.-or-The set is empty. |
See Also
--------
#### Reference
[SqlSet<TResult> Class][7]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: SingleAsync.md
[3]: SingleAsync_1.md
[4]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken
[5]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken.none
[6]: https://learn.microsoft.com/dotnet/api/system.threading.tasks.valuetask-1
[7]: README.md
[8]: https://learn.microsoft.com/dotnet/api/system.invalidoperationexception
================================================
FILE: docs/api/DbExtensions/SqlSet_1/SingleOrDefault.md
================================================
SqlSet<TResult>.SingleOrDefault Method
=========================================
Returns the only element of the set, or a default value if the set is empty; this method throws an exception if there is more than one element in the set.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **SingleOrDefault()** | Returns the only element of the set, or a default value if the set is empty; this method throws an exception if there is more than one element in the set. |
| [SingleOrDefault(OperatorStringHandler)][2] | Returns the only element of the set that satisfies a specified condition or a default value if no such element exists; this method throws an exception if more than one element satisfies the condition. |
| [SingleOrDefault(String)][3] | Returns the only element of the set that satisfies a specified condition or a default value if no such element exists; this method throws an exception if more than one element satisfies the condition. |
Syntax
------
```csharp
public TResult SingleOrDefault()
```
#### Return Value
[TResult][4]
The single element of the set, or a default value if the set contains no elements.
Exceptions
----------
| Exception | Condition |
| ------------------------------ | --------------------------------------- |
| [InvalidOperationException][5] | The set contains more than one element. |
See Also
--------
#### Reference
[SqlSet<TResult> Class][4]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: SingleOrDefault_1.md
[3]: SingleOrDefault_2.md
[4]: README.md
[5]: https://learn.microsoft.com/dotnet/api/system.invalidoperationexception
================================================
FILE: docs/api/DbExtensions/SqlSet_1/SingleOrDefaultAsync.md
================================================
SqlSet<TResult>.SingleOrDefaultAsync(SqlSet.OperatorStringHandler, CancellationToken) Method
===============================================================================================
Returns the only element of the set that satisfies a specified condition or a default value if no such element exists; this method throws an exception if more than one element satisfies the condition.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [SingleOrDefaultAsync(CancellationToken)][2] | Returns the only element of the set, or a default value if the set is empty; this method throws an exception if there is more than one element in the set. |
| **SingleOrDefaultAsync(OperatorStringHandler, CancellationToken)** | Returns the only element of the set that satisfies a specified condition or a default value if no such element exists; this method throws an exception if more than one element satisfies the condition. |
| [SingleOrDefaultAsync(String, CancellationToken)][3] | Returns the only element of the set that satisfies a specified condition or a default value if no such element exists; this method throws an exception if more than one element satisfies the condition. |
Syntax
------
```csharp
public ValueTask SingleOrDefaultAsync(
OperatorStringHandler predicate,
CancellationToken cancellationToken = default
)
```
#### Parameters
##### *predicate* OperatorStringHandler
A SQL expression to test each row for a condition.
##### *cancellationToken* [CancellationToken][4] (Optional)
The [CancellationToken][4] to monitor for cancellation requests. The default is [None][5].
#### Return Value
[ValueTask][6]<[TResult][7]>
The single element of the set that satisfies the condition, or a default value if no such element is found.
See Also
--------
#### Reference
[SqlSet<TResult> Class][7]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: SingleOrDefaultAsync_2.md
[3]: SingleOrDefaultAsync_1.md
[4]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken
[5]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken.none
[6]: https://learn.microsoft.com/dotnet/api/system.threading.tasks.valuetask-1
[7]: README.md
================================================
FILE: docs/api/DbExtensions/SqlSet_1/SingleOrDefaultAsync_1.md
================================================
SqlSet<TResult>.SingleOrDefaultAsync(String, CancellationToken) Method
=========================================================================
Returns the only element of the set that satisfies a specified condition or a default value if no such element exists; this method throws an exception if more than one element satisfies the condition.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [SingleOrDefaultAsync(CancellationToken)][2] | Returns the only element of the set, or a default value if the set is empty; this method throws an exception if there is more than one element in the set. |
| [SingleOrDefaultAsync(OperatorStringHandler, CancellationToken)][3] | Returns the only element of the set that satisfies a specified condition or a default value if no such element exists; this method throws an exception if more than one element satisfies the condition. |
| **SingleOrDefaultAsync(String, CancellationToken)** | Returns the only element of the set that satisfies a specified condition or a default value if no such element exists; this method throws an exception if more than one element satisfies the condition. |
Syntax
------
```csharp
public ValueTask SingleOrDefaultAsync(
string predicate,
CancellationToken cancellationToken = default
)
```
#### Parameters
##### *predicate* [String][4]
A SQL expression to test each row for a condition.
##### *cancellationToken* [CancellationToken][5] (Optional)
The [CancellationToken][5] to monitor for cancellation requests. The default is [None][6].
#### Return Value
[ValueTask][7]<[TResult][8]>
The single element of the set that satisfies the condition, or a default value if no such element is found.
See Also
--------
#### Reference
[SqlSet<TResult> Class][8]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: SingleOrDefaultAsync_2.md
[3]: SingleOrDefaultAsync.md
[4]: https://learn.microsoft.com/dotnet/api/system.string
[5]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken
[6]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken.none
[7]: https://learn.microsoft.com/dotnet/api/system.threading.tasks.valuetask-1
[8]: README.md
================================================
FILE: docs/api/DbExtensions/SqlSet_1/SingleOrDefaultAsync_2.md
================================================
SqlSet<TResult>.SingleOrDefaultAsync(CancellationToken) Method
=================================================================
Returns the only element of the set, or a default value if the set is empty; this method throws an exception if there is more than one element in the set.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **SingleOrDefaultAsync(CancellationToken)** | Returns the only element of the set, or a default value if the set is empty; this method throws an exception if there is more than one element in the set. |
| [SingleOrDefaultAsync(OperatorStringHandler, CancellationToken)][2] | Returns the only element of the set that satisfies a specified condition or a default value if no such element exists; this method throws an exception if more than one element satisfies the condition. |
| [SingleOrDefaultAsync(String, CancellationToken)][3] | Returns the only element of the set that satisfies a specified condition or a default value if no such element exists; this method throws an exception if more than one element satisfies the condition. |
Syntax
------
```csharp
public ValueTask SingleOrDefaultAsync(
CancellationToken cancellationToken = default
)
```
#### Parameters
##### *cancellationToken* [CancellationToken][4] (Optional)
The [CancellationToken][4] to monitor for cancellation requests. The default is [None][5].
#### Return Value
[ValueTask][6]<[TResult][7]>
The single element of the set, or a default value if the set contains no elements.
Exceptions
----------
| Exception | Condition |
| ------------------------------ | --------------------------------------- |
| [InvalidOperationException][8] | The set contains more than one element. |
See Also
--------
#### Reference
[SqlSet<TResult> Class][7]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: SingleOrDefaultAsync.md
[3]: SingleOrDefaultAsync_1.md
[4]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken
[5]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken.none
[6]: https://learn.microsoft.com/dotnet/api/system.threading.tasks.valuetask-1
[7]: README.md
[8]: https://learn.microsoft.com/dotnet/api/system.invalidoperationexception
================================================
FILE: docs/api/DbExtensions/SqlSet_1/SingleOrDefault_1.md
================================================
SqlSet<TResult>.SingleOrDefault(SqlSet.OperatorStringHandler) Method
=======================================================================
Returns the only element of the set that satisfies a specified condition or a default value if no such element exists; this method throws an exception if more than one element satisfies the condition.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [SingleOrDefault()][2] | Returns the only element of the set, or a default value if the set is empty; this method throws an exception if there is more than one element in the set. |
| **SingleOrDefault(OperatorStringHandler)** | Returns the only element of the set that satisfies a specified condition or a default value if no such element exists; this method throws an exception if more than one element satisfies the condition. |
| [SingleOrDefault(String)][3] | Returns the only element of the set that satisfies a specified condition or a default value if no such element exists; this method throws an exception if more than one element satisfies the condition. |
Syntax
------
```csharp
public TResult SingleOrDefault(
ref OperatorStringHandler? predicate
)
```
#### Parameters
##### *predicate* OperatorStringHandler
A SQL expression to test each row for a condition.
#### Return Value
[TResult][4]
The single element of the set that satisfies the condition, or a default value if no such element is found.
See Also
--------
#### Reference
[SqlSet<TResult> Class][4]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: SingleOrDefault.md
[3]: SingleOrDefault_2.md
[4]: README.md
================================================
FILE: docs/api/DbExtensions/SqlSet_1/SingleOrDefault_2.md
================================================
SqlSet<TResult>.SingleOrDefault(String) Method
=================================================
Returns the only element of the set that satisfies a specified condition or a default value if no such element exists; this method throws an exception if more than one element satisfies the condition.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [SingleOrDefault()][2] | Returns the only element of the set, or a default value if the set is empty; this method throws an exception if there is more than one element in the set. |
| [SingleOrDefault(OperatorStringHandler)][3] | Returns the only element of the set that satisfies a specified condition or a default value if no such element exists; this method throws an exception if more than one element satisfies the condition. |
| **SingleOrDefault(String)** | Returns the only element of the set that satisfies a specified condition or a default value if no such element exists; this method throws an exception if more than one element satisfies the condition. |
Syntax
------
```csharp
public TResult SingleOrDefault(
string predicate
)
```
#### Parameters
##### *predicate* [String][4]
A SQL expression to test each row for a condition.
#### Return Value
[TResult][5]
The single element of the set that satisfies the condition, or a default value if no such element is found.
See Also
--------
#### Reference
[SqlSet<TResult> Class][5]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: SingleOrDefault.md
[3]: SingleOrDefault_1.md
[4]: https://learn.microsoft.com/dotnet/api/system.string
[5]: README.md
================================================
FILE: docs/api/DbExtensions/SqlSet_1/Single_1.md
================================================
SqlSet<TResult>.Single(SqlSet.OperatorStringHandler) Method
==============================================================
Returns the only element of the set that satisfies a specified condition, and throws an exception if more than one such element exists.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
| [Single()][2] | The single element of the set. |
| **Single(OperatorStringHandler)** | Returns the only element of the set that satisfies a specified condition, and throws an exception if more than one such element exists. |
| [Single(String)][3] | Returns the only element of the set that satisfies a specified condition, and throws an exception if more than one such element exists. |
Syntax
------
```csharp
public TResult Single(
ref OperatorStringHandler predicate
)
```
#### Parameters
##### *predicate* OperatorStringHandler
A SQL expression to test each row for a condition.
#### Return Value
[TResult][4]
The single element of the set that passes the test in the specified *predicate*.
Exceptions
----------
| Exception | Condition |
| ------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------- |
| [InvalidOperationException][5] | No element satisfies the condition in *predicate*.-or-More than one element satisfies the condition in *predicate*.-or-The set is empty. |
See Also
--------
#### Reference
[SqlSet<TResult> Class][4]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: Single.md
[3]: Single_2.md
[4]: README.md
[5]: https://learn.microsoft.com/dotnet/api/system.invalidoperationexception
================================================
FILE: docs/api/DbExtensions/SqlSet_1/Single_2.md
================================================
SqlSet<TResult>.Single(String) Method
========================================
Returns the only element of the set that satisfies a specified condition, and throws an exception if more than one such element exists.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ---------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
| [Single()][2] | The single element of the set. |
| [Single(OperatorStringHandler)][3] | Returns the only element of the set that satisfies a specified condition, and throws an exception if more than one such element exists. |
| **Single(String)** | Returns the only element of the set that satisfies a specified condition, and throws an exception if more than one such element exists. |
Syntax
------
```csharp
public TResult Single(
string predicate
)
```
#### Parameters
##### *predicate* [String][4]
A SQL expression to test each row for a condition.
#### Return Value
[TResult][5]
The single element of the set that passes the test in the specified *predicate*.
Exceptions
----------
| Exception | Condition |
| ------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------- |
| [InvalidOperationException][6] | No element satisfies the condition in *predicate*.-or-More than one element satisfies the condition in *predicate*.-or-The set is empty. |
See Also
--------
#### Reference
[SqlSet<TResult> Class][5]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: Single.md
[3]: Single_1.md
[4]: https://learn.microsoft.com/dotnet/api/system.string
[5]: README.md
[6]: https://learn.microsoft.com/dotnet/api/system.invalidoperationexception
================================================
FILE: docs/api/DbExtensions/SqlSet_1/Skip.md
================================================
SqlSet<TResult>.Skip Method
==============================
Bypasses a specified number of elements in the set and then returns the remaining elements.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public SqlSet Skip(
int count
)
```
#### Parameters
##### *count* [Int32][2]
The number of elements to skip before returning the remaining elements.
#### Return Value
[SqlSet][3]<[TResult][3]>
A new [SqlSet<TResult>][3] that contains the elements that occur after the specified index in the current set.
See Also
--------
#### Reference
[SqlSet<TResult> Class][3]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: https://learn.microsoft.com/dotnet/api/system.int32
[3]: README.md
================================================
FILE: docs/api/DbExtensions/SqlSet_1/Take.md
================================================
SqlSet<TResult>.Take Method
==============================
Returns a specified number of contiguous elements from the start of the set.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public SqlSet Take(
int count
)
```
#### Parameters
##### *count* [Int32][2]
The number of elements to return.
#### Return Value
[SqlSet][3]<[TResult][3]>
A new [SqlSet<TResult>][3] that contains the specified number of elements from the start of the current set.
See Also
--------
#### Reference
[SqlSet<TResult> Class][3]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: https://learn.microsoft.com/dotnet/api/system.int32
[3]: README.md
================================================
FILE: docs/api/DbExtensions/SqlSet_1/ToArray.md
================================================
SqlSet<TResult>.ToArray Method
=================================
Creates an array from the set.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public TResult[] ToArray()
```
#### Return Value
[TResult][2][]
An array that contains the elements from the set.
See Also
--------
#### Reference
[SqlSet<TResult> Class][2]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: README.md
================================================
FILE: docs/api/DbExtensions/SqlSet_1/ToArrayAsync.md
================================================
SqlSet<TResult>.ToArrayAsync Method
======================================
Creates an array from the set.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public ValueTask ToArrayAsync(
CancellationToken cancellationToken = default
)
```
#### Parameters
##### *cancellationToken* [CancellationToken][2] (Optional)
The [CancellationToken][2] to monitor for cancellation requests. The default is [None][3].
#### Return Value
[ValueTask][4]<[TResult][5][]>
An array that contains the elements from the set.
See Also
--------
#### Reference
[SqlSet<TResult> Class][5]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken
[3]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken.none
[4]: https://learn.microsoft.com/dotnet/api/system.threading.tasks.valuetask-1
[5]: README.md
================================================
FILE: docs/api/DbExtensions/SqlSet_1/ToList.md
================================================
SqlSet<TResult>.ToList Method
================================
Creates a List<TResult> from the set.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public List ToList()
```
#### Return Value
[List][2]<[TResult][3]>
A List<TResult> that contains elements from the set.
See Also
--------
#### Reference
[SqlSet<TResult> Class][3]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: https://learn.microsoft.com/dotnet/api/system.collections.generic.list-1
[3]: README.md
================================================
FILE: docs/api/DbExtensions/SqlSet_1/ToListAsync.md
================================================
SqlSet<TResult>.ToListAsync Method
=====================================
Creates a List<TResult> from the set.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public ValueTask> ToListAsync(
CancellationToken cancellationToken = default
)
```
#### Parameters
##### *cancellationToken* [CancellationToken][2] (Optional)
The [CancellationToken][2] to monitor for cancellation requests. The default is [None][3].
#### Return Value
[ValueTask][4]<[List][5]<[TResult][6]>>
A List<TResult> that contains elements from the set.
See Also
--------
#### Reference
[SqlSet<TResult> Class][6]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken
[3]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken.none
[4]: https://learn.microsoft.com/dotnet/api/system.threading.tasks.valuetask-1
[5]: https://learn.microsoft.com/dotnet/api/system.collections.generic.list-1
[6]: README.md
================================================
FILE: docs/api/DbExtensions/SqlSet_1/Where.md
================================================
SqlSet<TResult>.Where(SqlSet.OperatorStringHandler) Method
=============================================================
Filters the set based on a predicate.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| -------------------------------- | ------------------------------------- |
| **Where(OperatorStringHandler)** | Filters the set based on a predicate. |
| [Where(String)][2] | Filters the set based on a predicate. |
Syntax
------
```csharp
public SqlSet Where(
ref OperatorStringHandler predicate
)
```
#### Parameters
##### *predicate* OperatorStringHandler
A SQL expression to test each row for a condition.
#### Return Value
[SqlSet][3]<[TResult][3]>
A new [SqlSet<TResult>][3] that contains elements from the current set that satisfy the condition.
See Also
--------
#### Reference
[SqlSet<TResult> Class][3]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: Where_1.md
[3]: README.md
================================================
FILE: docs/api/DbExtensions/SqlSet_1/Where_1.md
================================================
SqlSet<TResult>.Where(String) Method
=======================================
Filters the set based on a predicate.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| --------------------------------- | ------------------------------------- |
| [Where(OperatorStringHandler)][2] | Filters the set based on a predicate. |
| **Where(String)** | Filters the set based on a predicate. |
Syntax
------
```csharp
public SqlSet Where(
string predicate
)
```
#### Parameters
##### *predicate* [String][3]
A SQL expression to test each row for a condition.
#### Return Value
[SqlSet][4]<[TResult][4]>
A new [SqlSet<TResult>][4] that contains elements from the current set that satisfy the condition.
See Also
--------
#### Reference
[SqlSet<TResult> Class][4]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: Where.md
[3]: https://learn.microsoft.com/dotnet/api/system.string
[4]: README.md
================================================
FILE: docs/api/DbExtensions/SqlTable/Add.md
================================================
SqlTable.Add Method
===================
Recursively executes INSERT commands for the specified *entity* and all its one-to-one and one-to-many associations.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public void Add(
Object entity
)
```
#### Parameters
##### *entity* [Object][2]
The object whose INSERT command is to be executed. This parameter is named entity for consistency with the other CRUD methods, but in this case it doesn't need to be an actual entity, which means it doesn't need to have a primary key.
See Also
--------
#### Reference
[SqlTable Class][3]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: https://learn.microsoft.com/dotnet/api/system.object
[3]: README.md
================================================
FILE: docs/api/DbExtensions/SqlTable/AddAsync.md
================================================
SqlTable.AddAsync Method
========================
Recursively executes INSERT commands for the specified *entity* and all its one-to-one and one-to-many associations.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public ValueTask AddAsync(
Object entity,
CancellationToken cancellationToken = default
)
```
#### Parameters
##### *entity* [Object][2]
The object whose INSERT command is to be executed. This parameter is named entity for consistency with the other CRUD methods, but in this case it doesn't need to be an actual entity, which means it doesn't need to have a primary key.
##### *cancellationToken* [CancellationToken][3] (Optional)
The [CancellationToken][3] to monitor for cancellation requests. The default is [None][4].
#### Return Value
[ValueTask][5]
See Also
--------
#### Reference
[SqlTable Class][6]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: https://learn.microsoft.com/dotnet/api/system.object
[3]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken
[4]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken.none
[5]: https://learn.microsoft.com/dotnet/api/system.threading.tasks.valuetask
[6]: README.md
================================================
FILE: docs/api/DbExtensions/SqlTable/AddRange.md
================================================
SqlTable.AddRange(IEnumerable<Object>) Method
================================================
Recursively executes INSERT commands for the specified *entities* and all their one-to-one and one-to-many associations.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ |
| **AddRange(IEnumerable<Object>)** | Recursively executes INSERT commands for the specified *entities* and all their one-to-one and one-to-many associations. |
| [AddRange(Object[])][2] | Recursively executes INSERT commands for the specified *entities* and all their one-to-one and one-to-many associations. |
Syntax
------
```csharp
public void AddRange(
IEnumerable entities
)
```
#### Parameters
##### *entities* [IEnumerable][3]<[Object][4]>
The entities whose INSERT commands are to be executed.
See Also
--------
#### Reference
[SqlTable Class][5]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: AddRange_1.md
[3]: https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1
[4]: https://learn.microsoft.com/dotnet/api/system.object
[5]: README.md
================================================
FILE: docs/api/DbExtensions/SqlTable/AddRangeAsync.md
================================================
SqlTable.AddRangeAsync(IEnumerable<Object>, CancellationToken) Method
========================================================================
Recursively executes INSERT commands for the specified *entities* and all their one-to-one and one-to-many associations.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ |
| [AddRangeAsync(Object[])][2] | Recursively executes INSERT commands for the specified *entities* and all their one-to-one and one-to-many associations. |
| **AddRangeAsync(IEnumerable<Object>, CancellationToken)** | Recursively executes INSERT commands for the specified *entities* and all their one-to-one and one-to-many associations. |
Syntax
------
```csharp
public ValueTask AddRangeAsync(
IEnumerable entities,
CancellationToken cancellationToken = default
)
```
#### Parameters
##### *entities* [IEnumerable][3]<[Object][4]>
The entities whose INSERT commands are to be executed.
##### *cancellationToken* [CancellationToken][5] (Optional)
The [CancellationToken][5] to monitor for cancellation requests. The default is [None][6].
#### Return Value
[ValueTask][7]
See Also
--------
#### Reference
[SqlTable Class][8]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: AddRangeAsync_1.md
[3]: https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1
[4]: https://learn.microsoft.com/dotnet/api/system.object
[5]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken
[6]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken.none
[7]: https://learn.microsoft.com/dotnet/api/system.threading.tasks.valuetask
[8]: README.md
================================================
FILE: docs/api/DbExtensions/SqlTable/AddRangeAsync_1.md
================================================
SqlTable.AddRangeAsync(Object[]) Method
=======================================
Recursively executes INSERT commands for the specified *entities* and all their one-to-one and one-to-many associations.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------ |
| **AddRangeAsync(Object[])** | Recursively executes INSERT commands for the specified *entities* and all their one-to-one and one-to-many associations. |
| [AddRangeAsync(IEnumerable<Object>, CancellationToken)][2] | Recursively executes INSERT commands for the specified *entities* and all their one-to-one and one-to-many associations. |
Syntax
------
```csharp
public ValueTask AddRangeAsync(
params Object[] entities
)
```
#### Parameters
##### *entities* [Object][3][]
The entities whose INSERT commands are to be executed.
#### Return Value
[ValueTask][4]
See Also
--------
#### Reference
[SqlTable Class][5]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: AddRangeAsync.md
[3]: https://learn.microsoft.com/dotnet/api/system.object
[4]: https://learn.microsoft.com/dotnet/api/system.threading.tasks.valuetask
[5]: README.md
================================================
FILE: docs/api/DbExtensions/SqlTable/AddRange_1.md
================================================
SqlTable.AddRange(Object[]) Method
==================================
Recursively executes INSERT commands for the specified *entities* and all their one-to-one and one-to-many associations.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ------------------------------------- | ------------------------------------------------------------------------------------------------------------------------ |
| [AddRange(IEnumerable<Object>)][2] | Recursively executes INSERT commands for the specified *entities* and all their one-to-one and one-to-many associations. |
| **AddRange(Object[])** | Recursively executes INSERT commands for the specified *entities* and all their one-to-one and one-to-many associations. |
Syntax
------
```csharp
public void AddRange(
params Object[] entities
)
```
#### Parameters
##### *entities* [Object][3][]
The entities whose INSERT commands are to be executed.
See Also
--------
#### Reference
[SqlTable Class][4]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: AddRange.md
[3]: https://learn.microsoft.com/dotnet/api/system.object
[4]: README.md
================================================
FILE: docs/api/DbExtensions/SqlTable/Cast__1.md
================================================
SqlTable.Cast<TEntity> Method
================================
Casts the current [SqlTable][1] to the generic [SqlTable<TEntity>][2] instance.
**Namespace:** [DbExtensions][3]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ---------------------- | ---------------------------------------------------------------------------------- |
| [Cast(Type)][4] | Casts the elements of the set to the specified type. |
| **Cast<TEntity>()** | Casts the current [SqlTable][1] to the generic [SqlTable<TEntity>][2] instance. |
Syntax
------
```csharp
public SqlTable Cast()
where TEntity : class
```
#### Type Parameters
##### *TEntity*
The type of the entity.
#### Return Value
[SqlTable][2]<**TEntity**>
The [SqlTable<TEntity>][2] instance for TEntity.
Exceptions
----------
| Exception | Condition |
| ------------------------------ | ----------------------------------------------------- |
| [InvalidOperationException][5] | The specified TEntity is not valid for this instance. |
See Also
--------
#### Reference
[SqlTable Class][1]
[DbExtensions Namespace][3]
[1]: README.md
[2]: ../SqlTable_1/README.md
[3]: ../README.md
[4]: ../SqlSet/Cast.md
[5]: https://learn.microsoft.com/dotnet/api/system.invalidoperationexception
================================================
FILE: docs/api/DbExtensions/SqlTable/Name.md
================================================
SqlTable.Name Property
======================
Gets the name of the table.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public string Name { get; }
```
#### Property Value
[String][2]
See Also
--------
#### Reference
[SqlTable Class][3]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: https://learn.microsoft.com/dotnet/api/system.string
[3]: README.md
================================================
FILE: docs/api/DbExtensions/SqlTable/README.md
================================================
SqlTable Class
==============
A non-generic version of [SqlTable<TEntity>][1] which can be used when the type of the entity is not known at build time. This class cannot be instantiated, to get an instance use the [Database.Table(Type)][2] method.
Inheritance Hierarchy
---------------------
[System.Object][3]
[DbExtensions.SqlSet][4]
**DbExtensions.SqlTable**
**Namespace:** [DbExtensions][5]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public sealed class SqlTable : SqlSet
```
The **SqlTable** type exposes the following members.
Properties
----------
| Name | Description |
| --------------- | -------------------------------------------------------------------------------------------------- |
| [Database][6] | The [Database][7] this set is connected to. (Inherited from [SqlSet][4]) |
| [Name][8] | Gets the name of the table. |
| [ResultType][9] | The type of objects this set returns. This property can be null. (Inherited from [SqlSet][4]) |
Methods
-------
| Name | Description |
| ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| [Add][10] | Recursively executes INSERT commands for the specified *entity* and all its one-to-one and one-to-many associations. |
| [AddAsync][11] | Recursively executes INSERT commands for the specified *entity* and all its one-to-one and one-to-many associations. |
| [AddRange(IEnumerable<Object>)][12] | Recursively executes INSERT commands for the specified *entities* and all their one-to-one and one-to-many associations. |
| [AddRange(Object[])][13] | Recursively executes INSERT commands for the specified *entities* and all their one-to-one and one-to-many associations. |
| [AddRangeAsync(Object[])][14] | Recursively executes INSERT commands for the specified *entities* and all their one-to-one and one-to-many associations. |
| [AddRangeAsync(IEnumerable<Object>, CancellationToken)][15] | Recursively executes INSERT commands for the specified *entities* and all their one-to-one and one-to-many associations. |
| [All(OperatorStringHandler)][16] | Determines whether all elements of the set satisfy a condition. (Inherited from [SqlSet][4]) |
| [All(String)][17] | Determines whether all elements of the set satisfy a condition. (Inherited from [SqlSet][4]) |
| [AllAsync(OperatorStringHandler, CancellationToken)][18] | Determines whether all elements of the set satisfy a condition. (Inherited from [SqlSet][4]) |
| [AllAsync(String, CancellationToken)][19] | Determines whether all elements of the set satisfy a condition. (Inherited from [SqlSet][4]) |
| [Any()][20] | Determines whether the set contains any elements. (Inherited from [SqlSet][4]) |
| [Any(OperatorStringHandler)][21] | Determines whether any element of the set satisfies a condition. (Inherited from [SqlSet][4]) |
| [Any(String)][22] | Determines whether any element of the set satisfies a condition. (Inherited from [SqlSet][4]) |
| [AnyAsync(CancellationToken)][23] | Determines whether the set contains any elements. (Inherited from [SqlSet][4]) |
| [AnyAsync(OperatorStringHandler, CancellationToken)][24] | Determines whether any element of the set satisfies a condition. (Inherited from [SqlSet][4]) |
| [AnyAsync(String, CancellationToken)][25] | Determines whether any element of the set satisfies a condition. (Inherited from [SqlSet][4]) |
| [AsAsyncEnumerable][26] | Gets all elements in the set. The query is deferred-executed. (Inherited from [SqlSet][4]) |
| [AsEnumerable][27] | Gets all elements in the set. The query is deferred-executed. (Inherited from [SqlSet][4]) |
| [Cast(Type)][28] | Casts the elements of the set to the specified type. (Inherited from [SqlSet][4]) |
| [Cast<TEntity>()][29] | Casts the current **SqlTable** to the generic [SqlTable<TEntity>][1] instance. |
| [Contains][30] | Checks the existance of the *entity*, using the primary key value. (Inherited from [SqlSet][4]) |
| [ContainsAsync][31] | Checks the existance of the *entity*, using the primary key value. (Inherited from [SqlSet][4]) |
| [ContainsKey][32] | Checks the existance of an entity whose primary matches the *id* parameter. (Inherited from [SqlSet][4]) |
| [ContainsKeyAsync][33] | Checks the existance of an entity whose primary matches the *id* parameter. (Inherited from [SqlSet][4]) |
| [Count()][34] | Returns the number of elements in the set. (Inherited from [SqlSet][4]) |
| [Count(OperatorStringHandler)][35] | Returns a number that represents how many elements in the set satisfy a condition. (Inherited from [SqlSet][4]) |
| [Count(String)][36] | Returns a number that represents how many elements in the set satisfy a condition. (Inherited from [SqlSet][4]) |
| [CountAsync(CancellationToken)][37] | Returns the number of elements in the set. (Inherited from [SqlSet][4]) |
| [CountAsync(OperatorStringHandler, CancellationToken)][38] | Returns a number that represents how many elements in the set satisfy a condition. (Inherited from [SqlSet][4]) |
| [CountAsync(String, CancellationToken)][39] | Returns a number that represents how many elements in the set satisfy a condition. (Inherited from [SqlSet][4]) |
| [Find][40] | Gets the entity whose primary key matches the *id* parameter. (Inherited from [SqlSet][4]) |
| [FindAsync][41] | Gets the entity whose primary key matches the *id* parameter. (Inherited from [SqlSet][4]) |
| [First()][42] | Returns the first element of the set. (Inherited from [SqlSet][4]) |
| [First(OperatorStringHandler)][43] | Returns the first element in the set that satisfies a specified condition. (Inherited from [SqlSet][4]) |
| [First(String)][44] | Returns the first element in the set that satisfies a specified condition. (Inherited from [SqlSet][4]) |
| [FirstAsync(CancellationToken)][45] | Returns the first element of the set. (Inherited from [SqlSet][4]) |
| [FirstAsync(OperatorStringHandler, CancellationToken)][46] | Returns the first element in the set that satisfies a specified condition. (Inherited from [SqlSet][4]) |
| [FirstAsync(String, CancellationToken)][47] | Returns the first element in the set that satisfies a specified condition. (Inherited from [SqlSet][4]) |
| [FirstOrDefault()][48] | Returns the first element of the set, or a default value if the set contains no elements. (Inherited from [SqlSet][4]) |
| [FirstOrDefault(OperatorStringHandler)][49] | Returns the first element of the set that satisfies a condition or a default value if no such element is found. (Inherited from [SqlSet][4]) |
| [FirstOrDefault(String)][50] | Returns the first element of the set that satisfies a condition or a default value if no such element is found. (Inherited from [SqlSet][4]) |
| [FirstOrDefaultAsync(CancellationToken)][51] | Returns the first element of the set, or a default value if the set contains no elements. (Inherited from [SqlSet][4]) |
| [FirstOrDefaultAsync(OperatorStringHandler, CancellationToken)][52] | Returns the first element of the set that satisfies a condition or a default value if no such element is found. (Inherited from [SqlSet][4]) |
| [FirstOrDefaultAsync(String, CancellationToken)][53] | Returns the first element of the set that satisfies a condition or a default value if no such element is found. (Inherited from [SqlSet][4]) |
| [GetAsyncEnumerator][54] | Returns an async enumerator that iterates through the set. (Inherited from [SqlSet][4]) |
| [GetDefiningQuery][55] | Returns the SQL query that is the source of data for the set. (Inherited from [SqlSet][4]) |
| [GetEnumerator][56] | Returns an enumerator that iterates through the set. (Inherited from [SqlSet][4]) |
| [Include][57] | Specifies the related objects to include in the query results. (Inherited from [SqlSet][4]) |
| [IncludeMany][58] | Specifies which collections to include in the query results. (Inherited from [SqlSet][4]) |
| [LongCount()][59] | Returns an [Int64][60] that represents the total number of elements in the set. (Inherited from [SqlSet][4]) |
| [LongCount(OperatorStringHandler)][61] | Returns an [Int64][60] that represents how many elements in the set satisfy a condition. (Inherited from [SqlSet][4]) |
| [LongCount(String)][62] | Returns an [Int64][60] that represents how many elements in the set satisfy a condition. (Inherited from [SqlSet][4]) |
| [LongCountAsync(CancellationToken)][63] | Returns an [Int64][60] that represents the total number of elements in the set. (Inherited from [SqlSet][4]) |
| [LongCountAsync(OperatorStringHandler, CancellationToken)][64] | Returns an [Int64][60] that represents how many elements in the set satisfy a condition. (Inherited from [SqlSet][4]) |
| [LongCountAsync(String, CancellationToken)][65] | Returns an [Int64][60] that represents how many elements in the set satisfy a condition. (Inherited from [SqlSet][4]) |
| [OrderBy(OperatorStringHandler)][66] | Sorts the elements of the set according to the *columnList*. (Inherited from [SqlSet][4]) |
| [OrderBy(String)][67] | Sorts the elements of the set according to the *columnList*. (Inherited from [SqlSet][4]) |
| [Refresh][68] | Sets all column members of *entity* to their most current persisted value. |
| [RefreshAsync][69] | Sets all column members of *entity* to their most current persisted value. |
| [Remove][70] | Executes a DELETE command for the specified *entity*. |
| [RemoveAsync][71] | Executes a DELETE command for the specified *entity*. |
| [RemoveKey][72] | Executes a DELETE command for the entity whose primary key matches the *id* parameter. |
| [RemoveKeyAsync][73] | Executes a DELETE command for the entity whose primary key matches the *id* parameter. |
| [RemoveRange(IEnumerable<Object>)][74] | Executes DELETE commands for the specified *entities*. |
| [RemoveRange(Object[])][75] | Executes DELETE commands for the specified *entities*. |
| [RemoveRangeAsync(Object[])][76] | Executes DELETE commands for the specified *entities*. |
| [RemoveRangeAsync(IEnumerable<Object>, CancellationToken)][77] | Executes DELETE commands for the specified *entities*. |
| [Select(OperatorStringHandler, Type)][78] | Projects each element of the set into a new form. (Inherited from [SqlSet][4]) |
| [Select(String, Type)][79] | Projects each element of the set into a new form. (Inherited from [SqlSet][4]) |
| [Select<TResult>(OperatorStringHandler)][80] | Projects each element of the set into a new form. (Inherited from [SqlSet][4]) |
| [Select<TResult>(String)][81] | Projects each element of the set into a new form. (Inherited from [SqlSet][4]) |
| [Select<TResult>(OperatorStringHandler, Func<DbDataReader, TResult>)][82] | Projects each element of the set into a new form. (Inherited from [SqlSet][4]) |
| [Select<TResult>(String, Func<DbDataReader, TResult>)][83] | Projects each element of the set into a new form. (Inherited from [SqlSet][4]) |
| [Single()][84] | The single element of the set. (Inherited from [SqlSet][4]) |
| [Single(OperatorStringHandler)][85] | Returns the only element of the set that satisfies a specified condition, and throws an exception if more than one such element exists. (Inherited from [SqlSet][4]) |
| [Single(String)][86] | Returns the only element of the set that satisfies a specified condition, and throws an exception if more than one such element exists. (Inherited from [SqlSet][4]) |
| [SingleAsync(CancellationToken)][87] | The single element of the set. (Inherited from [SqlSet][4]) |
| [SingleAsync(OperatorStringHandler, CancellationToken)][88] | Returns the only element of the set that satisfies a specified condition, and throws an exception if more than one such element exists. (Inherited from [SqlSet][4]) |
| [SingleAsync(String, CancellationToken)][89] | Returns the only element of the set that satisfies a specified condition, and throws an exception if more than one such element exists. (Inherited from [SqlSet][4]) |
| [SingleOrDefault()][90] | Returns the only element of the set, or a default value if the set is empty; this method throws an exception if there is more than one element in the set. (Inherited from [SqlSet][4]) |
| [SingleOrDefault(OperatorStringHandler)][91] | Returns the only element of the set that satisfies a specified condition or a default value if no such element exists; this method throws an exception if more than one element satisfies the condition. (Inherited from [SqlSet][4]) |
| [SingleOrDefault(String)][92] | Returns the only element of the set that satisfies a specified condition or a default value if no such element exists; this method throws an exception if more than one element satisfies the condition. (Inherited from [SqlSet][4]) |
| [SingleOrDefaultAsync(CancellationToken)][93] | Returns the only element of the set, or a default value if the set is empty; this method throws an exception if there is more than one element in the set. (Inherited from [SqlSet][4]) |
| [SingleOrDefaultAsync(OperatorStringHandler, CancellationToken)][94] | Returns the only element of the set that satisfies a specified condition or a default value if no such element exists; this method throws an exception if more than one element satisfies the condition. (Inherited from [SqlSet][4]) |
| [SingleOrDefaultAsync(String, CancellationToken)][95] | Returns the only element of the set that satisfies a specified condition or a default value if no such element exists; this method throws an exception if more than one element satisfies the condition. (Inherited from [SqlSet][4]) |
| [Skip][96] | Bypasses a specified number of elements in the set and then returns the remaining elements. (Inherited from [SqlSet][4]) |
| [Take][97] | Returns a specified number of contiguous elements from the start of the set. (Inherited from [SqlSet][4]) |
| [ToArray][98] | Creates an array from the set. (Inherited from [SqlSet][4]) |
| [ToArrayAsync][99] | Creates an array from the set. (Inherited from [SqlSet][4]) |
| [ToList][100] | Creates a [List<T>][101] from the set. (Inherited from [SqlSet][4]) |
| [ToListAsync][102] | Creates a [List<T>][101] from the set. (Inherited from [SqlSet][4]) |
| [ToString][103] | Returns the SQL query of the set. (Inherited from [SqlSet][4]) |
| [Update(Object)][104] | Executes an UPDATE command for the specified *entity*. |
| [Update(Object, Object)][105] | Executes an UPDATE command for the specified *entity*. |
| [UpdateAsync(Object, CancellationToken)][106] | Executes an UPDATE command for the specified *entity*. |
| [UpdateAsync(Object, Object, CancellationToken)][107] | Executes an UPDATE command for the specified *entity*. |
| [UpdateRange(IEnumerable<Object>)][108] | Executes UPDATE commands for the specified *entities*. |
| [UpdateRange(Object[])][109] | Executes UPDATE commands for the specified *entities*. |
| [UpdateRangeAsync(Object[])][110] | Executes UPDATE commands for the specified *entities*. |
| [UpdateRangeAsync(IEnumerable<Object>, CancellationToken)][111] | Executes UPDATE commands for the specified *entities*. |
| [Where(OperatorStringHandler)][112] | Filters the set based on a predicate. (Inherited from [SqlSet][4]) |
| [Where(String)][113] | Filters the set based on a predicate. (Inherited from [SqlSet][4]) |
See Also
--------
#### Reference
[DbExtensions Namespace][5]
[1]: ../SqlTable_1/README.md
[2]: ../Database/Table.md
[3]: https://learn.microsoft.com/dotnet/api/system.object
[4]: ../SqlSet/README.md
[5]: ../README.md
[6]: ../SqlSet/Database.md
[7]: ../Database/README.md
[8]: Name.md
[9]: ../SqlSet/ResultType.md
[10]: Add.md
[11]: AddAsync.md
[12]: AddRange.md
[13]: AddRange_1.md
[14]: AddRangeAsync_1.md
[15]: AddRangeAsync.md
[16]: ../SqlSet/All.md
[17]: ../SqlSet/All_1.md
[18]: ../SqlSet/AllAsync.md
[19]: ../SqlSet/AllAsync_1.md
[20]: ../SqlSet/Any.md
[21]: ../SqlSet/Any_1.md
[22]: ../SqlSet/Any_2.md
[23]: ../SqlSet/AnyAsync_2.md
[24]: ../SqlSet/AnyAsync.md
[25]: ../SqlSet/AnyAsync_1.md
[26]: ../SqlSet/AsAsyncEnumerable.md
[27]: ../SqlSet/AsEnumerable.md
[28]: ../SqlSet/Cast.md
[29]: Cast__1.md
[30]: ../SqlSet/Contains.md
[31]: ../SqlSet/ContainsAsync.md
[32]: ../SqlSet/ContainsKey.md
[33]: ../SqlSet/ContainsKeyAsync.md
[34]: ../SqlSet/Count.md
[35]: ../SqlSet/Count_1.md
[36]: ../SqlSet/Count_2.md
[37]: ../SqlSet/CountAsync_2.md
[38]: ../SqlSet/CountAsync.md
[39]: ../SqlSet/CountAsync_1.md
[40]: ../SqlSet/Find.md
[41]: ../SqlSet/FindAsync.md
[42]: ../SqlSet/First.md
[43]: ../SqlSet/First_1.md
[44]: ../SqlSet/First_2.md
[45]: ../SqlSet/FirstAsync_2.md
[46]: ../SqlSet/FirstAsync.md
[47]: ../SqlSet/FirstAsync_1.md
[48]: ../SqlSet/FirstOrDefault.md
[49]: ../SqlSet/FirstOrDefault_1.md
[50]: ../SqlSet/FirstOrDefault_2.md
[51]: ../SqlSet/FirstOrDefaultAsync_2.md
[52]: ../SqlSet/FirstOrDefaultAsync.md
[53]: ../SqlSet/FirstOrDefaultAsync_1.md
[54]: ../SqlSet/GetAsyncEnumerator.md
[55]: ../SqlSet/GetDefiningQuery.md
[56]: ../SqlSet/GetEnumerator.md
[57]: ../SqlSet/Include.md
[58]: ../SqlSet/IncludeMany.md
[59]: ../SqlSet/LongCount.md
[60]: https://learn.microsoft.com/dotnet/api/system.int64
[61]: ../SqlSet/LongCount_1.md
[62]: ../SqlSet/LongCount_2.md
[63]: ../SqlSet/LongCountAsync_2.md
[64]: ../SqlSet/LongCountAsync.md
[65]: ../SqlSet/LongCountAsync_1.md
[66]: ../SqlSet/OrderBy.md
[67]: ../SqlSet/OrderBy_1.md
[68]: Refresh.md
[69]: RefreshAsync.md
[70]: Remove.md
[71]: RemoveAsync.md
[72]: RemoveKey.md
[73]: RemoveKeyAsync.md
[74]: RemoveRange.md
[75]: RemoveRange_1.md
[76]: RemoveRangeAsync_1.md
[77]: RemoveRangeAsync.md
[78]: ../SqlSet/Select_1.md
[79]: ../SqlSet/Select_3.md
[80]: ../SqlSet/Select__1.md
[81]: ../SqlSet/Select__1_2.md
[82]: ../SqlSet/Select__1_1.md
[83]: ../SqlSet/Select__1_3.md
[84]: ../SqlSet/Single.md
[85]: ../SqlSet/Single_1.md
[86]: ../SqlSet/Single_2.md
[87]: ../SqlSet/SingleAsync_2.md
[88]: ../SqlSet/SingleAsync.md
[89]: ../SqlSet/SingleAsync_1.md
[90]: ../SqlSet/SingleOrDefault.md
[91]: ../SqlSet/SingleOrDefault_1.md
[92]: ../SqlSet/SingleOrDefault_2.md
[93]: ../SqlSet/SingleOrDefaultAsync_2.md
[94]: ../SqlSet/SingleOrDefaultAsync.md
[95]: ../SqlSet/SingleOrDefaultAsync_1.md
[96]: ../SqlSet/Skip.md
[97]: ../SqlSet/Take.md
[98]: ../SqlSet/ToArray.md
[99]: ../SqlSet/ToArrayAsync.md
[100]: ../SqlSet/ToList.md
[101]: https://learn.microsoft.com/dotnet/api/system.collections.generic.list-1
[102]: ../SqlSet/ToListAsync.md
[103]: ../SqlSet/ToString.md
[104]: Update.md
[105]: Update_1.md
[106]: UpdateAsync_1.md
[107]: UpdateAsync.md
[108]: UpdateRange.md
[109]: UpdateRange_1.md
[110]: UpdateRangeAsync_1.md
[111]: UpdateRangeAsync.md
[112]: ../SqlSet/Where.md
[113]: ../SqlSet/Where_1.md
================================================
FILE: docs/api/DbExtensions/SqlTable/Refresh.md
================================================
SqlTable.Refresh Method
=======================
Sets all column members of *entity* to their most current persisted value.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public void Refresh(
Object entity
)
```
#### Parameters
##### *entity* [Object][2]
The entity to refresh.
See Also
--------
#### Reference
[SqlTable Class][3]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: https://learn.microsoft.com/dotnet/api/system.object
[3]: README.md
================================================
FILE: docs/api/DbExtensions/SqlTable/RefreshAsync.md
================================================
SqlTable.RefreshAsync Method
============================
Sets all column members of *entity* to their most current persisted value.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public ValueTask RefreshAsync(
Object entity,
CancellationToken cancellationToken = default
)
```
#### Parameters
##### *entity* [Object][2]
The entity to refresh.
##### *cancellationToken* [CancellationToken][3] (Optional)
The [CancellationToken][3] to monitor for cancellation requests. The default is [None][4].
#### Return Value
[ValueTask][5]
See Also
--------
#### Reference
[SqlTable Class][6]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: https://learn.microsoft.com/dotnet/api/system.object
[3]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken
[4]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken.none
[5]: https://learn.microsoft.com/dotnet/api/system.threading.tasks.valuetask
[6]: README.md
================================================
FILE: docs/api/DbExtensions/SqlTable/Remove.md
================================================
SqlTable.Remove Method
======================
Executes a DELETE command for the specified *entity*.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public bool Remove(
Object entity
)
```
#### Parameters
##### *entity* [Object][2]
The entity whose DELETE command is to be executed.
#### Return Value
[Boolean][3]
`true` if *entity* is deleted; otherwise, `false`.
See Also
--------
#### Reference
[SqlTable Class][4]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: https://learn.microsoft.com/dotnet/api/system.object
[3]: https://learn.microsoft.com/dotnet/api/system.boolean
[4]: README.md
================================================
FILE: docs/api/DbExtensions/SqlTable/RemoveAsync.md
================================================
SqlTable.RemoveAsync Method
===========================
Executes a DELETE command for the specified *entity*.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public ValueTask RemoveAsync(
Object entity,
CancellationToken cancellationToken = default
)
```
#### Parameters
##### *entity* [Object][2]
The entity whose DELETE command is to be executed.
##### *cancellationToken* [CancellationToken][3] (Optional)
The [CancellationToken][3] to monitor for cancellation requests. The default is [None][4].
#### Return Value
[ValueTask][5]<[Boolean][6]>
`true` if *entity* is deleted; otherwise, `false`.
See Also
--------
#### Reference
[SqlTable Class][7]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: https://learn.microsoft.com/dotnet/api/system.object
[3]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken
[4]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken.none
[5]: https://learn.microsoft.com/dotnet/api/system.threading.tasks.valuetask-1
[6]: https://learn.microsoft.com/dotnet/api/system.boolean
[7]: README.md
================================================
FILE: docs/api/DbExtensions/SqlTable/RemoveKey.md
================================================
SqlTable.RemoveKey Method
=========================
Executes a DELETE command for the entity whose primary key matches the *id* parameter.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public bool RemoveKey(
Object id
)
```
#### Parameters
##### *id* [Object][2]
The primary key value.
#### Return Value
[Boolean][3]
`true` if a record that matches *id* was found and deleted; otherwise, `false`.
See Also
--------
#### Reference
[SqlTable Class][4]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: https://learn.microsoft.com/dotnet/api/system.object
[3]: https://learn.microsoft.com/dotnet/api/system.boolean
[4]: README.md
================================================
FILE: docs/api/DbExtensions/SqlTable/RemoveKeyAsync.md
================================================
SqlTable.RemoveKeyAsync Method
==============================
Executes a DELETE command for the entity whose primary key matches the *id* parameter.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public ValueTask RemoveKeyAsync(
Object id,
CancellationToken cancellationToken = default
)
```
#### Parameters
##### *id* [Object][2]
The primary key value.
##### *cancellationToken* [CancellationToken][3] (Optional)
The [CancellationToken][3] to monitor for cancellation requests. The default is [None][4].
#### Return Value
[ValueTask][5]<[Boolean][6]>
`true` if a record that matches *id* was found and deleted; otherwise, `false`.
See Also
--------
#### Reference
[SqlTable Class][7]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: https://learn.microsoft.com/dotnet/api/system.object
[3]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken
[4]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken.none
[5]: https://learn.microsoft.com/dotnet/api/system.threading.tasks.valuetask-1
[6]: https://learn.microsoft.com/dotnet/api/system.boolean
[7]: README.md
================================================
FILE: docs/api/DbExtensions/SqlTable/RemoveRange.md
================================================
SqlTable.RemoveRange(IEnumerable<Object>) Method
===================================================
Executes DELETE commands for the specified *entities*.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| --------------------------------------- | ------------------------------------------------------ |
| **RemoveRange(IEnumerable<Object>)** | Executes DELETE commands for the specified *entities*. |
| [RemoveRange(Object[])][2] | Executes DELETE commands for the specified *entities*. |
Syntax
------
```csharp
public void RemoveRange(
IEnumerable entities
)
```
#### Parameters
##### *entities* [IEnumerable][3]<[Object][4]>
The entities whose DELETE commands are to be executed.
See Also
--------
#### Reference
[SqlTable Class][5]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: RemoveRange_1.md
[3]: https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1
[4]: https://learn.microsoft.com/dotnet/api/system.object
[5]: README.md
================================================
FILE: docs/api/DbExtensions/SqlTable/RemoveRangeAsync.md
================================================
SqlTable.RemoveRangeAsync(IEnumerable<Object>, CancellationToken) Method
===========================================================================
Executes DELETE commands for the specified *entities*.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| --------------------------------------------------------------- | ------------------------------------------------------ |
| [RemoveRangeAsync(Object[])][2] | Executes DELETE commands for the specified *entities*. |
| **RemoveRangeAsync(IEnumerable<Object>, CancellationToken)** | Executes DELETE commands for the specified *entities*. |
Syntax
------
```csharp
public ValueTask RemoveRangeAsync(
IEnumerable entities,
CancellationToken cancellationToken = default
)
```
#### Parameters
##### *entities* [IEnumerable][3]<[Object][4]>
The entities whose DELETE commands are to be executed.
##### *cancellationToken* [CancellationToken][5] (Optional)
The [CancellationToken][5] to monitor for cancellation requests. The default is [None][6].
#### Return Value
[ValueTask][7]
See Also
--------
#### Reference
[SqlTable Class][8]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: RemoveRangeAsync_1.md
[3]: https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1
[4]: https://learn.microsoft.com/dotnet/api/system.object
[5]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken
[6]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken.none
[7]: https://learn.microsoft.com/dotnet/api/system.threading.tasks.valuetask
[8]: README.md
================================================
FILE: docs/api/DbExtensions/SqlTable/RemoveRangeAsync_1.md
================================================
SqlTable.RemoveRangeAsync(Object[]) Method
==========================================
Executes DELETE commands for the specified *entities*.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ---------------------------------------------------------------- | ------------------------------------------------------ |
| **RemoveRangeAsync(Object[])** | Executes DELETE commands for the specified *entities*. |
| [RemoveRangeAsync(IEnumerable<Object>, CancellationToken)][2] | Executes DELETE commands for the specified *entities*. |
Syntax
------
```csharp
public ValueTask RemoveRangeAsync(
params Object[] entities
)
```
#### Parameters
##### *entities* [Object][3][]
The entities whose DELETE commands are to be executed.
#### Return Value
[ValueTask][4]
See Also
--------
#### Reference
[SqlTable Class][5]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: RemoveRangeAsync.md
[3]: https://learn.microsoft.com/dotnet/api/system.object
[4]: https://learn.microsoft.com/dotnet/api/system.threading.tasks.valuetask
[5]: README.md
================================================
FILE: docs/api/DbExtensions/SqlTable/RemoveRange_1.md
================================================
SqlTable.RemoveRange(Object[]) Method
=====================================
Executes DELETE commands for the specified *entities*.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ---------------------------------------- | ------------------------------------------------------ |
| [RemoveRange(IEnumerable<Object>)][2] | Executes DELETE commands for the specified *entities*. |
| **RemoveRange(Object[])** | Executes DELETE commands for the specified *entities*. |
Syntax
------
```csharp
public void RemoveRange(
params Object[] entities
)
```
#### Parameters
##### *entities* [Object][3][]
The entities whose DELETE commands are to be executed.
See Also
--------
#### Reference
[SqlTable Class][4]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: RemoveRange.md
[3]: https://learn.microsoft.com/dotnet/api/system.object
[4]: README.md
================================================
FILE: docs/api/DbExtensions/SqlTable/Update.md
================================================
SqlTable.Update(Object) Method
==============================
Executes an UPDATE command for the specified *entity*.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| --------------------------- | ------------------------------------------------------ |
| **Update(Object)** | Executes an UPDATE command for the specified *entity*. |
| [Update(Object, Object)][2] | Executes an UPDATE command for the specified *entity*. |
Syntax
------
```csharp
public void Update(
Object entity
)
```
#### Parameters
##### *entity* [Object][3]
The entity whose UPDATE command is to be executed.
See Also
--------
#### Reference
[SqlTable Class][4]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: Update_1.md
[3]: https://learn.microsoft.com/dotnet/api/system.object
[4]: README.md
================================================
FILE: docs/api/DbExtensions/SqlTable/UpdateAsync.md
================================================
SqlTable.UpdateAsync(Object, Object, CancellationToken) Method
==============================================================
Executes an UPDATE command for the specified *entity*.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| -------------------------------------------------- | ------------------------------------------------------ |
| [UpdateAsync(Object, CancellationToken)][2] | Executes an UPDATE command for the specified *entity*. |
| **UpdateAsync(Object, Object, CancellationToken)** | Executes an UPDATE command for the specified *entity*. |
Syntax
------
```csharp
public ValueTask UpdateAsync(
Object entity,
Object? originalId,
CancellationToken cancellationToken = default
)
```
#### Parameters
##### *entity* [Object][3]
The entity whose UPDATE command is to be executed.
##### *originalId* [Object][3]
The original primary key value.
##### *cancellationToken* [CancellationToken][4] (Optional)
The [CancellationToken][4] to monitor for cancellation requests. The default is [None][5].
#### Return Value
[ValueTask][6]
Remarks
-------
This overload is helpful when the entity uses an assigned primary key.
See Also
--------
#### Reference
[SqlTable Class][7]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: UpdateAsync_1.md
[3]: https://learn.microsoft.com/dotnet/api/system.object
[4]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken
[5]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken.none
[6]: https://learn.microsoft.com/dotnet/api/system.threading.tasks.valuetask
[7]: README.md
================================================
FILE: docs/api/DbExtensions/SqlTable/UpdateAsync_1.md
================================================
SqlTable.UpdateAsync(Object, CancellationToken) Method
======================================================
Executes an UPDATE command for the specified *entity*.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| --------------------------------------------------- | ------------------------------------------------------ |
| **UpdateAsync(Object, CancellationToken)** | Executes an UPDATE command for the specified *entity*. |
| [UpdateAsync(Object, Object, CancellationToken)][2] | Executes an UPDATE command for the specified *entity*. |
Syntax
------
```csharp
public ValueTask UpdateAsync(
Object entity,
CancellationToken cancellationToken = default
)
```
#### Parameters
##### *entity* [Object][3]
The entity whose UPDATE command is to be executed.
##### *cancellationToken* [CancellationToken][4] (Optional)
The [CancellationToken][4] to monitor for cancellation requests. The default is [None][5].
#### Return Value
[ValueTask][6]
See Also
--------
#### Reference
[SqlTable Class][7]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: UpdateAsync.md
[3]: https://learn.microsoft.com/dotnet/api/system.object
[4]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken
[5]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken.none
[6]: https://learn.microsoft.com/dotnet/api/system.threading.tasks.valuetask
[7]: README.md
================================================
FILE: docs/api/DbExtensions/SqlTable/UpdateRange.md
================================================
SqlTable.UpdateRange(IEnumerable<Object>) Method
===================================================
Executes UPDATE commands for the specified *entities*.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| --------------------------------------- | ------------------------------------------------------ |
| **UpdateRange(IEnumerable<Object>)** | Executes UPDATE commands for the specified *entities*. |
| [UpdateRange(Object[])][2] | Executes UPDATE commands for the specified *entities*. |
Syntax
------
```csharp
public void UpdateRange(
IEnumerable entities
)
```
#### Parameters
##### *entities* [IEnumerable][3]<[Object][4]>
The entities whose UPDATE commands are to be executed.
See Also
--------
#### Reference
[SqlTable Class][5]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: UpdateRange_1.md
[3]: https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1
[4]: https://learn.microsoft.com/dotnet/api/system.object
[5]: README.md
================================================
FILE: docs/api/DbExtensions/SqlTable/UpdateRangeAsync.md
================================================
SqlTable.UpdateRangeAsync(IEnumerable<Object>, CancellationToken) Method
===========================================================================
Executes UPDATE commands for the specified *entities*.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| --------------------------------------------------------------- | ------------------------------------------------------ |
| [UpdateRangeAsync(Object[])][2] | Executes UPDATE commands for the specified *entities*. |
| **UpdateRangeAsync(IEnumerable<Object>, CancellationToken)** | Executes UPDATE commands for the specified *entities*. |
Syntax
------
```csharp
public ValueTask UpdateRangeAsync(
IEnumerable entities,
CancellationToken cancellationToken = default
)
```
#### Parameters
##### *entities* [IEnumerable][3]<[Object][4]>
The entities whose UPDATE commands are to be executed.
##### *cancellationToken* [CancellationToken][5] (Optional)
The [CancellationToken][5] to monitor for cancellation requests. The default is [None][6].
#### Return Value
[ValueTask][7]
See Also
--------
#### Reference
[SqlTable Class][8]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: UpdateRangeAsync_1.md
[3]: https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1
[4]: https://learn.microsoft.com/dotnet/api/system.object
[5]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken
[6]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken.none
[7]: https://learn.microsoft.com/dotnet/api/system.threading.tasks.valuetask
[8]: README.md
================================================
FILE: docs/api/DbExtensions/SqlTable/UpdateRangeAsync_1.md
================================================
SqlTable.UpdateRangeAsync(Object[]) Method
==========================================
Executes UPDATE commands for the specified *entities*.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ---------------------------------------------------------------- | ------------------------------------------------------ |
| **UpdateRangeAsync(Object[])** | Executes UPDATE commands for the specified *entities*. |
| [UpdateRangeAsync(IEnumerable<Object>, CancellationToken)][2] | Executes UPDATE commands for the specified *entities*. |
Syntax
------
```csharp
public ValueTask UpdateRangeAsync(
params Object[] entities
)
```
#### Parameters
##### *entities* [Object][3][]
The entities whose UPDATE commands are to be executed.
#### Return Value
[ValueTask][4]
See Also
--------
#### Reference
[SqlTable Class][5]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: UpdateRangeAsync.md
[3]: https://learn.microsoft.com/dotnet/api/system.object
[4]: https://learn.microsoft.com/dotnet/api/system.threading.tasks.valuetask
[5]: README.md
================================================
FILE: docs/api/DbExtensions/SqlTable/UpdateRange_1.md
================================================
SqlTable.UpdateRange(Object[]) Method
=====================================
Executes UPDATE commands for the specified *entities*.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ---------------------------------------- | ------------------------------------------------------ |
| [UpdateRange(IEnumerable<Object>)][2] | Executes UPDATE commands for the specified *entities*. |
| **UpdateRange(Object[])** | Executes UPDATE commands for the specified *entities*. |
Syntax
------
```csharp
public void UpdateRange(
params Object[] entities
)
```
#### Parameters
##### *entities* [Object][3][]
The entities whose UPDATE commands are to be executed.
See Also
--------
#### Reference
[SqlTable Class][4]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: UpdateRange.md
[3]: https://learn.microsoft.com/dotnet/api/system.object
[4]: README.md
================================================
FILE: docs/api/DbExtensions/SqlTable/Update_1.md
================================================
SqlTable.Update(Object, Object) Method
======================================
Executes an UPDATE command for the specified *entity*.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| -------------------------- | ------------------------------------------------------ |
| [Update(Object)][2] | Executes an UPDATE command for the specified *entity*. |
| **Update(Object, Object)** | Executes an UPDATE command for the specified *entity*. |
Syntax
------
```csharp
public void Update(
Object entity,
Object? originalId
)
```
#### Parameters
##### *entity* [Object][3]
The entity whose UPDATE command is to be executed.
##### *originalId* [Object][3]
The original primary key value.
Remarks
-------
This overload is helpful when the entity uses an assigned primary key.
See Also
--------
#### Reference
[SqlTable Class][4]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: Update.md
[3]: https://learn.microsoft.com/dotnet/api/system.object
[4]: README.md
================================================
FILE: docs/api/DbExtensions/SqlTable_1/Add.md
================================================
SqlTable<TEntity>.Add Method
===============================
Recursively executes INSERT commands for the specified *entity* and all its one-to-one and one-to-many associations.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public void Add(
TEntity entity
)
```
#### Parameters
##### *entity* [TEntity][2]
The object whose INSERT command is to be executed. This parameter is named entity for consistency with the other CRUD methods, but in this case it doesn't need to be an actual entity, which means it doesn't need to have a primary key.
See Also
--------
#### Reference
[SqlTable<TEntity> Class][2]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: README.md
================================================
FILE: docs/api/DbExtensions/SqlTable_1/AddAsync.md
================================================
SqlTable<TEntity>.AddAsync Method
====================================
Recursively executes INSERT commands for the specified *entity* and all its one-to-one and one-to-many associations.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public ValueTask AddAsync(
TEntity entity,
CancellationToken cancellationToken = default
)
```
#### Parameters
##### *entity* [TEntity][2]
The object whose INSERT command is to be executed. This parameter is named entity for consistency with the other CRUD methods, but in this case it doesn't need to be an actual entity, which means it doesn't need to have a primary key.
##### *cancellationToken* [CancellationToken][3] (Optional)
The [CancellationToken][3] to monitor for cancellation requests. The default is [None][4].
#### Return Value
[ValueTask][5]
See Also
--------
#### Reference
[SqlTable<TEntity> Class][2]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: README.md
[3]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken
[4]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken.none
[5]: https://learn.microsoft.com/dotnet/api/system.threading.tasks.valuetask
================================================
FILE: docs/api/DbExtensions/SqlTable_1/AddRange.md
================================================
SqlTable<TEntity>.AddRange(IEnumerable<TEntity>) Method
=============================================================
Recursively executes INSERT commands for the specified *entities* and all their one-to-one and one-to-many associations.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ------------------------------------- | ------------------------------------------------------------------------------------------------------------------------ |
| **AddRange(IEnumerable<TEntity>)** | Recursively executes INSERT commands for the specified *entities* and all their one-to-one and one-to-many associations. |
| [AddRange(TEntity[])][2] | Recursively executes INSERT commands for the specified *entities* and all their one-to-one and one-to-many associations. |
Syntax
------
```csharp
public void AddRange(
IEnumerable entities
)
```
#### Parameters
##### *entities* [IEnumerable][3]<[TEntity][4]>
The entities whose INSERT commands are to be executed.
See Also
--------
#### Reference
[SqlTable<TEntity> Class][4]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: AddRange_1.md
[3]: https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1
[4]: README.md
================================================
FILE: docs/api/DbExtensions/SqlTable_1/AddRangeAsync.md
================================================
SqlTable<TEntity>.AddRangeAsync(IEnumerable<TEntity>, CancellationToken) Method
=====================================================================================
Recursively executes INSERT commands for the specified *entities* and all their one-to-one and one-to-many associations.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------ |
| [AddRangeAsync(TEntity[])][2] | Recursively executes INSERT commands for the specified *entities* and all their one-to-one and one-to-many associations. |
| **AddRangeAsync(IEnumerable<TEntity>, CancellationToken)** | Recursively executes INSERT commands for the specified *entities* and all their one-to-one and one-to-many associations. |
Syntax
------
```csharp
public ValueTask AddRangeAsync(
IEnumerable entities,
CancellationToken cancellationToken = default
)
```
#### Parameters
##### *entities* [IEnumerable][3]<[TEntity][4]>
The entities whose INSERT commands are to be executed.
##### *cancellationToken* [CancellationToken][5] (Optional)
The [CancellationToken][5] to monitor for cancellation requests. The default is [None][6].
#### Return Value
[ValueTask][7]
See Also
--------
#### Reference
[SqlTable<TEntity> Class][4]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: AddRangeAsync_1.md
[3]: https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1
[4]: README.md
[5]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken
[6]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken.none
[7]: https://learn.microsoft.com/dotnet/api/system.threading.tasks.valuetask
================================================
FILE: docs/api/DbExtensions/SqlTable_1/AddRangeAsync_1.md
================================================
SqlTable<TEntity>.AddRangeAsync(TEntity[]) Method
====================================================
Recursively executes INSERT commands for the specified *entities* and all their one-to-one and one-to-many associations.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| -------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------ |
| **AddRangeAsync(TEntity[])** | Recursively executes INSERT commands for the specified *entities* and all their one-to-one and one-to-many associations. |
| [AddRangeAsync(IEnumerable<TEntity>, CancellationToken)][2] | Recursively executes INSERT commands for the specified *entities* and all their one-to-one and one-to-many associations. |
Syntax
------
```csharp
public ValueTask AddRangeAsync(
params TEntity[] entities
)
```
#### Parameters
##### *entities* [TEntity][3][]
The entities whose INSERT commands are to be executed.
#### Return Value
[ValueTask][4]
See Also
--------
#### Reference
[SqlTable<TEntity> Class][3]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: AddRangeAsync.md
[3]: README.md
[4]: https://learn.microsoft.com/dotnet/api/system.threading.tasks.valuetask
================================================
FILE: docs/api/DbExtensions/SqlTable_1/AddRange_1.md
================================================
SqlTable<TEntity>.AddRange(TEntity[]) Method
===============================================
Recursively executes INSERT commands for the specified *entities* and all their one-to-one and one-to-many associations.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| -------------------------------------- | ------------------------------------------------------------------------------------------------------------------------ |
| [AddRange(IEnumerable<TEntity>)][2] | Recursively executes INSERT commands for the specified *entities* and all their one-to-one and one-to-many associations. |
| **AddRange(TEntity[])** | Recursively executes INSERT commands for the specified *entities* and all their one-to-one and one-to-many associations. |
Syntax
------
```csharp
public void AddRange(
params TEntity[] entities
)
```
#### Parameters
##### *entities* [TEntity][3][]
The entities whose INSERT commands are to be executed.
See Also
--------
#### Reference
[SqlTable<TEntity> Class][3]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: AddRange.md
[3]: README.md
================================================
FILE: docs/api/DbExtensions/SqlTable_1/Name.md
================================================
SqlTable<TEntity>.Name Property
==================================
Gets the name of the table.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public string Name { get; }
```
#### Property Value
[String][2]
See Also
--------
#### Reference
[SqlTable<TEntity> Class][3]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: https://learn.microsoft.com/dotnet/api/system.string
[3]: README.md
================================================
FILE: docs/api/DbExtensions/SqlTable_1/README.md
================================================
SqlTable<TEntity> Class
==========================
A [SqlSet<TResult>][1] that provides CRUD (Create, Read, Update, Delete) operations for annotated classes. This class cannot be instantiated, to get an instance use the [Database.Table<TEntity>()][2] method.
Inheritance Hierarchy
---------------------
[System.Object][3]
[DbExtensions.SqlSet][4]
[DbExtensions.SqlSet][1]<**TEntity**>
**DbExtensions.SqlTable<TEntity>**
**Namespace:** [DbExtensions][5]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public sealed class SqlTable : SqlSet
where TEntity : class
```
#### Type Parameters
##### *TEntity*
The type of the entity.
The **SqlTable<TEntity>** type exposes the following members.
Properties
----------
| Name | Description |
| --------------- | -------------------------------------------------------------------------------------------------- |
| [Database][6] | The [Database][7] this set is connected to. (Inherited from [SqlSet][4]) |
| [Name][8] | Gets the name of the table. |
| [ResultType][9] | The type of objects this set returns. This property can be null. (Inherited from [SqlSet][4]) |
Methods
-------
| Name | Description |
| ------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| [Add][10] | Recursively executes INSERT commands for the specified *entity* and all its one-to-one and one-to-many associations. |
| [AddAsync][11] | Recursively executes INSERT commands for the specified *entity* and all its one-to-one and one-to-many associations. |
| [AddRange(IEnumerable<TEntity>)][12] | Recursively executes INSERT commands for the specified *entities* and all their one-to-one and one-to-many associations. |
| [AddRange(TEntity[])][13] | Recursively executes INSERT commands for the specified *entities* and all their one-to-one and one-to-many associations. |
| [AddRangeAsync(TEntity[])][14] | Recursively executes INSERT commands for the specified *entities* and all their one-to-one and one-to-many associations. |
| [AddRangeAsync(IEnumerable<TEntity>, CancellationToken)][15] | Recursively executes INSERT commands for the specified *entities* and all their one-to-one and one-to-many associations. |
| [All(OperatorStringHandler)][16] | Determines whether all elements of the set satisfy a condition. (Inherited from [SqlSet][4]) |
| [All(String)][17] | Determines whether all elements of the set satisfy a condition. (Inherited from [SqlSet][4]) |
| [AllAsync(OperatorStringHandler, CancellationToken)][18] | Determines whether all elements of the set satisfy a condition. (Inherited from [SqlSet][4]) |
| [AllAsync(String, CancellationToken)][19] | Determines whether all elements of the set satisfy a condition. (Inherited from [SqlSet][4]) |
| [Any()][20] | Determines whether the set contains any elements. (Inherited from [SqlSet][4]) |
| [Any(OperatorStringHandler)][21] | Determines whether any element of the set satisfies a condition. (Inherited from [SqlSet][4]) |
| [Any(String)][22] | Determines whether any element of the set satisfies a condition. (Inherited from [SqlSet][4]) |
| [AnyAsync(CancellationToken)][23] | Determines whether the set contains any elements. (Inherited from [SqlSet][4]) |
| [AnyAsync(OperatorStringHandler, CancellationToken)][24] | Determines whether any element of the set satisfies a condition. (Inherited from [SqlSet][4]) |
| [AnyAsync(String, CancellationToken)][25] | Determines whether any element of the set satisfies a condition. (Inherited from [SqlSet][4]) |
| [AsAsyncEnumerable][26] | Gets all TResult objects in the set. The query is deferred-executed. (Inherited from [SqlSet<TResult>][1]) |
| [AsEnumerable][27] | Gets all TResult objects in the set. The query is deferred-executed. (Inherited from [SqlSet<TResult>][1]) |
| [Cast(Type)][28] | Casts the elements of the set to the specified type. (Inherited from [SqlSet][4]) |
| [Cast<TResult>()][29] | Casts the elements of the set to the specified type. (Inherited from [SqlSet][4]) |
| [Contains(Object)][30] | Checks the existance of the *entity*, using the primary key value. (Inherited from [SqlSet][4]) |
| [Contains(TResult)][31] | Checks the existance of the *entity*, using the primary key value. (Inherited from [SqlSet<TResult>][1]) |
| [ContainsAsync(Object, CancellationToken)][32] | Checks the existance of the *entity*, using the primary key value. (Inherited from [SqlSet][4]) |
| [ContainsAsync(TResult, CancellationToken)][33] | Checks the existance of the *entity*, using the primary key value. (Inherited from [SqlSet<TResult>][1]) |
| [ContainsKey][34] | Checks the existance of an entity whose primary matches the *id* parameter. (Inherited from [SqlSet][4]) |
| [ContainsKeyAsync][35] | Checks the existance of an entity whose primary matches the *id* parameter. (Inherited from [SqlSet][4]) |
| [Count()][36] | Returns the number of elements in the set. (Inherited from [SqlSet][4]) |
| [Count(OperatorStringHandler)][37] | Returns a number that represents how many elements in the set satisfy a condition. (Inherited from [SqlSet][4]) |
| [Count(String)][38] | Returns a number that represents how many elements in the set satisfy a condition. (Inherited from [SqlSet][4]) |
| [CountAsync(CancellationToken)][39] | Returns the number of elements in the set. (Inherited from [SqlSet][4]) |
| [CountAsync(OperatorStringHandler, CancellationToken)][40] | Returns a number that represents how many elements in the set satisfy a condition. (Inherited from [SqlSet][4]) |
| [CountAsync(String, CancellationToken)][41] | Returns a number that represents how many elements in the set satisfy a condition. (Inherited from [SqlSet][4]) |
| [Find][42] | Gets the entity whose primary key matches the *id* parameter. (Inherited from [SqlSet<TResult>][1]) |
| [FindAsync][43] | Gets the entity whose primary key matches the *id* parameter. (Inherited from [SqlSet<TResult>][1]) |
| [First()][44] | Returns the first element of the set. (Inherited from [SqlSet<TResult>][1]) |
| [First(OperatorStringHandler)][45] | Returns the first element in the set that satisfies a specified condition. (Inherited from [SqlSet<TResult>][1]) |
| [First(String)][46] | Returns the first element in the set that satisfies a specified condition. (Inherited from [SqlSet<TResult>][1]) |
| [FirstAsync(CancellationToken)][47] | Returns the first element of the set. (Inherited from [SqlSet<TResult>][1]) |
| [FirstAsync(OperatorStringHandler, CancellationToken)][48] | Returns the first element in the set that satisfies a specified condition. (Inherited from [SqlSet<TResult>][1]) |
| [FirstAsync(String, CancellationToken)][49] | Returns the first element in the set that satisfies a specified condition. (Inherited from [SqlSet<TResult>][1]) |
| [FirstOrDefault()][50] | Returns the first element of the set, or a default value if the set contains no elements. (Inherited from [SqlSet<TResult>][1]) |
| [FirstOrDefault(OperatorStringHandler)][51] | Returns the first element of the set that satisfies a condition or a default value if no such element is found. (Inherited from [SqlSet<TResult>][1]) |
| [FirstOrDefault(String)][52] | Returns the first element of the set that satisfies a condition or a default value if no such element is found. (Inherited from [SqlSet<TResult>][1]) |
| [FirstOrDefaultAsync(CancellationToken)][53] | Returns the first element of the set, or a default value if the set contains no elements. (Inherited from [SqlSet<TResult>][1]) |
| [FirstOrDefaultAsync(OperatorStringHandler, CancellationToken)][54] | Returns the first element of the set that satisfies a condition or a default value if no such element is found. (Inherited from [SqlSet<TResult>][1]) |
| [FirstOrDefaultAsync(String, CancellationToken)][55] | Returns the first element of the set that satisfies a condition or a default value if no such element is found. (Inherited from [SqlSet<TResult>][1]) |
| [GetAsyncEnumerator][56] | Returns an async enumerator that iterates through the set. (Inherited from [SqlSet<TResult>][1]) |
| [GetDefiningQuery][57] | Returns the SQL query that is the source of data for the set. (Inherited from [SqlSet][4]) |
| [GetEnumerator][58] | Returns an enumerator that iterates through the set. (Inherited from [SqlSet<TResult>][1]) |
| [Include(String)][59] | Specifies the related objects to include in the query results. (Inherited from [SqlSet<TResult>][1]) |
| [Include(Func<TResult, Object>, String)][60] | Specifies the related objects to include in the query results. (Inherited from [SqlSet<TResult>][1]) |
| [IncludeMany(String, Func<SqlSet, SqlSet>)][61] | Specifies which collections to include in the query results. (Inherited from [SqlSet<TResult>][1]) |
| [IncludeMany<TElement>(Func<TResult, ICollection<TElement>>, Func<SqlSet<TElement>, SqlSet<TElement>>, String)][62] | Specifies which collections to include in the query results. (Inherited from [SqlSet<TResult>][1]) |
| [LongCount()][63] | Returns an [Int64][64] that represents the total number of elements in the set. (Inherited from [SqlSet][4]) |
| [LongCount(OperatorStringHandler)][65] | Returns an [Int64][64] that represents how many elements in the set satisfy a condition. (Inherited from [SqlSet][4]) |
| [LongCount(String)][66] | Returns an [Int64][64] that represents how many elements in the set satisfy a condition. (Inherited from [SqlSet][4]) |
| [LongCountAsync(CancellationToken)][67] | Returns an [Int64][64] that represents the total number of elements in the set. (Inherited from [SqlSet][4]) |
| [LongCountAsync(OperatorStringHandler, CancellationToken)][68] | Returns an [Int64][64] that represents how many elements in the set satisfy a condition. (Inherited from [SqlSet][4]) |
| [LongCountAsync(String, CancellationToken)][69] | Returns an [Int64][64] that represents how many elements in the set satisfy a condition. (Inherited from [SqlSet][4]) |
| [OrderBy(OperatorStringHandler)][70] | Sorts the elements of the set according to the *columnList*. (Inherited from [SqlSet<TResult>][1]) |
| [OrderBy(String)][71] | Sorts the elements of the set according to the *columnList*. (Inherited from [SqlSet<TResult>][1]) |
| [Refresh][72] | Sets all column members of *entity* to their most current persisted value. |
| [RefreshAsync][73] | Sets all column members of *entity* to their most current persisted value. |
| [Remove][74] | Executes a DELETE command for the specified *entity*. |
| [RemoveAsync][75] | Executes a DELETE command for the specified *entity*. |
| [RemoveKey][76] | Executes a DELETE command for the entity whose primary key matches the *id* parameter. |
| [RemoveKeyAsync][77] | Executes a DELETE command for the entity whose primary key matches the *id* parameter. |
| [RemoveRange(IEnumerable<TEntity>)][78] | Executes DELETE commands for the specified *entities*. |
| [RemoveRange(TEntity[])][79] | Executes DELETE commands for the specified *entities*. |
| [RemoveRangeAsync(TEntity[])][80] | Executes DELETE commands for the specified *entities*. |
| [RemoveRangeAsync(IEnumerable<TEntity>, CancellationToken)][81] | Executes DELETE commands for the specified *entities*. |
| [Select(OperatorStringHandler, Type)][82] | Projects each element of the set into a new form. (Inherited from [SqlSet][4]) |
| [Select(String, Type)][83] | Projects each element of the set into a new form. (Inherited from [SqlSet][4]) |
| [Select<TResult>(OperatorStringHandler)][84] | Projects each element of the set into a new form. (Inherited from [SqlSet][4]) |
| [Select<TResult>(String)][85] | Projects each element of the set into a new form. (Inherited from [SqlSet][4]) |
| [Select<TResult>(OperatorStringHandler, Func<DbDataReader, TResult>)][86] | Projects each element of the set into a new form. (Inherited from [SqlSet][4]) |
| [Select<TResult>(String, Func<DbDataReader, TResult>)][87] | Projects each element of the set into a new form. (Inherited from [SqlSet][4]) |
| [Single()][88] | The single element of the set. (Inherited from [SqlSet<TResult>][1]) |
| [Single(OperatorStringHandler)][89] | Returns the only element of the set that satisfies a specified condition, and throws an exception if more than one such element exists. (Inherited from [SqlSet<TResult>][1]) |
| [Single(String)][90] | Returns the only element of the set that satisfies a specified condition, and throws an exception if more than one such element exists. (Inherited from [SqlSet<TResult>][1]) |
| [SingleAsync(CancellationToken)][91] | The single element of the set. (Inherited from [SqlSet<TResult>][1]) |
| [SingleAsync(OperatorStringHandler, CancellationToken)][92] | Returns the only element of the set that satisfies a specified condition, and throws an exception if more than one such element exists. (Inherited from [SqlSet<TResult>][1]) |
| [SingleAsync(String, CancellationToken)][93] | Returns the only element of the set that satisfies a specified condition, and throws an exception if more than one such element exists. (Inherited from [SqlSet<TResult>][1]) |
| [SingleOrDefault()][94] | Returns the only element of the set, or a default value if the set is empty; this method throws an exception if there is more than one element in the set. (Inherited from [SqlSet<TResult>][1]) |
| [SingleOrDefault(OperatorStringHandler)][95] | Returns the only element of the set that satisfies a specified condition or a default value if no such element exists; this method throws an exception if more than one element satisfies the condition. (Inherited from [SqlSet<TResult>][1]) |
| [SingleOrDefault(String)][96] | Returns the only element of the set that satisfies a specified condition or a default value if no such element exists; this method throws an exception if more than one element satisfies the condition. (Inherited from [SqlSet<TResult>][1]) |
| [SingleOrDefaultAsync(CancellationToken)][97] | Returns the only element of the set, or a default value if the set is empty; this method throws an exception if there is more than one element in the set. (Inherited from [SqlSet<TResult>][1]) |
| [SingleOrDefaultAsync(OperatorStringHandler, CancellationToken)][98] | Returns the only element of the set that satisfies a specified condition or a default value if no such element exists; this method throws an exception if more than one element satisfies the condition. (Inherited from [SqlSet<TResult>][1]) |
| [SingleOrDefaultAsync(String, CancellationToken)][99] | Returns the only element of the set that satisfies a specified condition or a default value if no such element exists; this method throws an exception if more than one element satisfies the condition. (Inherited from [SqlSet<TResult>][1]) |
| [Skip][100] | Bypasses a specified number of elements in the set and then returns the remaining elements. (Inherited from [SqlSet<TResult>][1]) |
| [Take][101] | Returns a specified number of contiguous elements from the start of the set. (Inherited from [SqlSet<TResult>][1]) |
| [ToArray][102] | Creates an array from the set. (Inherited from [SqlSet<TResult>][1]) |
| [ToArrayAsync][103] | Creates an array from the set. (Inherited from [SqlSet<TResult>][1]) |
| [ToList][104] | Creates a List<TResult> from the set. (Inherited from [SqlSet<TResult>][1]) |
| [ToListAsync][105] | Creates a List<TResult> from the set. (Inherited from [SqlSet<TResult>][1]) |
| [ToString][106] | Returns the SQL query of the set. (Inherited from [SqlSet][4]) |
| [Update(TEntity)][107] | Executes an UPDATE command for the specified *entity*. |
| [Update(TEntity, Object)][108] | Executes an UPDATE command for the specified *entity*. |
| [UpdateAsync(TEntity, CancellationToken)][109] | Executes an UPDATE command for the specified *entity*. |
| [UpdateAsync(TEntity, Object, CancellationToken)][110] | Executes an UPDATE command for the specified *entity*. |
| [UpdateRange(IEnumerable<TEntity>)][111] | Executes UPDATE commands for the specified *entities*. |
| [UpdateRange(TEntity[])][112] | Executes UPDATE commands for the specified *entities*. |
| [UpdateRangeAsync(TEntity[])][113] | Executes UPDATE commands for the specified *entities*. |
| [UpdateRangeAsync(IEnumerable<TEntity>, CancellationToken)][114] | Executes UPDATE commands for the specified *entities*. |
| [Where(OperatorStringHandler)][115] | Filters the set based on a predicate. (Inherited from [SqlSet<TResult>][1]) |
| [Where(String)][116] | Filters the set based on a predicate. (Inherited from [SqlSet<TResult>][1]) |
See Also
--------
#### Reference
[DbExtensions Namespace][5]
[1]: ../SqlSet_1/README.md
[2]: ../Database/Table__1.md
[3]: https://learn.microsoft.com/dotnet/api/system.object
[4]: ../SqlSet/README.md
[5]: ../README.md
[6]: ../SqlSet/Database.md
[7]: ../Database/README.md
[8]: Name.md
[9]: ../SqlSet/ResultType.md
[10]: Add.md
[11]: AddAsync.md
[12]: AddRange.md
[13]: AddRange_1.md
[14]: AddRangeAsync_1.md
[15]: AddRangeAsync.md
[16]: ../SqlSet/All.md
[17]: ../SqlSet/All_1.md
[18]: ../SqlSet/AllAsync.md
[19]: ../SqlSet/AllAsync_1.md
[20]: ../SqlSet/Any.md
[21]: ../SqlSet/Any_1.md
[22]: ../SqlSet/Any_2.md
[23]: ../SqlSet/AnyAsync_2.md
[24]: ../SqlSet/AnyAsync.md
[25]: ../SqlSet/AnyAsync_1.md
[26]: ../SqlSet_1/AsAsyncEnumerable.md
[27]: ../SqlSet_1/AsEnumerable.md
[28]: ../SqlSet/Cast.md
[29]: ../SqlSet/Cast__1.md
[30]: ../SqlSet/Contains.md
[31]: ../SqlSet_1/Contains.md
[32]: ../SqlSet/ContainsAsync.md
[33]: ../SqlSet_1/ContainsAsync.md
[34]: ../SqlSet/ContainsKey.md
[35]: ../SqlSet/ContainsKeyAsync.md
[36]: ../SqlSet/Count.md
[37]: ../SqlSet/Count_1.md
[38]: ../SqlSet/Count_2.md
[39]: ../SqlSet/CountAsync_2.md
[40]: ../SqlSet/CountAsync.md
[41]: ../SqlSet/CountAsync_1.md
[42]: ../SqlSet_1/Find.md
[43]: ../SqlSet_1/FindAsync.md
[44]: ../SqlSet_1/First.md
[45]: ../SqlSet_1/First_1.md
[46]: ../SqlSet_1/First_2.md
[47]: ../SqlSet_1/FirstAsync_2.md
[48]: ../SqlSet_1/FirstAsync.md
[49]: ../SqlSet_1/FirstAsync_1.md
[50]: ../SqlSet_1/FirstOrDefault.md
[51]: ../SqlSet_1/FirstOrDefault_1.md
[52]: ../SqlSet_1/FirstOrDefault_2.md
[53]: ../SqlSet_1/FirstOrDefaultAsync_2.md
[54]: ../SqlSet_1/FirstOrDefaultAsync.md
[55]: ../SqlSet_1/FirstOrDefaultAsync_1.md
[56]: ../SqlSet_1/GetAsyncEnumerator.md
[57]: ../SqlSet/GetDefiningQuery.md
[58]: ../SqlSet_1/GetEnumerator.md
[59]: ../SqlSet_1/Include_1.md
[60]: ../SqlSet_1/Include.md
[61]: ../SqlSet_1/IncludeMany.md
[62]: ../SqlSet_1/IncludeMany__1.md
[63]: ../SqlSet/LongCount.md
[64]: https://learn.microsoft.com/dotnet/api/system.int64
[65]: ../SqlSet/LongCount_1.md
[66]: ../SqlSet/LongCount_2.md
[67]: ../SqlSet/LongCountAsync_2.md
[68]: ../SqlSet/LongCountAsync.md
[69]: ../SqlSet/LongCountAsync_1.md
[70]: ../SqlSet_1/OrderBy.md
[71]: ../SqlSet_1/OrderBy_1.md
[72]: Refresh.md
[73]: RefreshAsync.md
[74]: Remove.md
[75]: RemoveAsync.md
[76]: RemoveKey.md
[77]: RemoveKeyAsync.md
[78]: RemoveRange.md
[79]: RemoveRange_1.md
[80]: RemoveRangeAsync_1.md
[81]: RemoveRangeAsync.md
[82]: ../SqlSet/Select_1.md
[83]: ../SqlSet/Select_3.md
[84]: ../SqlSet/Select__1.md
[85]: ../SqlSet/Select__1_2.md
[86]: ../SqlSet/Select__1_1.md
[87]: ../SqlSet/Select__1_3.md
[88]: ../SqlSet_1/Single.md
[89]: ../SqlSet_1/Single_1.md
[90]: ../SqlSet_1/Single_2.md
[91]: ../SqlSet_1/SingleAsync_2.md
[92]: ../SqlSet_1/SingleAsync.md
[93]: ../SqlSet_1/SingleAsync_1.md
[94]: ../SqlSet_1/SingleOrDefault.md
[95]: ../SqlSet_1/SingleOrDefault_1.md
[96]: ../SqlSet_1/SingleOrDefault_2.md
[97]: ../SqlSet_1/SingleOrDefaultAsync_2.md
[98]: ../SqlSet_1/SingleOrDefaultAsync.md
[99]: ../SqlSet_1/SingleOrDefaultAsync_1.md
[100]: ../SqlSet_1/Skip.md
[101]: ../SqlSet_1/Take.md
[102]: ../SqlSet_1/ToArray.md
[103]: ../SqlSet_1/ToArrayAsync.md
[104]: ../SqlSet_1/ToList.md
[105]: ../SqlSet_1/ToListAsync.md
[106]: ../SqlSet/ToString.md
[107]: Update.md
[108]: Update_1.md
[109]: UpdateAsync_1.md
[110]: UpdateAsync.md
[111]: UpdateRange.md
[112]: UpdateRange_1.md
[113]: UpdateRangeAsync_1.md
[114]: UpdateRangeAsync.md
[115]: ../SqlSet_1/Where.md
[116]: ../SqlSet_1/Where_1.md
================================================
FILE: docs/api/DbExtensions/SqlTable_1/Refresh.md
================================================
SqlTable<TEntity>.Refresh Method
===================================
Sets all column members of *entity* to their most current persisted value.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public void Refresh(
TEntity entity
)
```
#### Parameters
##### *entity* [TEntity][2]
The entity to refresh.
See Also
--------
#### Reference
[SqlTable<TEntity> Class][2]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: README.md
================================================
FILE: docs/api/DbExtensions/SqlTable_1/RefreshAsync.md
================================================
SqlTable<TEntity>.RefreshAsync Method
========================================
Sets all column members of *entity* to their most current persisted value.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public ValueTask RefreshAsync(
TEntity entity,
CancellationToken cancellationToken = default
)
```
#### Parameters
##### *entity* [TEntity][2]
The entity to refresh.
##### *cancellationToken* [CancellationToken][3] (Optional)
The [CancellationToken][3] to monitor for cancellation requests. The default is [None][4].
#### Return Value
[ValueTask][5]
See Also
--------
#### Reference
[SqlTable<TEntity> Class][2]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: README.md
[3]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken
[4]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken.none
[5]: https://learn.microsoft.com/dotnet/api/system.threading.tasks.valuetask
================================================
FILE: docs/api/DbExtensions/SqlTable_1/Remove.md
================================================
SqlTable<TEntity>.Remove Method
==================================
Executes a DELETE command for the specified *entity*.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public bool Remove(
TEntity entity
)
```
#### Parameters
##### *entity* [TEntity][2]
The entity whose DELETE command is to be executed.
#### Return Value
[Boolean][3]
`true` if *entity* is deleted; otherwise, `false`.
See Also
--------
#### Reference
[SqlTable<TEntity> Class][2]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: README.md
[3]: https://learn.microsoft.com/dotnet/api/system.boolean
================================================
FILE: docs/api/DbExtensions/SqlTable_1/RemoveAsync.md
================================================
SqlTable<TEntity>.RemoveAsync Method
=======================================
Executes a DELETE command for the specified *entity*.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public ValueTask RemoveAsync(
TEntity entity,
CancellationToken cancellationToken = default
)
```
#### Parameters
##### *entity* [TEntity][2]
The entity whose DELETE command is to be executed.
##### *cancellationToken* [CancellationToken][3] (Optional)
The [CancellationToken][3] to monitor for cancellation requests. The default is [None][4].
#### Return Value
[ValueTask][5]<[Boolean][6]>
`true` if *entity* is deleted; otherwise, `false`.
See Also
--------
#### Reference
[SqlTable<TEntity> Class][2]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: README.md
[3]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken
[4]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken.none
[5]: https://learn.microsoft.com/dotnet/api/system.threading.tasks.valuetask-1
[6]: https://learn.microsoft.com/dotnet/api/system.boolean
================================================
FILE: docs/api/DbExtensions/SqlTable_1/RemoveKey.md
================================================
SqlTable<TEntity>.RemoveKey Method
=====================================
Executes a DELETE command for the entity whose primary key matches the *id* parameter.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public bool RemoveKey(
Object id
)
```
#### Parameters
##### *id* [Object][2]
The primary key value.
#### Return Value
[Boolean][3]
`true` if a record that matches *id* was found and deleted; otherwise, `false`.
See Also
--------
#### Reference
[SqlTable<TEntity> Class][4]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: https://learn.microsoft.com/dotnet/api/system.object
[3]: https://learn.microsoft.com/dotnet/api/system.boolean
[4]: README.md
================================================
FILE: docs/api/DbExtensions/SqlTable_1/RemoveKeyAsync.md
================================================
SqlTable<TEntity>.RemoveKeyAsync Method
==========================================
Executes a DELETE command for the entity whose primary key matches the *id* parameter.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public ValueTask RemoveKeyAsync(
Object id,
CancellationToken cancellationToken = default
)
```
#### Parameters
##### *id* [Object][2]
The primary key value.
##### *cancellationToken* [CancellationToken][3] (Optional)
The [CancellationToken][3] to monitor for cancellation requests. The default is [None][4].
#### Return Value
[ValueTask][5]<[Boolean][6]>
`true` if a record that matches *id* was found and deleted; otherwise, `false`.
See Also
--------
#### Reference
[SqlTable<TEntity> Class][7]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: https://learn.microsoft.com/dotnet/api/system.object
[3]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken
[4]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken.none
[5]: https://learn.microsoft.com/dotnet/api/system.threading.tasks.valuetask-1
[6]: https://learn.microsoft.com/dotnet/api/system.boolean
[7]: README.md
================================================
FILE: docs/api/DbExtensions/SqlTable_1/RemoveRange.md
================================================
SqlTable<TEntity>.RemoveRange(IEnumerable<TEntity>) Method
================================================================
Executes DELETE commands for the specified *entities*.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ---------------------------------------- | ------------------------------------------------------ |
| **RemoveRange(IEnumerable<TEntity>)** | Executes DELETE commands for the specified *entities*. |
| [RemoveRange(TEntity[])][2] | Executes DELETE commands for the specified *entities*. |
Syntax
------
```csharp
public void RemoveRange(
IEnumerable entities
)
```
#### Parameters
##### *entities* [IEnumerable][3]<[TEntity][4]>
The entities whose DELETE commands are to be executed.
See Also
--------
#### Reference
[SqlTable<TEntity> Class][4]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: RemoveRange_1.md
[3]: https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1
[4]: README.md
================================================
FILE: docs/api/DbExtensions/SqlTable_1/RemoveRangeAsync.md
================================================
SqlTable<TEntity>.RemoveRangeAsync(IEnumerable<TEntity>, CancellationToken) Method
========================================================================================
Executes DELETE commands for the specified *entities*.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ---------------------------------------------------------------- | ------------------------------------------------------ |
| [RemoveRangeAsync(TEntity[])][2] | Executes DELETE commands for the specified *entities*. |
| **RemoveRangeAsync(IEnumerable<TEntity>, CancellationToken)** | Executes DELETE commands for the specified *entities*. |
Syntax
------
```csharp
public ValueTask RemoveRangeAsync(
IEnumerable entities,
CancellationToken cancellationToken = default
)
```
#### Parameters
##### *entities* [IEnumerable][3]<[TEntity][4]>
The entities whose DELETE commands are to be executed.
##### *cancellationToken* [CancellationToken][5] (Optional)
The [CancellationToken][5] to monitor for cancellation requests. The default is [None][6].
#### Return Value
[ValueTask][7]
See Also
--------
#### Reference
[SqlTable<TEntity> Class][4]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: RemoveRangeAsync_1.md
[3]: https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1
[4]: README.md
[5]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken
[6]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken.none
[7]: https://learn.microsoft.com/dotnet/api/system.threading.tasks.valuetask
================================================
FILE: docs/api/DbExtensions/SqlTable_1/RemoveRangeAsync_1.md
================================================
SqlTable<TEntity>.RemoveRangeAsync(TEntity[]) Method
=======================================================
Executes DELETE commands for the specified *entities*.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ----------------------------------------------------------------- | ------------------------------------------------------ |
| **RemoveRangeAsync(TEntity[])** | Executes DELETE commands for the specified *entities*. |
| [RemoveRangeAsync(IEnumerable<TEntity>, CancellationToken)][2] | Executes DELETE commands for the specified *entities*. |
Syntax
------
```csharp
public ValueTask RemoveRangeAsync(
params TEntity[] entities
)
```
#### Parameters
##### *entities* [TEntity][3][]
The entities whose DELETE commands are to be executed.
#### Return Value
[ValueTask][4]
See Also
--------
#### Reference
[SqlTable<TEntity> Class][3]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: RemoveRangeAsync.md
[3]: README.md
[4]: https://learn.microsoft.com/dotnet/api/system.threading.tasks.valuetask
================================================
FILE: docs/api/DbExtensions/SqlTable_1/RemoveRange_1.md
================================================
SqlTable<TEntity>.RemoveRange(TEntity[]) Method
==================================================
Executes DELETE commands for the specified *entities*.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ----------------------------------------- | ------------------------------------------------------ |
| [RemoveRange(IEnumerable<TEntity>)][2] | Executes DELETE commands for the specified *entities*. |
| **RemoveRange(TEntity[])** | Executes DELETE commands for the specified *entities*. |
Syntax
------
```csharp
public void RemoveRange(
params TEntity[] entities
)
```
#### Parameters
##### *entities* [TEntity][3][]
The entities whose DELETE commands are to be executed.
See Also
--------
#### Reference
[SqlTable<TEntity> Class][3]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: RemoveRange.md
[3]: README.md
================================================
FILE: docs/api/DbExtensions/SqlTable_1/Update.md
================================================
SqlTable<TEntity>.Update(TEntity) Method
===========================================
Executes an UPDATE command for the specified *entity*.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ---------------------------- | ------------------------------------------------------ |
| **Update(TEntity)** | Executes an UPDATE command for the specified *entity*. |
| [Update(TEntity, Object)][2] | Executes an UPDATE command for the specified *entity*. |
Syntax
------
```csharp
public void Update(
TEntity entity
)
```
#### Parameters
##### *entity* [TEntity][3]
The entity whose UPDATE command is to be executed.
See Also
--------
#### Reference
[SqlTable<TEntity> Class][3]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: Update_1.md
[3]: README.md
================================================
FILE: docs/api/DbExtensions/SqlTable_1/UpdateAsync.md
================================================
SqlTable<TEntity>.UpdateAsync(TEntity, Object, CancellationToken) Method
===========================================================================
Executes an UPDATE command for the specified *entity*.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| --------------------------------------------------- | ------------------------------------------------------ |
| [UpdateAsync(TEntity, CancellationToken)][2] | Executes an UPDATE command for the specified *entity*. |
| **UpdateAsync(TEntity, Object, CancellationToken)** | Executes an UPDATE command for the specified *entity*. |
Syntax
------
```csharp
public ValueTask UpdateAsync(
TEntity entity,
Object? originalId,
CancellationToken cancellationToken = default
)
```
#### Parameters
##### *entity* [TEntity][3]
The entity whose UPDATE command is to be executed.
##### *originalId* [Object][4]
The original primary key value.
##### *cancellationToken* [CancellationToken][5] (Optional)
The [CancellationToken][5] to monitor for cancellation requests. The default is [None][6].
#### Return Value
[ValueTask][7]
Remarks
-------
This overload is helpful when the entity uses an assigned primary key.
See Also
--------
#### Reference
[SqlTable<TEntity> Class][3]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: UpdateAsync_1.md
[3]: README.md
[4]: https://learn.microsoft.com/dotnet/api/system.object
[5]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken
[6]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken.none
[7]: https://learn.microsoft.com/dotnet/api/system.threading.tasks.valuetask
================================================
FILE: docs/api/DbExtensions/SqlTable_1/UpdateAsync_1.md
================================================
SqlTable<TEntity>.UpdateAsync(TEntity, CancellationToken) Method
===================================================================
Executes an UPDATE command for the specified *entity*.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ---------------------------------------------------- | ------------------------------------------------------ |
| **UpdateAsync(TEntity, CancellationToken)** | Executes an UPDATE command for the specified *entity*. |
| [UpdateAsync(TEntity, Object, CancellationToken)][2] | Executes an UPDATE command for the specified *entity*. |
Syntax
------
```csharp
public ValueTask UpdateAsync(
TEntity entity,
CancellationToken cancellationToken = default
)
```
#### Parameters
##### *entity* [TEntity][3]
The entity whose UPDATE command is to be executed.
##### *cancellationToken* [CancellationToken][4] (Optional)
The [CancellationToken][4] to monitor for cancellation requests. The default is [None][5].
#### Return Value
[ValueTask][6]
See Also
--------
#### Reference
[SqlTable<TEntity> Class][3]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: UpdateAsync.md
[3]: README.md
[4]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken
[5]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken.none
[6]: https://learn.microsoft.com/dotnet/api/system.threading.tasks.valuetask
================================================
FILE: docs/api/DbExtensions/SqlTable_1/UpdateRange.md
================================================
SqlTable<TEntity>.UpdateRange(IEnumerable<TEntity>) Method
================================================================
Executes UPDATE commands for the specified *entities*.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ---------------------------------------- | ------------------------------------------------------ |
| **UpdateRange(IEnumerable<TEntity>)** | Executes UPDATE commands for the specified *entities*. |
| [UpdateRange(TEntity[])][2] | Executes UPDATE commands for the specified *entities*. |
Syntax
------
```csharp
public void UpdateRange(
IEnumerable entities
)
```
#### Parameters
##### *entities* [IEnumerable][3]<[TEntity][4]>
The entities whose UPDATE commands are to be executed.
See Also
--------
#### Reference
[SqlTable<TEntity> Class][4]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: UpdateRange_1.md
[3]: https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1
[4]: README.md
================================================
FILE: docs/api/DbExtensions/SqlTable_1/UpdateRangeAsync.md
================================================
SqlTable<TEntity>.UpdateRangeAsync(IEnumerable<TEntity>, CancellationToken) Method
========================================================================================
Executes UPDATE commands for the specified *entities*.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ---------------------------------------------------------------- | ------------------------------------------------------ |
| [UpdateRangeAsync(TEntity[])][2] | Executes UPDATE commands for the specified *entities*. |
| **UpdateRangeAsync(IEnumerable<TEntity>, CancellationToken)** | Executes UPDATE commands for the specified *entities*. |
Syntax
------
```csharp
public ValueTask UpdateRangeAsync(
IEnumerable entities,
CancellationToken cancellationToken = default
)
```
#### Parameters
##### *entities* [IEnumerable][3]<[TEntity][4]>
The entities whose UPDATE commands are to be executed.
##### *cancellationToken* [CancellationToken][5] (Optional)
The [CancellationToken][5] to monitor for cancellation requests. The default is [None][6].
#### Return Value
[ValueTask][7]
See Also
--------
#### Reference
[SqlTable<TEntity> Class][4]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: UpdateRangeAsync_1.md
[3]: https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1
[4]: README.md
[5]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken
[6]: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken.none
[7]: https://learn.microsoft.com/dotnet/api/system.threading.tasks.valuetask
================================================
FILE: docs/api/DbExtensions/SqlTable_1/UpdateRangeAsync_1.md
================================================
SqlTable<TEntity>.UpdateRangeAsync(TEntity[]) Method
=======================================================
Executes UPDATE commands for the specified *entities*.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ----------------------------------------------------------------- | ------------------------------------------------------ |
| **UpdateRangeAsync(TEntity[])** | Executes UPDATE commands for the specified *entities*. |
| [UpdateRangeAsync(IEnumerable<TEntity>, CancellationToken)][2] | Executes UPDATE commands for the specified *entities*. |
Syntax
------
```csharp
public ValueTask UpdateRangeAsync(
params TEntity[] entities
)
```
#### Parameters
##### *entities* [TEntity][3][]
The entities whose UPDATE commands are to be executed.
#### Return Value
[ValueTask][4]
See Also
--------
#### Reference
[SqlTable<TEntity> Class][3]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: UpdateRangeAsync.md
[3]: README.md
[4]: https://learn.microsoft.com/dotnet/api/system.threading.tasks.valuetask
================================================
FILE: docs/api/DbExtensions/SqlTable_1/UpdateRange_1.md
================================================
SqlTable<TEntity>.UpdateRange(TEntity[]) Method
==================================================
Executes UPDATE commands for the specified *entities*.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| ----------------------------------------- | ------------------------------------------------------ |
| [UpdateRange(IEnumerable<TEntity>)][2] | Executes UPDATE commands for the specified *entities*. |
| **UpdateRange(TEntity[])** | Executes UPDATE commands for the specified *entities*. |
Syntax
------
```csharp
public void UpdateRange(
params TEntity[] entities
)
```
#### Parameters
##### *entities* [TEntity][3][]
The entities whose UPDATE commands are to be executed.
See Also
--------
#### Reference
[SqlTable<TEntity> Class][3]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: UpdateRange.md
[3]: README.md
================================================
FILE: docs/api/DbExtensions/SqlTable_1/Update_1.md
================================================
SqlTable<TEntity>.Update(TEntity, Object) Method
===================================================
Executes an UPDATE command for the specified *entity*.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Overloads
---------
| Name | Description |
| --------------------------- | ------------------------------------------------------ |
| [Update(TEntity)][2] | Executes an UPDATE command for the specified *entity*. |
| **Update(TEntity, Object)** | Executes an UPDATE command for the specified *entity*. |
Syntax
------
```csharp
public void Update(
TEntity entity,
Object? originalId
)
```
#### Parameters
##### *entity* [TEntity][3]
The entity whose UPDATE command is to be executed.
##### *originalId* [Object][4]
The original primary key value.
Remarks
-------
This overload is helpful when the entity uses an assigned primary key.
See Also
--------
#### Reference
[SqlTable<TEntity> Class][3]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: Update.md
[3]: README.md
[4]: https://learn.microsoft.com/dotnet/api/system.object
================================================
FILE: docs/api/DbExtensions/TableAttribute/Name.md
================================================
TableAttribute.Name Property
============================
Gets or sets the name of the table or view.
**Namespace:** [DbExtensions][1]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public string? Name { get; set; }
```
#### Property Value
[String][2]
See Also
--------
#### Reference
[TableAttribute Class][3]
[DbExtensions Namespace][1]
[1]: ../README.md
[2]: https://learn.microsoft.com/dotnet/api/system.string
[3]: README.md
================================================
FILE: docs/api/DbExtensions/TableAttribute/README.md
================================================
TableAttribute Class
====================
Designates a class as an entity class that is associated with a database table.
Inheritance Hierarchy
---------------------
[System.Object][1]
[System.Attribute][2]
**DbExtensions.TableAttribute**
**Namespace:** [DbExtensions][3]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public sealed class TableAttribute : Attribute
```
The **TableAttribute** type exposes the following members.
Constructors
------------
| Name | Description |
| ------------------- | ---------------------------------------------------------- |
| [TableAttribute][4] | Initializes a new instance of the **TableAttribute** class |
Properties
----------
| Name | Description |
| --------- | ------------------------------------------- |
| [Name][5] | Gets or sets the name of the table or view. |
See Also
--------
#### Reference
[DbExtensions Namespace][3]
[1]: https://learn.microsoft.com/dotnet/api/system.object
[2]: https://learn.microsoft.com/dotnet/api/system.attribute
[3]: ../README.md
[4]: _ctor.md
[5]: Name.md
================================================
FILE: docs/api/DbExtensions/TableAttribute/_ctor.md
================================================
TableAttribute Constructor
==========================
Initializes a new instance of the [TableAttribute][1] class
**Namespace:** [DbExtensions][2]
**Assembly:** DbExtensions.dll
Syntax
------
```csharp
public TableAttribute()
```
See Also
--------
#### Reference
[TableAttribute Class][1]
[DbExtensions Namespace][2]
[1]: README.md
[2]: ../README.md
================================================
FILE: docs/api/README.md
================================================
DbExtensions Namespaces
=======================
Namespaces
----------
| Namespace | Description |
| ----------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [DbExtensions][1] | DbExtensions is a data-access framework with a strong focus on query composition, granularity and code aesthetics. [Database][2] is the entry point of the [DbExtensions][1] API. |
[1]: DbExtensions/README.md
[2]: DbExtensions/Database/README.md
================================================
FILE: samples/App/App.config
================================================
================================================
FILE: samples/App/Program.cs
================================================
using System;
using System.Collections;
using System.Collections.Generic;
using System.Configuration;
using System.Data.Common;
using System.IO;
using System.Linq;
using System.Linq.Expressions;
using System.Reflection;
using System.Text.RegularExpressions;
using DbExtensions;
namespace Samples {
using static Console;
class Program {
readonly string
_samplesPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "..", "..", "..", "..");
static void
Main() {
DbProviderFactories.RegisterFactory("Microsoft.Data.SqlClient", Microsoft.Data.SqlClient.SqlClientFactory.Instance);
DbProviderFactories.RegisterFactory("MySql.Data.MySqlClient", MySql.Data.MySqlClient.MySqlClientFactory.Instance);
DbProviderFactories.RegisterFactory("System.Data.SQLite", System.Data.SQLite.SQLiteFactory.Instance);
new Program().Run();
}
void
Run() {
WriteLine("DbExtensions Sample Runner");
WriteLine("==========================");
var connectionStrings = ConfigurationManager.ConnectionStrings
.Cast()
// Only connection strings defined in this application config file
.Where(c => c.ElementInformation.Source != null && c.ElementInformation.Source.EndsWith("dll.config", StringComparison.OrdinalIgnoreCase))
.ToArray();
var connIndex = GetArrayOption(connectionStrings.Select(c => c.Name).ToArray(), "Select a connection string (or Enter to select the first one):");
var connSettings = connectionStrings[connIndex];
var provider = DbProviderFactories.GetFactory(connSettings.ProviderName);
WriteLine();
WriteLine("Provider: {0}", provider.GetType().AssemblyQualifiedName);
WriteLine();
WriteLine("Connecting...");
try {
var db = new Database(connSettings.ConnectionString, connSettings.ProviderName);
using (db.EnsureConnectionOpen()) {
WriteLine("Server Version: {0}", ((DbConnection)db.Connection).ServerVersion);
}
} catch (Exception ex) {
WriteError(ex, fatal: true);
return;
}
var samplesLangs = GetSamplesLanguages();
var samplesLangIndex = GetArrayOption(samplesLangs, "Select the samples language (or Enter):");
var samplesLanguage = samplesLangs[samplesLangIndex];
object[] samples;
try {
samples = GetSamples(samplesLanguage, connSettings).ToArray();
} catch (Exception ex) {
WriteError(ex, fatal: true);
return;
}
var samplesOptions =
(from s in samples
let name = s.GetType().Name
let friendlyName = name.Substring(0, name.Length - "Samples".Length)
select friendlyName)
.Append("All")
.ToArray();
var samplesIndex = GetArrayOption(samplesOptions, "Select the samples category (or Enter to run all):", samplesOptions.Length - 1);
var selectedSamples = (samplesIndex == samplesOptions.Length - 1) ? samples
: [samples[samplesIndex]];
var continueOnErrorOptions = new[] { "Yes", "No" };
var continueOnError = GetArrayOption(continueOnErrorOptions, "Continue on Error:") == 0;
WriteLine();
WriteLine("Press key to begin...");
ReadKey();
for (int i = 0; i < selectedSamples.Length; i++) {
var sampl = selectedSamples[i];
RunSamples(sampl, continueOnError);
if (sampl is IDisposable disp) {
disp.Dispose();
}
WriteLine();
WriteLine((i == selectedSamples.Length - 1) ? "Press key to exit..." : "Press key to continue...");
ReadKey();
}
}
string[]
GetSamplesLanguages() {
var appDir = AppDomain.CurrentDomain.BaseDirectory
.Split(Path.DirectorySeparatorChar, StringSplitOptions.RemoveEmptyEntries)
.Reverse()
.Skip(3)
.First();
var projectsDir = Directory
.GetDirectories(_samplesPath, "*", SearchOption.TopDirectoryOnly)
.Select(s => s.Split(Path.DirectorySeparatorChar).Last())
.Where(s => !s.Equals(appDir))
.ToArray();
return projectsDir;
}
IEnumerable
GetSamples(string language, ConnectionStringSettings connSettings) {
var projectDir = Path.Combine(_samplesPath, language);
var projectFile = Directory.GetFiles(projectDir, String.Format("*.{0}proj", Regex.Replace(language, "[a-z]", "")))
.FirstOrDefault()
?? throw new InvalidOperationException("Project file not found.");
var projectFileName = projectFile.Split(Path.DirectorySeparatorChar).Last();
var assemblyName = String.Join(".", projectFileName.Split('.').Reverse().Skip(1).Reverse());
var assemblyDir = Directory.GetDirectories(Path.Combine(projectDir, "bin", "Debug"), "net*").First();
var assemblyPath = new Uri(Path.Combine(assemblyDir, assemblyName + ".dll")).LocalPath;
var samplesAssembly = Assembly.LoadFrom(assemblyPath);
var dbType = samplesAssembly.GetTypes()
.Where(t => typeof(Database).IsAssignableFrom(t))
.Single();
var db = (Database)Activator.CreateInstance(dbType, connSettings.ConnectionString, connSettings.ProviderName);
db.Configuration.Log = Out;
return
from t in samplesAssembly.GetTypes()
where t.IsPublic
&& t.Name.EndsWith("Samples")
let parameters = t.GetConstructors().First().GetParameters()
let args =
from p in parameters
select (typeof(Database).IsAssignableFrom(p.ParameterType) ? db
: p.ParameterType.IsValueType ? Activator.CreateInstance(p.ParameterType)
: null)
select Activator.CreateInstance(t, args.ToArray());
}
static void
RunSamples(object samples, bool continueOnError) {
var samplesType = samples.GetType();
var isDisposable = samples is IDisposable;
var methods = samplesType
.GetMethods(BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly)
.ToList();
for (int i = 0; i < methods.Count; i++) {
var method = methods[i];
if (isDisposable
&& method.Name == "Dispose") {
continue;
}
WriteLine();
WriteLine(method.Name);
Write(new string('=', method.Name.Length));
WriteLine();
object returnValue = null;
if (method.ReturnType == typeof(void)) {
var runSample = (Action)Delegate.CreateDelegate(typeof(Action), samples, method);
if (continueOnError) {
try {
runSample();
} catch (Exception ex) {
WriteError(ex);
continue;
}
} else {
runSample();
}
} else {
void runSample() {
returnValue = Expression.Lambda>(
Expression.Convert(
Expression.Call(Expression.Constant(samples), method)
, typeof(object)
)
).Compile()();
if (returnValue is IEnumerable ienum) {
returnValue = ienum.Cast().ToArray();
}
}
if (continueOnError) {
try {
runSample();
} catch (Exception ex) {
WriteError(ex);
continue;
}
} else {
runSample();
}
}
if (returnValue != null) {
WriteLine();
if (returnValue is SqlBuilder sql) {
WriteLine(returnValue);
for (int j = 0; j < sql.ParameterValues.Count; j++) {
var value = sql.ParameterValues[j];
var type = value?.GetType();
WriteLine("-- {0}: {1} [{2}]", j, type, value);
}
} else {
var color = ForegroundColor;
ForegroundColor = ConsoleColor.DarkGray;
ObjectDumper.Write(returnValue, 1, Out);
ForegroundColor = color;
}
}
}
}
static int
GetArrayOption(T[] options, string title, int defaultOption = 0) {
var firstTry = true;
var index = -1;
var left = CursorLeft;
while (index < 0 || index >= options.Length) {
if (!firstTry) {
WriteLine();
}
firstTry = false;
WriteLine();
WriteLine(title);
for (int i = 0; i < options.Length; i++) {
if (i > 0) {
Write(", ");
}
Write("[{0}] {1}", i + 1, options[i]);
}
Write(": ");
left = CursorLeft;
var key = ReadKey();
if (key.Key == ConsoleKey.Enter) {
index = defaultOption;
} else {
try {
index = Int32.Parse(key.KeyChar.ToString()) - 1;
} catch (Exception) { }
}
}
var prevColor = ForegroundColor;
ForegroundColor = ConsoleColor.Green;
CursorLeft = left;
Write(options[index]);
WriteLine();
ForegroundColor = prevColor;
return index;
}
static void
WriteError(Exception ex, bool fatal = false) {
var prevColor = ForegroundColor;
ForegroundColor = ConsoleColor.Red;
WriteLine(ex.Message);
ForegroundColor = prevColor;
WriteLine();
WriteLine((fatal) ? "Press key to exit..." : "Press key to continue...");
ReadKey();
}
}
}
================================================
FILE: samples/App/Samples.App.csproj
================================================
Exe
net8.0
12
Always
PreserveNewest
Northwind.mdf
Always
================================================
FILE: samples/App/Utilities/ObjectDumper-LICENSE.txt
================================================
MICROSOFT LIMITED PUBLIC LICENSE version 1.1
This license governs use of code marked as “sample” or “example” available on this web site without a license agreement, as provided under the section above titled “NOTICE SPECIFIC TO SOFTWARE AVAILABLE ON THIS WEB SITE.” If you use such code (the “software”), you accept this license. If you do not accept the license, do not use the software.
1. Definitions
The terms “reproduce,” “reproduction,” “derivative works,” and “distribution” have the same meaning here as under U.S. copyright law.
A “contribution” is the original software, or any additions or changes to the software.
A “contributor” is any person that distributes its contribution under this license.
“Licensed patents” are a contributor’s patent claims that read directly on its contribution.
2. Grant of Rights
(A) Copyright Grant - Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free copyright license to reproduce its contribution, prepare derivative works of its contribution, and distribute its contribution or any derivative works that you create.
(B) Patent Grant - Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free license under its licensed patents to make, have made, use, sell, offer for sale, import, and/or otherwise dispose of its contribution in the software or derivative works of the contribution in the software.
3. Conditions and Limitations
(A) No Trademark License- This license does not grant you rights to use any contributors’ name, logo, or trademarks.
(B) If you bring a patent claim against any contributor over patents that you claim are infringed by the software, your patent license from such contributor to the software ends automatically.
(C) If you distribute any portion of the software, you must retain all copyright, patent, trademark, and attribution notices that are present in the software.
(D) If you distribute any portion of the software in source code form, you may do so only under this license by including a complete copy of this license with your distribution. If you distribute any portion of the software in compiled or object code form, you may only do so under a license that complies with this license.
(E) The software is licensed “as-is.” You bear the risk of using it. The contributors give no express warranties, guarantees or conditions. You may have additional consumer rights under your local laws which this license cannot change. To the extent permitted under your local laws, the contributors exclude the implied warranties of merchantability, fitness for a particular purpose and non-infringement.
(F) Platform Limitation - The licenses granted in sections 2(A) and 2(B) extend only to the software or derivative works that you create that run directly on a Microsoft Windows operating system product, Microsoft run-time technology (such as the .NET Framework or Silverlight), or Microsoft application platform (such as Microsoft Office or Microsoft Dynamics).
================================================
FILE: samples/App/Utilities/ObjectDumper.cs
================================================
// Copyright (C) Microsoft Corporation. All rights reserved.
// See ObjectDumper-LICENSE.txt for license information.
using System;
using System.IO;
using System.Collections;
using System.Collections.Generic;
using System.Reflection;
public class ObjectDumper {
public static void Write(object element)
{
Write(element, 0);
}
public static void Write(object element, int depth)
{
Write(element, depth, Console.Out);
}
public static void Write(object element, int depth, TextWriter log)
{
ObjectDumper dumper = new ObjectDumper(depth);
dumper.writer = log;
dumper.WriteObject(null, element);
}
TextWriter writer;
int pos;
int level;
int depth;
private ObjectDumper(int depth)
{
this.depth = depth;
}
private void Write(string s)
{
if (s != null) {
writer.Write(s);
pos += s.Length;
}
}
private void WriteIndent()
{
for (int i = 0; i < level; i++) writer.Write(" ");
}
private void WriteLine()
{
writer.WriteLine();
pos = 0;
}
private void WriteTab()
{
Write(" ");
while (pos % 8 != 0) Write(" ");
}
private void WriteObject(string prefix, object element)
{
if (element == null || element is ValueType || element is string) {
WriteIndent();
Write(prefix);
WriteValue(element);
WriteLine();
}
else {
IEnumerable enumerableElement = element as IEnumerable;
if (enumerableElement != null) {
foreach (object item in enumerableElement) {
if (item is IEnumerable && !(item is string)) {
WriteIndent();
Write(prefix);
Write("...");
WriteLine();
if (level < depth) {
level++;
WriteObject(prefix, item);
level--;
}
}
else {
WriteObject(prefix, item);
}
}
}
else {
MemberInfo[] members = element.GetType().GetMembers(BindingFlags.Public | BindingFlags.Instance);
WriteIndent();
Write(prefix);
bool propWritten = false;
foreach (MemberInfo m in members) {
FieldInfo f = m as FieldInfo;
PropertyInfo p = m as PropertyInfo;
if (f != null || p != null) {
if (propWritten) {
WriteTab();
}
else {
propWritten = true;
}
Write(m.Name);
Write("=");
Type t = f != null ? f.FieldType : p.PropertyType;
if (t.IsValueType || t == typeof(string)) {
WriteValue(f != null ? f.GetValue(element) : p.GetValue(element, null));
}
else {
if (typeof(IEnumerable).IsAssignableFrom(t)) {
Write("...");
}
else {
Write("{ }");
}
}
}
}
if (propWritten) WriteLine();
if (level < depth) {
foreach (MemberInfo m in members) {
FieldInfo f = m as FieldInfo;
PropertyInfo p = m as PropertyInfo;
if (f != null || p != null) {
Type t = f != null ? f.FieldType : p.PropertyType;
if (!(t.IsValueType || t == typeof(string))) {
object value = f != null ? f.GetValue(element) : p.GetValue(element, null);
if (value != null) {
level++;
WriteObject(m.Name + ": ", value);
level--;
}
}
}
}
}
}
}
}
private void WriteValue(object o)
{
if (o == null) {
Write("null");
}
else if (o is DateTime) {
Write(((DateTime)o).ToShortDateString());
}
else if (o is ValueType || o is string) {
Write(o.ToString());
}
else if (o is IEnumerable) {
Write("...");
}
else {
Write("{ }");
}
}
}
================================================
FILE: samples/CSharp/Database.Annotated.cs
================================================
using System;
using System.Collections.Generic;
using Samples.CSharp.Northwind;
namespace Samples.CSharp {
public class DatabaseAnnotatedSamples {
readonly NorthwindDatabase db;
public DatabaseAnnotatedSamples(NorthwindDatabase db) {
this.db = db;
}
public IEnumerable IncludeManyToOne() {
return db.Products
.Include(p => p.Category)
.Include(p => p.Supplier)
.Take(3)
.AsEnumerable();
}
public IEnumerable IncludeManyToOneNested() {
return db.EmployeeTerritories
.Include(p => p.Territory.Region)
.Take(3)
.AsEnumerable();
}
public Region IncludeOneToMany() {
return db.Regions
.IncludeMany(p => p.Territories)
.First();
}
public bool ContainsKey() {
return db.Products.ContainsKey(1);
}
public Product Find() {
return db.Products.Find(1);
}
public void Transactions_AdoNet() {
using var tx = db.EnsureInTransaction();
// Connection is automatically opened if not open
var order = new Order {
CustomerID = "ALFKI",
OrderDetails = {
new OrderDetail { ProductID = 77, Quantity = 1 },
new OrderDetail { ProductID = 41, Quantity = 2 }
}
};
db.Orders.Add(order);
order.Freight = 10m;
db.Orders.Update(order);
// The following line is not needed when cascade delete is configured on the database
db.OrderDetails.RemoveRange(order.OrderDetails);
db.Orders.Remove(order);
tx.Commit();
// Connection is closed if wasn't open
}
}
}
================================================
FILE: samples/CSharp/Database.Poco.cs
================================================
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using DbExtensions;
using Samples.CSharp.Northwind;
namespace Samples.CSharp {
public class DatabasePocoSamples {
readonly Database db;
public DatabasePocoSamples(Database db) {
this.db = db;
}
public IEnumerable SelectWithManyToOne() {
var query = SQL
.SELECT("p.ProductID, p.ProductName, p.CategoryID, s.SupplierID, '' AS MissingProperty")
._("c.CategoryID AS Category$CategoryID, c.CategoryName AS Category$CategoryName")
._("s.SupplierID AS Supplier$SupplierID, s.CompanyName AS Supplier$CompanyName")
.FROM("Products p")
.LEFT_JOIN("Categories c ON p.CategoryID = c.CategoryID")
.LEFT_JOIN("Suppliers s ON p.SupplierID = s.SupplierID")
.WHERE($"p.ProductID < {3}");
return db.Map(query);
}
public IEnumerable SelectWithManyToOneNested() {
var query = SQL
.SELECT("et.EmployeeID, et.TerritoryID")
._("t.TerritoryID AS Territory$TerritoryID, t.TerritoryDescription AS Territory$TerritoryDescription, t.RegionID AS Territory$RegionID")
._("r.RegionID AS Territory$Region$RegionID, r.RegionDescription AS Territory$Region$RegionDescription")
.FROM("EmployeeTerritories et")
.LEFT_JOIN("Territories t ON et.TerritoryID = t.TerritoryID")
.LEFT_JOIN("Region r ON t.RegionID = r.RegionID")
.WHERE($"et.EmployeeID < {3}");
return db.Map(query);
}
public IEnumerable AnnonymousType() {
var query = SQL
.SELECT("p.ProductID, p.ProductName")
.FROM("Products p")
.WHERE($"p.ProductID < {3}");
return db.Map(query, r => new {
ProductID = r.GetInt32(0),
ProductName = r.GetStringOrNull(1)
});
}
public IEnumerable MappingCalculatedColumn() {
var query = SQL
.SELECT("p.ProductID, (p.UnitPrice * p.UnitsInStock) AS ValueInStock")
.FROM("Products p")
.WHERE($"p.ProductID < {3}")
.ORDER_BY("ValueInStock");
return db.Map(query);
}
public MappingToConstructorArgumentsSample MappingToConstructorArguments() {
var query = SQL
.SELECT("1 AS '1'")
._("'http://example.com' AS Url$1")
._("15.5 AS Price$1, 'USD' AS Price$2");
return db.Map(query)
.Single();
}
public MappingToConstructorArgumentsSample MappingToConstructorArgumentsNested() {
var query = SQL
.SELECT("1 AS '1'")
._("'http://example.com' AS '2$1'")
._("15.5 AS '3$1', 'USD' AS '3$2'");
return db.Map(query)
.Single();
}
public IEnumerable Dynamic() {
var query = SQL
.SELECT("p.ProductID, p.ProductName, p.CategoryID, s.SupplierID")
._("c.CategoryID AS Category$CategoryID, c.CategoryName AS Category$CategoryName")
._("s.SupplierID AS Supplier$SupplierID, s.CompanyName AS Supplier$CompanyName")
.FROM("Products p")
.LEFT_JOIN("Categories c ON p.CategoryID = c.CategoryID")
.LEFT_JOIN("Suppliers s ON p.SupplierID = s.SupplierID")
.WHERE($"p.ProductID < {3}");
return db.Map(query);
}
}
public class ProductWithStockValue : Product {
public decimal ValueInStock { get; set; }
}
public class MappingToConstructorArgumentsSample {
public int Id { get; private set; }
public Uri Url { get; private set; }
public Money? Price { get; private set; }
public MappingToConstructorArgumentsSample(int id) {
this.Id = id;
}
public MappingToConstructorArgumentsSample(int id, Uri url, Money? price)
: this(id) {
this.Url = url;
this.Price = price;
}
}
public struct Money {
public readonly decimal Amount;
public readonly string Currency;
public Money(decimal amount, string currency) {
this.Amount = amount;
this.Currency = currency;
}
public override string ToString() {
return this.Currency + this.Amount.ToString();
}
}
}
================================================
FILE: samples/CSharp/Northwind/Category.cs
================================================
using System;
using System.Collections.ObjectModel;
using DbExtensions;
namespace Samples.CSharp.Northwind {
[Table(Name = "Categories")]
public class Category {
[Column(IsPrimaryKey = true, IsDbGenerated = true)]
public int CategoryID { get; set; }
[Column]
public string CategoryName { get; set; }
[Column]
public string Description { get; set; }
[Column]
public byte[] Picture { get; set; }
[Association(OtherKey = nameof(Product.CategoryID))]
public Collection Products { get; } = new();
}
}
================================================
FILE: samples/CSharp/Northwind/Customer.cs
================================================
using System;
using System.Collections.ObjectModel;
using DbExtensions;
namespace Samples.CSharp.Northwind {
[Table(Name = "Customers")]
public class Customer {
[Column(IsPrimaryKey = true)]
public string CustomerID { get; set; }
[Column]
public string CompanyName { get; set; }
[Column]
public string ContactName { get; set; }
[Column]
public string ContactTitle { get; set; }
[Column]
public string Address { get; set; }
[Column]
public string City { get; set; }
[Column]
public string Region { get; set; }
[Column]
public string PostalCode { get; set; }
[Column]
public string Country { get; set; }
[Column]
public string Phone { get; set; }
[Column]
public string Fax { get; set; }
[Association(OtherKey = nameof(CustomerCustomerDemo.CustomerID))]
public Collection CustomerCustomerDemos { get; } = new();
[Association(OtherKey = nameof(Order.CustomerID))]
public Collection Orders { get; } = new();
}
}
================================================
FILE: samples/CSharp/Northwind/CustomerCustomerDemo.cs
================================================
using System;
using DbExtensions;
namespace Samples.CSharp.Northwind {
[Table]
public class CustomerCustomerDemo {
[Column(IsPrimaryKey = true)]
public string CustomerID { get; set; }
[Column(IsPrimaryKey = true)]
public string CustomerTypeID { get; set; }
[Association(ThisKey = nameof(CustomerTypeID))]
public CustomerDemographic CustomerDemographic { get; set; }
[Association(ThisKey = nameof(CustomerID))]
public Customer Customer { get; set; }
}
}
================================================
FILE: samples/CSharp/Northwind/CustomerDemographic.cs
================================================
using System;
using System.Collections.ObjectModel;
using DbExtensions;
namespace Samples.CSharp.Northwind {
[Table(Name = "CustomerDemographics")]
public class CustomerDemographic {
[Column(IsPrimaryKey = true)]
public string CustomerTypeID { get; set; }
[Column]
public string CustomerDesc { get; set; }
[Association(OtherKey = nameof(CustomerCustomerDemo.CustomerTypeID))]
public Collection CustomerCustomerDemos { get; } = new();
}
}
================================================
FILE: samples/CSharp/Northwind/Employee.cs
================================================
using System;
using System.Collections.ObjectModel;
using DbExtensions;
namespace Samples.CSharp.Northwind {
[Table(Name = "Employees")]
public class Employee {
[Column(IsPrimaryKey = true, IsDbGenerated = true)]
public int EmployeeID { get; set; }
[Column]
public string LastName { get; set; }
[Column]
public string FirstName { get; set; }
[Column]
public string Title { get; set; }
[Column]
public string TitleOfCourtesy { get; set; }
[Column]
public DateTime? BirthDate { get; set; }
[Column]
public DateTime? HireDate { get; set; }
[Column]
public string Address { get; set; }
[Column]
public string City { get; set; }
[Column]
public string Region { get; set; }
[Column]
public string PostalCode { get; set; }
[Column]
public string Country { get; set; }
[Column]
public string HomePhone { get; set; }
[Column]
public string Extension { get; set; }
[Column]
public byte[] Photo { get; set; }
[Column]
public string Notes { get; set; }
[Column]
public int? ReportsTo { get; set; }
[Column]
public string PhotoPath { get; set; }
[Association(ThisKey = nameof(ReportsTo))]
public Employee ReportsToEmployee { get; set; }
[Association(OtherKey = nameof(Employee.ReportsTo))]
public Collection Employees { get; } = new();
[Association(OtherKey = nameof(EmployeeTerritory.EmployeeID))]
public Collection EmployeeTerritories { get; } = new();
[Association(OtherKey = nameof(Order.EmployeeID))]
public Collection Orders { get; } = new();
}
}
================================================
FILE: samples/CSharp/Northwind/EmployeeTerritory.cs
================================================
using System;
using DbExtensions;
namespace Samples.CSharp.Northwind {
[Table(Name = "EmployeeTerritories")]
public class EmployeeTerritory {
[Column(IsPrimaryKey = true)]
public int EmployeeID { get; set; }
[Column(IsPrimaryKey = true)]
public string TerritoryID { get; set; }
[Association(ThisKey = nameof(EmployeeID))]
public Employee Employee { get; set; }
[Association(ThisKey = nameof(TerritoryID))]
public Territory Territory { get; set; }
}
}
================================================
FILE: samples/CSharp/Northwind/NorthwindDatabase.cs
================================================
using System;
using DbExtensions;
namespace Samples.CSharp.Northwind {
public class NorthwindDatabase : Database {
public SqlTable Products => Table();
public SqlTable Orders => Table();
public SqlTable OrderDetails => Table();
public SqlTable Employees => Table();
public SqlTable EmployeeTerritories => Table();
public SqlTable Regions => Table();
public NorthwindDatabase(string connectionString, string providerInvariantName)
: base(connectionString, providerInvariantName) { }
}
}
================================================
FILE: samples/CSharp/Northwind/Order.cs
================================================
using System;
using System.Collections.ObjectModel;
using DbExtensions;
namespace Samples.CSharp.Northwind {
[Table(Name = "Orders")]
public class Order {
[Column(IsPrimaryKey = true, IsDbGenerated = true)]
public int OrderID { get; set; }
[Column]
public string CustomerID { get; set; }
[Column]
public int? EmployeeID { get; set; }
[Column]
public DateTime? OrderDate { get; set; }
[Column]
public DateTime? RequiredDate { get; set; }
[Column]
public DateTime? ShippedDate { get; set; }
[Column]
public int? ShipVia { get; set; }
[Column]
public decimal? Freight { get; set; }
[Column]
public string ShipName { get; set; }
[Column]
public string ShipAddress { get; set; }
[Column]
public string ShipCity { get; set; }
[Column]
public string ShipRegion { get; set; }
[Column]
public string ShipPostalCode { get; set; }
[Column]
public string ShipCountry { get; set; }
[Association(OtherKey = nameof(OrderDetail.OrderID))]
public Collection OrderDetails { get; } = new();
[Association(ThisKey = nameof(CustomerID))]
public Customer Customer { get; set; }
[Association(ThisKey = nameof(EmployeeID))]
public Employee Employee { get; set; }
[Association(ThisKey = nameof(ShipVia))]
public Shipper Shipper { get; set; }
}
}
================================================
FILE: samples/CSharp/Northwind/OrderDetail.cs
================================================
using System;
using DbExtensions;
namespace Samples.CSharp.Northwind {
[Table(Name = "Order Details")]
public class OrderDetail {
[Column(IsPrimaryKey = true)]
public int OrderID { get; set; }
[Column(IsPrimaryKey = true)]
public int ProductID { get; set; }
[Column]
public decimal UnitPrice { get; set; }
[Column]
public short Quantity { get; set; }
[Column]
public float Discount { get; set; }
[Association(ThisKey = nameof(OrderID))]
public Order Order { get; set; }
[Association(ThisKey = nameof(ProductID))]
public Product Product { get; set; }
}
}
================================================
FILE: samples/CSharp/Northwind/Product.cs
================================================
using System;
using System.Collections.ObjectModel;
using DbExtensions;
namespace Samples.CSharp.Northwind {
[Table(Name = "Products")]
public class Product {
[Column(IsPrimaryKey = true, IsDbGenerated = true)]
public int ProductID { get; set; }
[Column]
public string ProductName { get; set; }
[Column]
public int? SupplierID { get; set; }
[Column]
public int? CategoryID { get; set; }
[Column]
public string QuantityPerUnit { get; set; }
[Column]
public decimal? UnitPrice { get; set; }
[Column]
public short? UnitsInStock { get; set; }
[Column]
public short? UnitsOnOrder { get; set; }
[Column]
public short? ReorderLevel { get; set; }
[Column]
public bool Discontinued { get; set; }
[Association(OtherKey = nameof(OrderDetail.ProductID))]
public Collection OrderDetails { get; } = new();
[Association(ThisKey = nameof(CategoryID))]
public Category Category { get; set; }
[Association(ThisKey = nameof(SupplierID))]
public Supplier Supplier { get; set; }
}
}
================================================
FILE: samples/CSharp/Northwind/Region.cs
================================================
using System;
using System.Collections.ObjectModel;
using DbExtensions;
namespace Samples.CSharp.Northwind {
[Table(Name = "Region")]
public class Region {
[Column(IsPrimaryKey = true)]
public int RegionID { get; set; }
[Column]
public string RegionDescription { get; set; }
[Association(OtherKey = nameof(Territory.RegionID))]
public Collection Territories { get; } = new();
}
}
================================================
FILE: samples/CSharp/Northwind/Shipper.cs
================================================
using System;
using System.Collections.ObjectModel;
using DbExtensions;
namespace Samples.CSharp.Northwind {
[Table(Name = "Shippers")]
public class Shipper {
[Column(IsPrimaryKey = true, IsDbGenerated = true)]
public int ShipperID { get; set; }
[Column]
public string CompanyName { get; set; }
[Column]
public string Phone { get; set; }
[Association(OtherKey = nameof(Order.ShipVia))]
public Collection Orders { get; } = new();
}
}
================================================
FILE: samples/CSharp/Northwind/Supplier.cs
================================================
using System;
using System.Collections.ObjectModel;
using DbExtensions;
namespace Samples.CSharp.Northwind {
[Table(Name = "Suppliers")]
public class Supplier {
[Column(IsPrimaryKey = true, IsDbGenerated = true)]
public int SupplierID { get; set; }
[Column]
public string CompanyName { get; set; }
[Column]
public string ContactName { get; set; }
[Column]
public string ContactTitle { get; set; }
[Column]
public string Address { get; set; }
[Column]
public string City { get; set; }
[Column]
public string Region { get; set; }
[Column]
public string PostalCode { get; set; }
[Column]
public string Country { get; set; }
[Column]
public string Phone { get; set; }
[Column]
public string Fax { get; set; }
[Association(OtherKey = nameof(Product.SupplierID))]
public Collection Products { get; } = new();
}
}
================================================
FILE: samples/CSharp/Northwind/Territory.cs
================================================
using System;
using System.Collections.ObjectModel;
using DbExtensions;
namespace Samples.CSharp.Northwind {
[Table(Name = "Territories")]
public class Territory {
[Column(IsPrimaryKey = true)]
public string TerritoryID { get; set; }
[Column]
public string TerritoryDescription { get; set; }
[Column]
public int RegionID { get; set; }
[Association(OtherKey = nameof(EmployeeTerritory.TerritoryID))]
public Collection EmployeeTerritories { get; } = new();
[Association(ThisKey = nameof(RegionID))]
public Region Region { get; set; }
}
}
================================================
FILE: samples/CSharp/Samples.CSharp.csproj
================================================
net8.0
12
================================================
FILE: samples/CSharp/SqlBuilder.cs
================================================
using System;
using DbExtensions;
namespace Samples.CSharp {
public class SqlBuilderSamples {
#pragma warning disable CA1822
public SqlBuilder DynamicSql_1() {
return DynamicSql(2, 3);
}
public SqlBuilder DynamicSql_2() {
return DynamicSql(null, 3);
}
public SqlBuilder DynamicSql_3() {
return DynamicSql(2, null);
}
public SqlBuilder DynamicSql_4() {
return DynamicSql(null, null);
}
SqlBuilder DynamicSql(int? categoryId, int? supplierId) {
return SQL
.SELECT("p.ProductID, p.ProductName")
.FROM("Products p")
.WHERE()
._If(categoryId.HasValue, $"p.CategoryID = {categoryId.Value}")
._If(supplierId.HasValue, $"p.SupplierID = {supplierId.Value}")
.ORDER_BY("p.ProductName, p.ProductID DESC");
}
public SqlBuilder Subquery() {
return SQL
.SELECT($"o.OrderID, o.CustomerID, ({SQL
.SELECT("COUNT(od.Quantity)")
.FROM("OrderDetails od")
.WHERE("od.OrderID = o.OrderID")}) AS TotalItems")
.FROM("Orders o");
}
public SqlBuilder ExtendRawSql() {
return ((SqlBuilder)$"""
SELECT ProductID, ProductName
FROM Products
""")
.WHERE($"CategoryID = {1}");
}
public SqlBuilder ListArgument() {
int[] range = { 1, 2, 3 };
return SQL
.SELECT("p.ProductID, p.CategoryID")
.FROM("Products p")
.WHERE($"p.CategoryID = {1} AND p.ProductID IN ({range:list})")
._($"EXISTS ({SQL
.SELECT("ProductID")
.FROM("OrderDetails")
.WHERE($"OrderID = {77}")})")
.GROUP_BY("p.ProductID");
}
public SqlBuilder Insert() {
return SQL
.INSERT_INTO("Products(ProductName, UnitPrice, CategoryID)")
.VALUES("Chai", 15.56, 5);
}
public SqlBuilder Update() {
return SQL
.UPDATE("Products")
.SET($"Discontinued = {true}")
.WHERE($"ProductID = {1}");
}
public SqlBuilder UpdateWithSubquery() {
return SQL
.UPDATE("Products p")
.SET($"p.Discontinued = {true}")
.WHERE($"p.ProductID = ({SQL
.SELECT("p2.ProductID")
.FROM("Products p2")
.WHERE("p2.ProductID <> p.ProductID")})");
}
public SqlBuilder Delete() {
return SQL
.DELETE_FROM("Products")
.WHERE($"ProductID = {1}");
}
///
/// SELECT Products.*, Categories.CategoryName
/// FROM Categories INNER JOIN Products ON Categories.CategoryID = Products.CategoryID
/// WHERE (((Products.Discontinued)=0))
///
/// Northwind.Alphabetical list of products
public SqlBuilder AlphabeticalListOfProducts() {
return SQL
.SELECT("Products.*, Categories.CategoryName")
.FROM("Categories")
.LEFT_JOIN("Products ON Categories.CategoryID = Products.CategoryID")
.WHERE($"Products.Discontinued = {0}");
}
///
/// SELECT City, CompanyName, ContactName, 'Customers' AS Relationship
/// FROM Customers
/// UNION SELECT City, CompanyName, ContactName, 'Suppliers'
/// FROM Suppliers
///
/// Northwind.Customer and Suppliers by City
public SqlBuilder CustomersAndSuppliersByCity() {
return SQL
.SELECT("City, CompanyName, ContactName, 'Customers' AS Relationship")
.FROM("Customers")
.UNION()
.SELECT("City, CompanyName, ContactName, 'Suppliers'")
.FROM("Suppliers");
}
///
/// SELECT Products.ProductName, Products.UnitPrice
/// FROM Products
/// WHERE Products.UnitPrice > (SELECT AVG(UnitPrice) From Products)
///
/// Northwind.Products Above Average Price
public SqlBuilder ProductsAboveAveragePrice() {
return SQL
.SELECT("Products.ProductName, Products.UnitPrice")
.FROM("Products")
.WHERE($"Products.UnitPrice > ({SQL
.SELECT("AVG(UnitPrice)")
.FROM("Products")})");
}
///
/// SELECT Categories.CategoryName, Products.ProductName,
/// Sum(CONVERT(money,("Order Details".UnitPrice*Quantity*(1-Discount)/100))*100) AS ProductSales
/// FROM (Categories INNER JOIN Products ON Categories.CategoryID = Products.CategoryID)
/// INNER JOIN (Orders
/// INNER JOIN "Order Details" ON Orders.OrderID = "Order Details".OrderID)
/// ON Products.ProductID = "Order Details".ProductID
/// WHERE (((Orders.ShippedDate) Between '19970101' And '19971231'))
/// GROUP BY Categories.CategoryName, Products.ProductName
///
/// Northwind.Product Sales for 1997
public SqlBuilder ProductSalesFor1997() {
return SQL
.SELECT("Categories.CategoryName, Products.ProductName, Sum(CONVERT(money,(\"Order Details\".UnitPrice*Quantity*(1-Discount)/100))*100) AS ProductSales")
.FROM("(Categories").INNER_JOIN("Products ON Categories.CategoryID = Products.CategoryID)")
.INNER_JOIN("(Orders").INNER_JOIN("\"Order Details\" ON Orders.OrderID = \"Order Details\".OrderID) ON Products.ProductID = \"Order Details\".ProductID")
.WHERE($"(((Orders.ShippedDate) Between {new DateTime(1997, 1, 1)} And {new DateTime(1997, 12, 31)}))")
.GROUP_BY("Categories.CategoryName, Products.ProductName");
}
}
}
================================================
FILE: samples/CSharp/SqlSet.cs
================================================
using System;
using System.Collections;
using System.Collections.Generic;
using DbExtensions;
using Samples.CSharp.Northwind;
namespace Samples.CSharp {
public class SqlSetSamples {
readonly SqlSet products;
public SqlSetSamples(Database db) {
this.products = db.From("Products");
}
public bool AreThereAnyProducts() {
return products.Any();
}
public bool DoAllProductsHaveUnitPrice() {
return products.All("NOT UnitPrice IS NULL");
}
public bool DoSomeProductsAreOutOfStock() {
return products.Any("UnitsInStock = 0");
}
public int HowManyProductsAreOutOfStock() {
return products.Count("UnitsInStock = 0");
}
public Product FirstProduct() {
return products.First();
}
public Product SecondProduct() {
return products.Skip(1).First();
}
public Product FirstOutOfStockProduct() {
return products.First("UnitsInStock = 0");
}
public IEnumerable Top5ProductsWithLowestStock() {
return products
.Where("UnitsInStock > 0")
.OrderBy("UnitsInStock")
.Take(5)
.Select("ProductName, UnitsInStock",
r => new { Name = r.GetString(0), UnitsInStock = r.GetInt16(1) })
.AsEnumerable();
}
public IEnumerable NamesOfOutOfStockProducts() {
return products
.Where("UnitsInStock = 0")
.Select("ProductName", r => r.GetString(0))
.AsEnumerable();
}
public Product GetSpecificProduct() {
return products.SingleOrDefault("ProductID = 5");
}
}
}
================================================
FILE: src/DbExtensions/.editorconfig
================================================
[*.cs]
# CA2007: Consider calling ConfigureAwait on the awaited task
dotnet_diagnostic.CA2007.severity = warning
================================================
FILE: src/DbExtensions/Attributes.cs
================================================
// Copyright 2016-2025 Max Toro Q.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#region Based on code from .NET Framework
#endregion
using System;
namespace DbExtensions;
#nullable enable
[AttributeUsage(AttributeTargets.Class)]
sealed class DatabaseAttribute : Attribute {
public string?
Name { get; set; }
}
///
/// Designates a class as an entity class that is associated with a database table.
///
[AttributeUsage(AttributeTargets.Class, Inherited = false)]
public sealed class TableAttribute : Attribute {
///
/// Gets or sets the name of the table or view.
///
public string?
Name { get; set; }
}
///
/// Associates a property with a column in a database table.
///
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Property)]
public sealed class ColumnAttribute : Attribute, IDataAttribute {
bool
_canBeNull = true;
bool
_canBeNullSet = false;
///
/// Gets or sets the name of a column.
///
public string?
Name { get; set; }
///
/// Gets or sets a private storage field to hold the value from a column.
///
string?
IDataAttribute.Storage { get; set; }
///
/// Gets or sets the type of the database column.
///
internal string?
DbType { get; set; }
///
/// Gets or sets the type to convert this member to before sending to the database.
///
public Type?
ConvertTo { get; set; }
internal string?
Expression { get; set; }
///
/// Gets or sets whether this class member represents a column that is part or all of the primary key of the table.
///
public bool
IsPrimaryKey { get; set; }
///
/// Gets or sets whether a column contains values that the database auto-generates.
///
public bool
IsDbGenerated { get; set; }
///
/// Gets or sets whether the column type of the member is a database timestamp or version number.
///
public bool
IsVersion { get; set; }
internal UpdateCheck
UpdateCheck { get; set; } = UpdateCheck.Always;
///
/// Gets or sets the enumeration.
///
public AutoSync
AutoSync { get; set; } = AutoSync.Default;
internal bool
IsDiscriminator { get; set; }
internal bool
CanBeNull {
get => _canBeNull;
set {
_canBeNullSet = true;
_canBeNull = value;
}
}
internal bool
CanBeNullSet => _canBeNullSet;
}
internal enum UpdateCheck {
Always,
Never,
WhenChanged
}
///
/// Used to specify for during INSERT and UPDATE operations when
/// a data member should be read back after the operation completes.
///
public enum AutoSync {
///
/// Automatically selects the value.
///
Default = 0, // Automatically choose
///
/// Always returns the value.
///
Always = 1,
///
/// Never returns the value.
///
Never = 2,
///
/// Returns the value only after an INSERT operation.
///
OnInsert = 3,
///
/// Returns the value only after an UPDATE operation.
///
OnUpdate = 4
}
///
/// Designates a property to represent a database association, such as a foreign key relationship.
///
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Property)]
public sealed class AssociationAttribute : Attribute, IDataAttribute {
///
/// Gets or sets the name of a constraint.
///
public string?
Name { get; set; }
///
/// Gets or sets a private storage field to hold the value for the association property.
///
string?
IDataAttribute.Storage { get; set; }
///
/// Gets or sets members of this entity class to represent the key values on this side of the association.
///
public string?
ThisKey { get; set; }
///
/// Gets or sets one or more members of the target entity class as key values on the other side of the association.
///
public string?
OtherKey { get; set; }
///
/// Gets or sets the indication of a uniqueness constraint on the foreign key.
///
/// When true, this property indicates a true 1:1 relationship.
internal bool
IsUnique { get; set; }
///
/// Gets or sets the member as the foreign key in an association representing a database relationship.
///
internal bool
IsForeignKey { get; set; }
internal string?
DeleteRule { get; set; }
internal bool
DeleteOnNull { get; set; }
}
///
/// Class attribute used to describe an inheritance hierarchy to be mapped.
/// For example,
///
/// [Table(Name = "People")]
/// [InheritanceMapping("P", typeof(Person), IsDefault=true)]
/// [InheritanceMapping("C", typeof(Customer))]
/// [InheritanceMapping("E", typeof(Employee))]
/// class Person { ... }
///
///
[AttributeUsage(AttributeTargets.Class, AllowMultiple = true, Inherited = false)]
sealed class InheritanceMappingAttribute : Attribute {
///
/// Discriminator value in store column for this type.
///
public object
Code { get; }
///
/// Type to instantiate when Key is matched.
///
public Type
Type { get; }
///
/// If discriminator value in store column is unrecognized then instantiate this type.
///
public bool
IsDefault { get; set; }
public
InheritanceMappingAttribute(object code, Type type) {
ArgumentNullException.ThrowIfNull(code);
ArgumentNullException.ThrowIfNull(type);
this.Code = code;
this.Type = type;
}
}
interface IDataAttribute {
string?
Name { get; set; }
string?
Storage { get; set; }
}
///
/// Designates a property as a complex property that groups columns of a table that share the same base name.
///
[AttributeUsage(AttributeTargets.Property)]
public sealed class ComplexPropertyAttribute : Attribute {
///
/// The base name for the columns on the complex property.
/// The default is the property name.
///
public string?
Name { get; set; }
///
/// The separator to use between the base name and the complex property's columns.
/// The default is null, which means the separator is taken from .
/// To use no separator and override the default configuration, use an empty .
///
public string?
Separator { get; set; }
///
/// Initializes a new instance of the class
///
public
ComplexPropertyAttribute() { }
internal
ComplexPropertyAttribute(ComplexPropertyAttribute other) {
this.Name = other.Name;
this.Separator = other.Separator;
}
}
================================================
FILE: src/DbExtensions/Database.cs
================================================
// Copyright 2009-2025 Max Toro Q.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Data.Common;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.IO;
using System.Reflection;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace DbExtensions;
#nullable enable
#if DBEX_QE
///
/// Provides simple data access using and .
///
#else
///
/// Provides simple data access using , and .
///
#endif
public partial class Database : IDisposable {
readonly bool
_disposeConn;
///
/// Gets the connection to associate with new commands.
///
public DbConnection
Connection { get; }
///
/// Gets or sets a transaction to associate with new commands.
///
public DbTransaction?
Transaction { get; set; }
///
/// Provides access to configuration options for this instance.
///
public DatabaseConfiguration
Configuration { get; private set; }
///
/// Initializes a new instance of the class
/// using the provided connection string and provider's invariant name.
///
/// The connection string.
/// The provider's invariant name.
#pragma warning disable CS8618
public
Database(string connectionString, string providerInvariantName) {
ArgumentNullException.ThrowIfNull(connectionString);
ArgumentNullException.ThrowIfNull(providerInvariantName);
var factory = DbProviderFactories.GetFactory(providerInvariantName);
var connection = factory.CreateConnection()
?? throw new ArgumentException("The provider factory CreateConnection() returned null.", nameof(providerInvariantName));
connection.ConnectionString = connectionString;
this.Connection = connection;
_disposeConn = true;
Initialize(providerInvariantName);
}
///
/// Initializes a new instance of the class
/// using the provided connection.
///
/// The connection.
public
Database(DbConnection connection) {
ArgumentNullException.ThrowIfNull(connection);
this.Connection = connection;
Initialize(null);
}
internal // Used by tests
Database(DbConnection connection, string providerInvariantName) {
ArgumentNullException.ThrowIfNull(connection);
ArgumentNullException.ThrowIfNull(providerInvariantName);
this.Connection = connection;
Initialize(providerInvariantName);
}
#pragma warning restore CS8618
void
Initialize(string? providerInvariantName) {
providerInvariantName ??= this.Connection.GetType().Namespace
?? throw new InvalidOperationException("Couldn't determine provider invariant name.");
this.Configuration = new DatabaseConfiguration(
providerInvariantName,
() => CreateCommandBuilder(providerInvariantName));
Initialize2(providerInvariantName);
}
partial void
Initialize2(string providerInvariantName);
DbCommandBuilder?
CreateCommandBuilder(string providerInvariantName) {
var factory = DbProviderFactories.GetFactory(this.Connection)
?? DbProviderFactories.GetFactory(providerInvariantName);
return factory.CreateCommandBuilder();
}
///
/// Opens (if it's not open) and returns an object
/// you can use to close it (if it wasn't open).
///
/// An object to close the connection.
///
/// Use this method with the using statement in C# or Visual Basic to ensure that a block of code
/// is always executed with an open connection.
///
///
///
/// using (db.EnsureConnectionOpen()) {
/// // Execute commands.
/// }
///
///
public IDisposable
EnsureConnectionOpen() {
var conn = this.Connection;
var wasClosed = (conn.State == ConnectionState.Closed);
if (wasClosed) {
conn.Open();
}
return new WrappedConnection((wasClosed) ? conn : null);
}
///
/// Opens (if it's not open) and returns an object
/// you can use to close it (if it wasn't open).
///
/// The to monitor for cancellation requests. The default is .
/// An object to close the connection.
///
/// Use this method with the using statement in C# or Visual Basic to ensure that a block of code
/// is always executed with an open connection.
///
///
///
/// await using (await db.EnsureConnectionOpenAsync()) {
/// // Execute commands.
/// }
///
///
public async ValueTask
EnsureConnectionOpenAsync(CancellationToken cancellationToken = default) {
var conn = this.Connection;
var wasClosed = (conn.State == ConnectionState.Closed);
if (wasClosed) {
await conn.OpenAsync(cancellationToken)
.ConfigureAwait(false);
}
return new WrappedConnection((wasClosed) ? conn : null);
}
///
/// Returns a virtual transaction that you can use to ensure a code block is always executed in
/// a transaction, new or existing.
///
///
/// A virtual transaction you can use to ensure a code block is always executed in
/// a transaction, new or existing.
///
///
/// This method returns a virtual transaction that wraps an existing or new transaction.
/// By calling on the returned object, this object
/// will then call on the wrapped transaction if the
/// transaction was just created, or do nothing if it was previously created.
///
///
///
/// Calls to this method can be nested, like in the following example:
///
///
/// void DoSomething() {
///
/// using (var tx = this.db.EnsureInTransaction()) {
///
/// // Execute commands
///
/// DoSomethingElse();
///
/// tx.Commit();
/// }
/// }
///
/// void DoSomethingElse() {
///
/// using (var tx = this.db.EnsureInTransaction()) {
///
/// // Execute commands
///
/// tx.Commit();
/// }
/// }
///
///
public DbTransaction
EnsureInTransaction() =>
EnsureInTransaction(IsolationLevel.Unspecified);
///
///
/// Specifies the isolation level for the transaction. This parameter is ignored when using
/// an existing transaction.
///
public virtual DbTransaction
EnsureInTransaction(IsolationLevel isolationLevel) {
var connHolder = (WrappedConnection)EnsureConnectionOpen();
var newTx = default(DbTransaction);
try {
if (this.Transaction is null) {
this.Transaction = (newTx = this.Connection.BeginTransaction(isolationLevel));
this.Configuration.Log?.WriteLine("-- TRANSACTION STARTED");
}
} catch {
connHolder.Dispose();
throw;
}
if (newTx != null) {
return new WrappedTransaction(this, newTx, connHolder);
}
return new NoOpTransaction(this.Connection, isolationLevel, connHolder);
}
///
///
///
///
/// Calls to this method can be nested, like in the following example:
///
///
/// async Task DoSomething() {
///
/// await using (var tx = await this.db.EnsureInTransactionAsync()) {
///
/// // Execute commands
///
/// await DoSomethingElse();
///
/// await tx.CommitAsync();
/// }
/// }
///
/// async Task DoSomethingElse() {
///
/// await using (var tx = await this.db.EnsureInTransactionAsync()) {
///
/// // Execute commands
///
/// await tx.CommitAsync();
/// }
/// }
///
///
public ValueTask
EnsureInTransactionAsync(CancellationToken cancellationToken = default) =>
EnsureInTransactionAsync(IsolationLevel.Unspecified, cancellationToken);
///
///
public virtual async ValueTask
EnsureInTransactionAsync(IsolationLevel isolationLevel, CancellationToken cancellationToken = default) {
var connHolder = (WrappedConnection)EnsureConnectionOpen();
var newTx = default(DbTransaction);
try {
if (this.Transaction is null) {
this.Transaction = (newTx = await this.Connection.BeginTransactionAsync(isolationLevel, cancellationToken)
.ConfigureAwait(false));
this.Configuration.Log?.WriteLine("-- TRANSACTION STARTED");
}
} catch {
await connHolder.DisposeAsync()
.ConfigureAwait(false);
throw;
}
if (newTx != null) {
return new WrappedTransaction(this, newTx, connHolder);
}
return new NoOpTransaction(this.Connection, isolationLevel, connHolder);
}
///
/// Executes the command. Optionally uses a transaction and validates
/// affected records value before committing.
///
/// The non-query command to execute.
/// The number of records the command should affect. This value is ignored if less or equal to -1.
/// true if the number of affected records should exactly match ; false if a lower number is acceptable.
/// The number of affected records.
/// The number of affected records is not equal to .
public int
Execute(SqlBuilder nonQuery, int affect = -1, bool exact = false) {
ArgumentNullException.ThrowIfNull(nonQuery);
var command = CreateCommand(nonQuery);
var validateAffected = affect > -1;
using var conn = EnsureConnectionOpen();
using var tx = (validateAffected) ? EnsureInTransaction() : null;
command.Transaction = this.Transaction;
int affectedRecords;
try {
affectedRecords = command.ExecuteNonQuery();
} catch {
Trace(command, error: true);
throw;
}
OnExecuted(command, affect, exact, validateAffected, affectedRecords);
tx?.Commit();
return affectedRecords;
}
///
///
public async ValueTask
ExecuteAsync(SqlBuilder nonQuery, int affect = -1, bool exact = false, CancellationToken cancellationToken = default) {
ArgumentNullException.ThrowIfNull(nonQuery);
var command = CreateCommand(nonQuery);
var validateAffected = affect > -1;
await using var conn = (await EnsureConnectionOpenAsync(cancellationToken)
.ConfigureAwait(false))
.ConfigureAwait(false);
var tx = (validateAffected) ?
await EnsureInTransactionAsync(cancellationToken).ConfigureAwait(false)
: new NoOpTransaction(this.Connection, IsolationLevel.Unspecified, new WrappedConnection(null));
await using var txDisp = tx.ConfigureAwait(false);
command.Transaction = this.Transaction;
int affectedRecords;
try {
affectedRecords = await command.ExecuteNonQueryAsync(cancellationToken)
.ConfigureAwait(false);
} catch {
Trace(command, error: true);
throw;
}
OnExecuted(command, affect, exact, validateAffected, affectedRecords);
await tx.CommitAsync(cancellationToken)
.ConfigureAwait(false);
return affectedRecords;
}
void
OnExecuted(DbCommand command, int affect, bool exact, bool validateAffected, int affectedRecords) {
Trace(command, affectedRecords);
if (validateAffected
&& affectedRecords != affect) {
if (exact) {
throw new ChangeConflictException(String.Create(
CultureInfo.InvariantCulture,
$"The number of affected records should be {affect}, the actual number is {affectedRecords}."));
} else if (affectedRecords > affect) {
throw new ChangeConflictException(String.Create(
CultureInfo.InvariantCulture,
$"The number of affected records should be {affect} or lower, the actual number is {affectedRecords}."));
}
}
}
///
/// Maps the results of the to objects,
/// using the provided delegate.
///
/// The type of objects to map the results to.
/// The query.
/// The delegate for creating objects from an object.
/// The results of the query as objects.
public IEnumerable
Map(SqlBuilder query, Func mapper) {
ArgumentNullException.ThrowIfNull(query);
ArgumentNullException.ThrowIfNull(mapper);
return new MappingEnumerable(CreateCommand(query), mapper, this.Configuration.Log);
}
///
public IAsyncEnumerable
AsyncMap(SqlBuilder query, Func mapper) {
ArgumentNullException.ThrowIfNull(query);
ArgumentNullException.ThrowIfNull(mapper);
return new AsyncMappingEnumerable(CreateCommand(query), mapper, this.Configuration.Log);
}
///
/// Gets the identity value of the last inserted record.
///
/// The identity value of the last inserted record.
///
/// It is very important to keep the connection open between the last
/// command and this one, or else you might get the wrong value.
///
public virtual object?
LastInsertId() {
var sql = this.Configuration.LastInsertIdCommand;
if (String.IsNullOrEmpty(sql)) {
throw new InvalidOperationException("Configuration.LastInsertIdCommand cannot be null or empty.");
}
var command = CreateCommand(new SqlBuilder(sql.Length, 0).Append(sql));
var value = command.ExecuteScalar();
Trace(command);
return value;
}
///
///
public virtual async ValueTask
LastInsertIdAsync(CancellationToken cancellationToken = default) {
var sql = this.Configuration.LastInsertIdCommand;
if (String.IsNullOrEmpty(sql)) {
throw new InvalidOperationException("Configuration.LastInsertIdCommand cannot be null or empty.");
}
var command = CreateCommand(new SqlBuilder(sql.Length, 0).Append(sql));
var value = await command.ExecuteScalarAsync(cancellationToken)
.ConfigureAwait(false);
Trace(command);
return value;
}
///
/// Creates and returns a object from the specified .
///
/// The that provides the command's text and parameters.
///
/// A new object with its property
/// initialized with the 's string representation, and its
/// property is initialized with the values from the property of the parameter.
///
public virtual DbCommand
CreateCommand(SqlBuilder sqlBuilder) {
ArgumentNullException.ThrowIfNull(sqlBuilder);
var command = this.Connection.CreateCommand();
var format = sqlBuilder.ToString();
var parameters = sqlBuilder.ParameterValues;
if (this.Transaction is { } tx) {
command.Transaction = tx;
}
if (this.Configuration.CommandTimeout is { } timeout and > -1) {
command.CommandTimeout = timeout;
}
if (parameters is null or { Count: 0 }) {
command.CommandText = format;
return command;
}
var paramPlaceholders = new object[parameters.Count];
for (int i = 0; i < paramPlaceholders.Length; i++) {
var paramValue = parameters[i];
var dbParam = paramValue as DbParameter;
if (dbParam is null) {
dbParam = command.CreateParameter();
dbParam.Value = paramValue ?? DBNull.Value;
}
dbParam.ParameterName = this.Configuration.ParameterNameBuilder
.Invoke($"p{i}");
command.Parameters.Add(dbParam);
paramPlaceholders[i] = this.Configuration.ParameterPlaceholderBuilder
.Invoke(dbParam.ParameterName);
}
command.CommandText = String.Format(CultureInfo.InvariantCulture, format, paramPlaceholders);
return command;
}
///
/// Given an unquoted identifier in the correct catalog case, returns the correct quoted form of that identifier.
///
/// The original identifier.
/// The quoted version of the identifier. If the indentifier is already quoted it's returned unchanged.
public string
QuoteIdentifier(string identifier) {
QuoteIdentifierImpl(identifier, out var quotePrefix, out var quoteSuffix);
return String.Concat(quotePrefix, identifier, quoteSuffix);
}
internal void
QuoteIdentifier(StringBuilder sb, string identifier) {
QuoteIdentifierImpl(identifier, out var quotePrefix, out var quoteSuffix);
sb.Append(quotePrefix);
sb.Append(identifier);
sb.Append(quoteSuffix);
}
void
QuoteIdentifierImpl(string identifier, out string quotePrefix, out string quoteSuffix) {
ArgumentNullException.ThrowIfNull(identifier);
quotePrefix = this.Configuration.QuotePrefix;
quoteSuffix = this.Configuration.QuoteSuffix;
if (quotePrefix.Length == 0
&& quoteSuffix.Length == 0) {
return;
}
if (identifier.StartsWith(quotePrefix, StringComparison.Ordinal)
&& identifier.EndsWith(quoteSuffix, StringComparison.Ordinal)) {
quotePrefix = String.Empty;
quoteSuffix = String.Empty;
}
}
internal void
Trace(DbCommand command, int? affectedRecords = null, bool error = false) =>
Trace(command, this.Configuration.Log, affectedRecords, error);
internal static void
Trace(DbCommand command, TextWriter? log, int? affectedRecords = null, bool error = false) {
if (log is not null) {
log.WriteLine();
if (error) {
log.WriteLine("-- ERROR: The following command produced an error");
}
log.WriteLine(command.CommandText);
for (int i = 0; i < command.Parameters.Count; i++) {
var param = command.Parameters[i];
if (param is not null) {
log.WriteLine(String.Create(log.FormatProvider, $"-- {param.ParameterName}: {param.Direction} {param.DbType} (Size = {param.Size}) [{param.Value}]"));
}
}
if (affectedRecords is not null) {
log.WriteLine(String.Create(log.FormatProvider, $"-- [{affectedRecords.Value}] records affected."));
}
}
}
///
/// Releases all resources used by the current instance of the class.
///
public void
Dispose() {
Dispose(true);
GC.SuppressFinalize(this);
}
///
/// Releases the resources used by this instance.
///
///
/// true if this method is being called due to a call to ; otherwise, false .
///
protected virtual void
Dispose(bool disposing) {
if (disposing) {
if (_disposeConn) {
this.Connection?.Dispose();
}
}
}
// Object Members
///
[EditorBrowsable(EditorBrowsableState.Never)]
public override bool
Equals(object? obj) => base.Equals(obj);
///
[EditorBrowsable(EditorBrowsableState.Never)]
public override int
GetHashCode() => base.GetHashCode();
///
[EditorBrowsable(EditorBrowsableState.Never)]
public new Type
GetType() => base.GetType();
///
[EditorBrowsable(EditorBrowsableState.Never)]
public override string?
ToString() => base.ToString();
sealed class WrappedConnection(DbConnection? previouslyClosedConn) : IDisposable, IAsyncDisposable {
public void
Dispose() {
if (previouslyClosedConn is { State: not ConnectionState.Closed } conn) {
conn.Close();
}
}
public async ValueTask
DisposeAsync() {
if (previouslyClosedConn is { State: not ConnectionState.Closed } conn) {
await conn.CloseAsync()
.ConfigureAwait(false);
}
}
}
sealed class WrappedTransaction : DbTransaction {
readonly Database
_db;
readonly DbTransaction
_tx;
readonly WrappedConnection
_connHolder;
protected override DbConnection?
DbConnection => _tx.Connection;
public override IsolationLevel
IsolationLevel => _tx.IsolationLevel;
public
WrappedTransaction(Database db, DbTransaction tx, WrappedConnection connHolder) {
_db = db;
_tx = tx;
_connHolder = connHolder;
}
public override void
Commit() {
try {
_tx.Commit();
_db.Configuration.Log?.WriteLine("-- TRANSACTION COMMITED");
} finally {
RemoveTxFromDatabase();
}
}
public override async Task
CommitAsync(CancellationToken cancellationToken = default) {
try {
await _tx.CommitAsync(cancellationToken)
.ConfigureAwait(false);
_db.Configuration.Log?.WriteLine("-- TRANSACTION COMMITED");
} finally {
RemoveTxFromDatabase();
}
}
public override void
Rollback() {
try {
_tx.Rollback();
_db.Configuration.Log?.WriteLine("-- TRANSACTION ROLLED BACK");
} finally {
RemoveTxFromDatabase();
}
}
public override async Task
RollbackAsync(CancellationToken cancellationToken = default) {
try {
await _tx.RollbackAsync(cancellationToken)
.ConfigureAwait(false);
_db.Configuration.Log?.WriteLine("-- TRANSACTION ROLLED BACK");
} finally {
RemoveTxFromDatabase();
}
}
protected override void
Dispose(bool disposing) {
if (disposing) {
try {
try {
_tx.Dispose();
} finally {
RemoveTxFromDatabase();
}
} finally {
_connHolder.Dispose();
}
}
}
public override async ValueTask
DisposeAsync() {
try {
try {
await _tx.DisposeAsync()
.ConfigureAwait(false);
} finally {
RemoveTxFromDatabase();
}
} finally {
await _connHolder.DisposeAsync()
.ConfigureAwait(false);
}
}
void
RemoveTxFromDatabase() {
if (Object.ReferenceEquals(_tx, _db.Transaction)) {
_db.Transaction = null;
}
}
}
sealed class NoOpTransaction(DbConnection conn, IsolationLevel isolationLevel, WrappedConnection connHolder) : DbTransaction {
protected override DbConnection?
DbConnection => conn;
public override IsolationLevel
IsolationLevel => isolationLevel;
public override void
Commit() { }
public override void
Rollback() =>
throw new NotImplementedException();
protected override void
Dispose(bool disposing) {
if (disposing) {
connHolder.Dispose();
}
}
public override async ValueTask
DisposeAsync() {
await connHolder.DisposeAsync()
.ConfigureAwait(false);
}
}
}
///
/// Holds configuration options that customize the behavior of .
/// This class cannot be instantiated, to get an instance use the property.
///
public sealed partial class DatabaseConfiguration {
static readonly Func
_getParameterNameI = (Func)
Delegate.CreateDelegate(typeof(Func), typeof(DbCommandBuilder)
.GetMethod("GetParameterName", BindingFlags.Instance | BindingFlags.NonPublic, Type.DefaultBinder, [typeof(int)], null)!);
static readonly Func
_getParameterNameS = (Func)
Delegate.CreateDelegate(typeof(Func), typeof(DbCommandBuilder)
.GetMethod("GetParameterName", BindingFlags.Instance | BindingFlags.NonPublic, Type.DefaultBinder, [typeof(string)], null)!);
static readonly Func
_getParameterPlaceholder = (Func)
Delegate.CreateDelegate(typeof(Func), typeof(DbCommandBuilder)
.GetMethod("GetParameterPlaceholder", BindingFlags.Instance | BindingFlags.NonPublic, Type.DefaultBinder, [typeof(int)], null)!);
string?
_quotePrefix;
string?
_quoteSuffix;
Func?
_parameterNameBuilder;
Func?
_parameterPlaceholderBuilder;
string?
_lastInsertIdCommand;
///
/// Gets or sets the beginning character or characters to use when specifying database objects (for example, tables or columns)
/// whose names contain characters such as spaces or reserved tokens.
///
[AllowNull]
public string
QuotePrefix {
get => _quotePrefix ?? "[";
set => _quotePrefix = value;
}
///
/// Gets or sets the ending character or characters to use when specifying database objects (for example, tables or columns)
/// whose names contain characters such as spaces or reserved tokens.
///
[AllowNull]
public string
QuoteSuffix {
get => _quoteSuffix ?? "]";
set => _quoteSuffix = value;
}
///
/// Specifies a function that prepares a parameter name to be used on .
///
[AllowNull]
public Func
ParameterNameBuilder {
get => _parameterNameBuilder ?? DefaultParameterNameBuilder;
set => _parameterNameBuilder = value;
}
///
/// Specifies a function that builds a parameter placeholder to be used in SQL statements.
///
[AllowNull]
public Func
ParameterPlaceholderBuilder {
get => _parameterPlaceholderBuilder ?? DefaultParameterPlaceholderBuilder;
set => _parameterPlaceholderBuilder = value;
}
///
/// Gets or sets the SQL command that returns the last identity value generated on the database.
///
[AllowNull]
public string
LastInsertIdCommand {
get => _lastInsertIdCommand ?? "SELECT @@IDENTITY";
set => _lastInsertIdCommand = value;
}
///
/// Specifies the destination to write the SQL query or command.
///
public TextWriter?
Log { get; set; }
///
/// Specifies a timeout to assign to commands. This setting is ignored if less or equal to -1. The default is -1.
///
public int
CommandTimeout { get; set; } = -1;
internal SqlDialect
SqlDialect { get; set; }
static string
DefaultParameterNameBuilder(string name) => "@" + name;
static string
DefaultParameterPlaceholderBuilder(string name) => name;
#pragma warning disable CS8618
internal
DatabaseConfiguration(string providerInvariantName, Func? cbFn = null) {
#pragma warning restore CS8618
switch (providerInvariantName) {
case "Microsoft.Data.SqlClient":
this.LastInsertIdCommand = "SELECT SCOPE_IDENTITY()";
this.SqlDialect = SqlDialect.TSql;
break;
case "MySql.Data.MySqlClient":
this.QuotePrefix = "`";
this.QuoteSuffix = this.QuotePrefix;
break;
case "System.Data.Odbc":
case "System.Data.OleDb":
this.ParameterNameBuilder = (name) => name;
this.ParameterPlaceholderBuilder = (paramName) => "?";
break;
case "System.Data.SQLite":
this.LastInsertIdCommand = "SELECT LAST_INSERT_ROWID()";
break;
default:
if (cbFn?.Invoke() is { } cb) {
Initialize(cb);
}
break;
}
}
void
Initialize(DbCommandBuilder cb) {
var qp = cb.QuotePrefix;
var qs = cb.QuoteSuffix;
if (!String.IsNullOrEmpty(qp)
|| !String.IsNullOrEmpty(qs)) {
this.QuotePrefix = qp ?? String.Empty;
this.QuoteSuffix = qs ?? String.Empty;
}
this.ParameterNameBuilder = (name) => _getParameterNameS.Invoke(cb, name);
var pName = _getParameterNameI.Invoke(cb, 1);
var pPlace = _getParameterPlaceholder.Invoke(cb, 1);
if (!(Object.ReferenceEquals(pName, pPlace)
|| pName == pPlace)) {
this.ParameterPlaceholderBuilder = (paramName) => pPlace.Replace(pName, paramName);
}
}
}
enum SqlDialect {
Default = 0,
TSql
}
///
/// An exception that is thrown when a concurrency violation is encountered while saving to the database. A concurrency violation
/// occurs when an unexpected number of rows are affected during save. This is usually because the data in the database has
/// been modified since it was loaded into memory.
///
public sealed class ChangeConflictException : Exception {
///
/// Initializes a new instance of the class
/// with a specified error message.
///
/// The message that describes the error.
public
ChangeConflictException(string message)
: base(message) { }
}
sealed class MappingEnumerable : IEnumerable, IEnumerable, IEnumerator, IEnumerator, IDisposable {
readonly DbCommand
_command;
readonly Func
_mapper;
readonly TextWriter?
_logger;
readonly bool
_prevStateWasClosed;
bool
_used;
DbDataReader?
_reader;
TResult
_current;
public TResult
Current => _current;
object
IEnumerator.Current => Current!;
#pragma warning disable CS8618
public
MappingEnumerable(DbCommand command, Func mapper, TextWriter? logger) {
#pragma warning restore CS8618
var conn = command.Connection
?? throw new ArgumentException("command.Connection cannot be null.", nameof(command));
_prevStateWasClosed = (conn.State == ConnectionState.Closed);
_command = command;
_mapper = mapper;
_logger = logger;
}
public IEnumerator
GetEnumerator() {
if (!_used) {
_used = true;
return this;
}
throw new InvalidOperationException("Cannot enumerate more than once.");
}
IEnumerator
IEnumerable.GetEnumerator() =>
GetEnumerator();
public bool
MoveNext() {
if (_reader is null) {
PossiblyOpenConnection();
try {
_reader = _command.ExecuteReader();
Database.Trace(_command, _logger, _reader.RecordsAffected);
} catch {
try {
Database.Trace(_command, _logger, error: true);
} finally {
PossiblyCloseConnection();
}
throw;
}
}
if (_reader.IsClosed) {
// see MappingContext.LoadMany()
return false;
}
try {
if (_reader.Read()) {
_current = _mapper.Invoke(_reader);
return true;
}
} catch {
PossiblyCloseConnection();
throw;
}
PossiblyCloseConnection();
return false;
}
public void
Reset() =>
throw new NotSupportedException();
public void
Dispose() {
_reader?.Dispose();
PossiblyCloseConnection();
}
void
PossiblyOpenConnection() {
if (_prevStateWasClosed) {
_command.Connection?.Open();
}
}
void
PossiblyCloseConnection() {
if (_prevStateWasClosed
&& _command.Connection is { State: not ConnectionState.Closed } conn) {
conn.Close();
}
}
}
sealed class AsyncMappingEnumerable : IAsyncEnumerable, IAsyncEnumerator {
readonly DbCommand
_command;
readonly Func
_mapper;
readonly TextWriter?
_logger;
readonly bool
_prevStateWasClosed;
bool
_used;
CancellationToken
_cancellationToken;
DbDataReader?
_reader;
TResult
_current;
public TResult
Current => _current;
#pragma warning disable CS8618
public
AsyncMappingEnumerable(DbCommand command, Func mapper, TextWriter? logger) {
#pragma warning restore CS8618
var conn = command.Connection
?? throw new ArgumentException("command.Connection cannot be null.", nameof(command));
_prevStateWasClosed = (conn.State == ConnectionState.Closed);
_command = command;
_mapper = mapper;
_logger = logger;
}
public IAsyncEnumerator