From 57b0bb2b566d1712ed14471f1df44bd267250954 Mon Sep 17 00:00:00 2001 From: MaceWindu Date: Sat, 11 May 2024 15:32:59 +0200 Subject: [PATCH 1/5] updates for v6 release --- source/articles/CLI.md | 2 +- .../articles/get-started/asp-dotnet-core/index.md | 13 +++++++------ source/articles/get-started/install/index.md | 2 +- source/articles/get-started/toc.yml | 2 +- source/docfx.json | 8 ++++---- source/filterConfig.yml | 9 --------- source/toc.yml | 4 ++-- 7 files changed, 16 insertions(+), 24 deletions(-) diff --git a/source/articles/CLI.md b/source/articles/CLI.md index c2b0582..a8fab58 100644 --- a/source/articles/CLI.md +++ b/source/articles/CLI.md @@ -27,7 +27,7 @@ uid: cli ## Installation > [!NOTE] -> Requres .NET Core 3.1 or higher. +> Requres .NET 6 or higher. Install as global tool: diff --git a/source/articles/get-started/asp-dotnet-core/index.md b/source/articles/get-started/asp-dotnet-core/index.md index ffb14ef..f9e991f 100644 --- a/source/articles/get-started/asp-dotnet-core/index.md +++ b/source/articles/get-started/asp-dotnet-core/index.md @@ -5,8 +5,6 @@ author: khahn # Configuring LINQ To DB for ASP.NET Core -Available since: 3.0.0-rc.0 - In this walkthrough, you will configure an ASP.NET Core application to access a local SQLite Database using LINQ To DB ## Prerequisites @@ -29,7 +27,7 @@ dotnet new webapp -o gettingStartedLinqToDBAspNet We can now use the CLI to install LINQ To DB and database provider (SQLite in this walkthrough) ```txt -dotnet add package linq2db.AspNet +dotnet add package linq2db.Extensions dotnet add package System.Data.SQLite.Core ``` @@ -38,7 +36,8 @@ dotnet add package System.Data.SQLite.Core We're going to create a custom data connection to use to access LINQ To DB, create a class like this: ```C# -using LinqToDB.Configuration; +using LinqToDB.Extensions.DependencyInjection; +using LinqToDB.Extensions.Logging; using LinqToDB.Data; public class AppDataConnection: DataConnection @@ -91,7 +90,8 @@ public class Startup public void ConfigureServices(IServiceCollection services) { //... - //using LinqToDB.AspNet + //using LinqToDB.Extensions.DependencyInjection + //using LinqToDB.Extensions.Logging services.AddLinqToDBContext((provider, options) => options //will configure the AppDataConnection to use @@ -232,7 +232,8 @@ public class Startup public void ConfigureServices(IServiceCollection services) { //... - //using LinqToDB.AspNet + //using LinqToDB.DependencyInjection.DependencyInjection + //using LinqToDB.DependencyInjection.Logging services.AddLinqToDBContext((provider, options) => options //will configure the AppDataConnection to use diff --git a/source/articles/get-started/install/index.md b/source/articles/get-started/install/index.md index 60d11bd..2c667f9 100644 --- a/source/articles/get-started/install/index.md +++ b/source/articles/get-started/install/index.md @@ -5,7 +5,7 @@ author: sdanyliv # Installing LINQ To DB from Nuget -You can develop many different types of applications that target .NET (Core), .NET Framework, or other platforms supported by LINQ To DB. +You can develop many different types of applications that target .NET, .NET Framework, or other platforms supported by LINQ To DB. * install main `linq2db` package: `nuget install linq2db` * install ADO.NET provider(s) from nuget (if they available on nuget) or locally for providers with custom installer diff --git a/source/articles/get-started/toc.yml b/source/articles/get-started/toc.yml index de41969..28369d9 100644 --- a/source/articles/get-started/toc.yml +++ b/source/articles/get-started/toc.yml @@ -2,5 +2,5 @@ href: install/index.md - name: Use with Existing Database href: full-dotnet/existing-db.md -- name: ASP.NET Core +- name: ASP.NET Application Example href: asp-dotnet-core/index.md diff --git a/source/docfx.json b/source/docfx.json index 4328286..ba97731 100644 --- a/source/docfx.json +++ b/source/docfx.json @@ -21,13 +21,13 @@ "src": [ { "files": [ - "linq2db/Source/LinqToDB.AspNet/LinqToDB.AspNet.csproj" + "linq2db/Source/LinqToDB.Extensions/LinqToDB.Extensions.csproj" ], "src": "../submodules" } ], - "dest": "api/linq2db.aspnet", - "globalNamespaceId": "linq2db.aspnet", + "dest": "api/linq2db.extensions", + "globalNamespaceId": "linq2db.extensions", "filter": "filterConfig.yml" }, { @@ -102,7 +102,7 @@ "files": [ "api/linq2db/*.yml", "api/linq2db.tools/*.yml", - "api/linq2db.aspnet/*.yml", + "api/linq2db.extensions/*.yml", "api/linq2db.efcore/*.yml", "api/linq2db.identity/*.yml", "api/linq2db.remote.grpc/*.yml", diff --git a/source/filterConfig.yml b/source/filterConfig.yml index d69c981..469d9f6 100644 --- a/source/filterConfig.yml +++ b/source/filterConfig.yml @@ -1,10 +1 @@ apiRules: -- exclude: - uidRegex: ^System\.Object\..* - type: Member -- exclude: - uidRegex: ^LinqToDB\.AnalyticFunctions\.I.* - type: Interface -- exclude: - uidRegex: ^System\.Attribute\..* - type: Member diff --git a/source/toc.yml b/source/toc.yml index 2c0d508..4a22a3e 100644 --- a/source/toc.yml +++ b/source/toc.yml @@ -5,8 +5,8 @@ items: - name: Linq To DB href: api/linq2db/ - - name: Linq To DB for ASP.NET Core - href: api/linq2db.aspnet/ + - name: Linq To DB Extensions + href: api/linq2db.extensions/ - name: Linq To DB over GRPC href: api/linq2db.remote.grpc/ - name: Linq To DB over WCF From 1b5b9e8fb7ae72f73aef3cf51cab7ad9f5270eb6 Mon Sep 17 00:00:00 2001 From: MaceWindu Date: Wed, 22 Jan 2025 13:14:58 +0100 Subject: [PATCH 2/5] update documentation --- .gitmodules | 4 - source/articles/CLI.md | 1 + source/articles/T4.md | 352 +++++++++++++++--------- source/articles/cli-help.txt | 100 ++----- source/articles/general/interceptors.md | 21 ++ source/articles/sql/CTE.md | 10 +- source/docfx.json | 16 +- submodules/LinqToDB.Identity | 2 +- submodules/linq2db | 2 +- submodules/linq2db.EntityFrameworkCore | 1 - 10 files changed, 292 insertions(+), 217 deletions(-) delete mode 160000 submodules/linq2db.EntityFrameworkCore diff --git a/.gitmodules b/.gitmodules index 55380eb..50e6721 100644 --- a/.gitmodules +++ b/.gitmodules @@ -2,10 +2,6 @@ path = submodules/linq2db url = https://github.com/linq2db/linq2db.git branch = release -[submodule "submodules/linq2db.EntityFrameworkCore"] - path = submodules/linq2db.EntityFrameworkCore - url = https://github.com/linq2db/linq2db.EntityFrameworkCore.git - branch = release [submodule "submodules/LinqToDB.Identity"] path = submodules/LinqToDB.Identity url = https://github.com/linq2db/LinqToDB.Identity.git diff --git a/source/articles/CLI.md b/source/articles/CLI.md index a8fab58..8c0a29d 100644 --- a/source/articles/CLI.md +++ b/source/articles/CLI.md @@ -628,6 +628,7 @@ public sealed class PropertyModel public Modifiers Modifiers { get; set; } public bool IsDefault { get; set; } public bool HasSetter { get; set; } + public Modifiers SetterModifiers { get; set; } public string? TrailingComment { get; set; } public List? CustomAttributes { get; set; } } diff --git a/source/articles/T4.md b/source/articles/T4.md index c7b0869..15f98c7 100644 --- a/source/articles/T4.md +++ b/source/articles/T4.md @@ -55,45 +55,52 @@ All loaded schema information is used for mappings generation, so if you want to ```cs // Enables loading of tables and views information GetSchemaOptions.GetTables = true; + // Enables loading of foreign key relations for associations GetSchemaOptions.GetForeignKeys = true; + // Enables loading of functions and procedures information GetSchemaOptions.GetProcedures = true; + // Enables use of System.Char type in generated model for text types // with length 1 instead of System.String GetSchemaOptions.GenerateChar1AsString = false; + // Enables generation of provider-specific type for column or parameter mapping // when both common .net type and provider-specific type supported. GetSchemaOptions.PreferProviderSpecificTypes = false; // (string[]) List of schemas to select. -// Option applied only if is is not empty +// Option applied only if is not empty GetSchemaOptions.IncludedSchemas = null; + // (string[]) List of schemas to exclude from select. -// Option applied only if is is not empty +// Option applied only if is not empty GetSchemaOptions.ExcludedSchemas = null; + // (string) explicit name of default schema. // If not specified, use default schema for current connection. GetSchemaOptions.DefaultSchema = null; // Option makes sense only for providers that return schema for several databases // (string[]) List of databases/catalogs to select. -// Option applied only if is is not empty +// Option applied only if is not empty GetSchemaOptions.IncludedCatalogs = null; + // Option makes sense only for providers that return schema for several databases // (string[]) List of databases/catalogs to exclude from select. -// Option applied only if is is not empty +// Option applied only if is not empty GetSchemaOptions.ExcludedCatalogs = null; // Custom filter for table/view schema load // Can be used to exclude views or tables from generation based in their descriptor. -// This filter especially usefull, when you wan't to exclude table, referenced by other generated +// This filter especially useful, when you want to exclude table, referenced by other generated // tables using associations, or by procedures using excluded table as result. Doing it in filter // will automatically prevent associations generation and will trigger generation of procedure-specific // result classes. // LoadTableData type: // https://github.com/linq2db/linq2db/blob/master/Source/LinqToDB/SchemaProvider/LoadTableData.cs -Func GetSchemaOptions.LoadTable = null; +Func GetSchemaOptions.LoadTable = null; // Comparer, used for IncludedSchemas/ExcludedSchemas/IncludedCatalogs/ExcludedCatalogs lookups StringComparer = StringComparer.OrdinalIgnoreCase; @@ -103,13 +110,14 @@ StringComparer = StringComparer.OrdinalIgnoreCase; // Also check GenerateProcedureErrors option below // ProcedureSchema type: // https://github.com/linq2db/linq2db/blob/master/Source/LinqToDB/SchemaProvider/ProcedureSchema.cs -GetSchemaOptions.LoadProcedure = (ProcedureSchema p) => true; +GetSchemaOptions.LoadProcedure = (ProcedureSchema p) => true; + // SQL Server 2012+ only // true: use sp_describe_first_result_set procedure to load procedure schema -// false: use CommandBehavior.SchemaOnly to load procedure schema -GetSchemaOptions.UseSchemaOnly = Common.Configuration.SqlServer.UseSchemaOnlyToGetSchema = false; +// false: use CommandBehavior.SchemaOnly to load procedure schema +GetSchemaOptions.UseSchemaOnly = Common.Configuration.SqlServer.UseSchemaOnlyToGetSchema = false; -// type: Func +// type: Func // Defines custom association naming logic // https://github.com/linq2db/linq2db/blob/master/Source/LinqToDB/SchemaProvider/ForeignKeySchema.cs GetSchemaOptions.GetAssociationMemberName = null; @@ -123,14 +131,18 @@ GetSchemaOptions.ProcedureLoadingProgress = (int total, int current) => {}; Use the following initialization **before** you call the `LoadMetadata()` method. +### Global/generic options + ```cs -/* Global/generic options */ // Namespace to use for generated model -NamespaceName = "DataModels"; +NamespaceName = "DataModels"; + // Enables generation of nullable reference type annotations -EnableNullableReferenceTypes = false; +EnableNullableReferenceTypes = true; + // Disable CS8618 for uninitialized model columns and references of non-nullable reference type -EnforceModelNullability = true; +EnforceModelNullability = true; + // Defines method to distinguish value types from reference types by type name // used by nullable reference types feature to detect reference types, when only type name available // If EnableNullableReferenceTypes enabled, but value type not recognized properly @@ -143,151 +155,232 @@ EnforceModelNullability = true; // } // }; // by default resolve unknown types, ending with ? as value types and other types as reference types -Func IsValueType = IsValueTypeDefault; +Func IsValueType = IsValueTypeDefault; +``` + +### DataContext configuration + +```c# -/* Data context configuration */ -// (string) Name of base class for generated data context class. -// Default: LinqToDB.Data.DataConnection. -BaseDataContextClass = null; // (string) Name of data context class. // Default: + "DB" -DataContextName = null; +DataContextName = null; + +// (string) Name of base class for generated data context class. +// Default: LinqToDB.Data.DataConnection or LinqToDB.IDataContext. +BaseDataContextClass = null; + // Enables generation of constructors for data context class. -// Disabling could be usefull if you need to have custom implementation +// Disabling could be useful if you need to have custom implementation // of constructors in partial class -GenerateConstructors = true; // Enforce generating DataContext constructors. +GenerateConstructors = true; + // (string) Defines name of default configuration to use with default data context constructor -DefaultConfiguration = null; +DefaultConfiguration = null; + +// Enables generation of data model only without data context class. +GenerateModelOnly = false; + +// Enables generation of data model as an interface. +GenerateModelInterface = false; + // Enables generation of data context comment with database name, data source and database version -GenerateDatabaseInfo = true; +GenerateDatabaseInfo = true; + +// Generates constructors that call user-defined methods returning DataOptions +GetDataOptionsMethod = "GetDataOptions({0})"; + +// Generates data options constructors +GenerateDataOptionsConstructors = true; +``` + +### Schemas configuration + +```c# +// Enables generation of mappings for each schema in separate type (db.MySchema.MyTable) +GenerateSchemaAsType = false; -/* Schemas configuration */ -// Enables generation of mappings for each schema in separate type -GenerateSchemaAsType = false; // Contains mapping of schema name to corresponding schema class name // By default is empty and class name generated from schema name // Requires GenerateSchemaAsType=true set -SchemaNameMapping = Dictionary(); +SchemaNameMapping = Dictionary(); + // Suffix, added to schema class name // Requires GenerateSchemaAsType=true set -SchemaNameSuffix = "Schema" +SchemaNameSuffix = "Schema"; + // Name of data context class for schema. // Requires GenerateSchemaAsType=true set -SchemaDataContextTypeName = "DataContext" +SchemaDataContextTypeName = "DataContext" +``` -/* Table mappings configuration */ +### Table mappings configuration + +```c# // (string) Specify base class (or comma-separated list of class and/or interfaces) for table mappings -BaseEntityClass = null; +BaseEntityClass = null; + // Enables generation of TableAttribute.Database property using database name, returned by schema loader -GenerateDatabaseName = false; +GenerateDatabaseName = false; + // Enables generation of TableAttribute.Database property with provided name value. // (string) If set, overrides GenerateDatabaseName behavior -DatabaseName = null; +DatabaseName = null; + // Enables generation of TableAttribute.Server property with provided name value. -ServerName = null; +ServerName = null; + // Enables generation of TableAttribute.Schema property for default schema -IncludeDefaultSchema = true; +IncludeDefaultSchema = true; + // Enables generation of mappings for views -GenerateViews = true; +GenerateViews = true; + // Enables prefixing mapping classes for tables in non-default schema with schema name // E.g. MySchema.MyTable -> MySchema_MyTable // Applicable only if GenerateSchemaAsType = false -PrefixTableMappingWithSchema = true; +PrefixTableMappingWithSchema = true; + // Enables prefixing mapping classes for tables in default schema with schema name // E.g. dbo.MyTable -> dbo_MyTable // Applicable only if IncludeDefaultSchema = true && GenerateSchemaAsType = false && PrefixTableMappingWithSchema = true PrefixTableMappingForDefaultSchema = false; -/* Columns comfiguration */ +// Generates database name from TableSchema.CatalogName +GenerateDatabaseNameFromTable = false; + +``` + +### Columns configuration + +```c# // Enables compact generation of column properties -IsCompactColumns = true; +IsCompactColumns = true; + // Enables compact generation of aliased column properties IsCompactColumnAliases = true; -// Enables generation of DataType, Length, Precision and Scale properties of ColumnAttribute. -// Could be overriden (except DataType) by options below + +// Enables generation of DataType, Length, Precision and Scale properties +// of ColumnAttribute. Could be overridden (except DataType) by options below GenerateDataTypes = false; + // (boolean) Enables or disables generation of ColumnAttribute.Length property. // If null, GenerateDataTypes value is used GenerateLengthProperty = null; + // (boolean) Enables or disables generation of ColumnAttribute.Precision property. // If null, GenerateDataTypes value is used GeneratePrecisionProperty = null; + // (boolean) Enables or disables generation of ColumnAttribute.Scale property. // If null, GenerateDataTypes value is used GenerateScaleProperty = null; + // Enables generation of ColumnAttribute.DbType property. GenerateDbTypes = false; + // Enables generation of ObsoleteAttribute for column aliases GenerateObsoleteAttributeForAliases = false; +``` -/* Associations configuration */ +### Associations configuration + +```c# // Defines type template for one-to-many association, when it is generated as a member of table mapping. // Some other options: "{0}[]", "List<{0}>". OneToManyAssociationType = "IEnumerable<{0}>"; + // Enables generation of associations in table mappings GenerateAssociations = true; + // Enables generation of back side of association. Applies to both table mapping members and extension // associations GenerateBackReferences = true; + // Enables generation of associations as extension methods for related table mapping classes GenerateAssociationExtensions = false; + // Defines method to generate name for "one" side of association Func GetAssociationExtensionSingularName = GetAssociationExtensionSingularNameDefault; + // Defines method to generate name for "many" side of association Func GetAssociationExtensionPluralName = GetAssociationExtensionPluralNameDefault; -/* Procedures and functions configuration */ +// Enables generation of association columns using 'nameof' expression +GenerateNameOf = true; +``` + +### Procedures and functions configuration + +```c# // Enables use of existing table mappings for procedures and functions that return same results as // defined by mapping -ReplaceSimilarTables = true; +ReplaceSimilarTables = true; + // If enabled, procedure schema load error will be generated as #error directive and fail build // of output file. Useful for initial generation to highlight places, that require review or // additional hints for schema loader // Also check GetSchemaOptions.LoadProcedure option above -GenerateProcedureErrors = true; +GenerateProcedureErrors = true; + // If enabled, methods for procedures that return table will be generated with List return type and // IMPORTANT: this will lead to load of all procedure results into list and could lead // to performance issues on big results -GenerateProcedureResultAsList = false; +GenerateProcedureResultAsList = false; + // Enables stored procedure methods to accept generated context object or DataConnection type GenerateProceduresOnTypedContext = true; +``` + +### Other generated functionality -/* Other generated functionality */ +```c# // Enables generation of Find(pk fields) extension methods for record selection by primary key value -GenerateFindExtensions = true; +GenerateFindExtensions = true; +``` + +### Pluralization services -/* Pluralization services */ +```c# // Enables pluralization of table mapping classes PluralizeClassNames = false; + // Enables singularization of table mapping classes SingularizeClassNames = true; + // Enables pluralization of ITable<> properties in data context PluralizeDataContextPropertyNames = true; + // Enables singularization of ITable<> properties in data context SingularizeDataContextPropertyNames = false; -/* Naming configuration */ -// Enables normalization of of type and member names. +// Enables pluralization of foreign key names +PluralizeForeignKeyNames = true; + +// Enables singularization of foreign key names +SingularizeForeignKeyNames = true; +``` + +### Naming configuration + +```c# +// Enables normalization of type and member names. // Default normalization removes underscores and capitalize first letter. -// Could be overriden using ToValidName option below. +// Could be overridden using ToValidName option below. // By default doesn't normalize names without underscores. // see NormalizeNamesWithoutUnderscores setting -NormalizeNames = true; -// enables parameter name normalization for procedures/functions -NormalizeParameterName = true; -// enables column property name normalization for procedure/table function result table -NormalizeProcedureColumnName = true; +NormalizeNames = true; + // enables normalization of names without underscores. -NormalizeNamesWithoutUnderscores = false; +NormalizeNamesWithoutUnderscores = false; + // Defines logic to convert type/member name, derived from database object name, to C# identifier. Func ToValidName = ToValidNameDefault; + // Makes C# identifier valid by removing unsupported symbols and calling ToValidName Func ConvertToCompilable = ConvertToCompilableDefault; -// Defines C# identifier normalization logic. -// Default implementation calls ConvertToCompilable and then escape names equal to C# identifiers -Func NormalizeName = NormalizeNameDefault; ``` ## Provider specific options @@ -350,21 +443,25 @@ GetFK("Orders", "FK_Orders_Customers").MemberName = "Customers"; GetFK("Orders", "FK_Orders_Customers").AssociationType = AssociationType.OneToMany; SetTable(string tableName, - string TypeName = null, - string DataContextPropertyName = null) + string TypeName = null, + string DataContextPropertyName = null) - .Column(string columnName, string MemberName = null, string Type = null, bool? IsNullable = null) - .FK (string fkName, string MemberName = null, AssociationType? AssociationType = null) - ; + .Column(string columnName, string MemberName = null, string Type = null, bool? IsNullable = null) + .FK (string fkName, string MemberName = null, AssociationType? AssociationType = null) + ; // Adds extra namespace to usings Model.Usings.Add("MyNamespace"); -// Replaces all property names for columns where name is '' + 'ID' with 'ID'. +// Replaces all property names for columns where name is '' + 'ID' with 'ID' +// and adds a base interface to the generated class. foreach (var t in Tables.Values) - foreach (var c in t.Columns.Values) - if (c.IsPrimaryKey && c.MemberName == t.TypeName + "ID") - c.MemberName = "ID"; + foreach (var c in t.Columns.Values) + if (c.IsPrimaryKey && c.MemberName == t.TypeName + "ID") + { + c.MemberName = "ID"; + t.Interfaces.Add("IIdentifiable"); + } ``` ## Useful members and data structures @@ -381,84 +478,85 @@ ForeignKey GetForeignKey(string tableName, string fkName); public class Table { - public string Schema; - public string TableName; - public string DataContextPropertyName; - public bool IsView; - public string Description; - public string AliasPropertyName; - public string AliasTypeName; - public string TypeName; - - public Dictionary Columns; - public Dictionary ForeignKeys; + public string Schema; + public string TableName; + public string DataContextPropertyName; + public bool IsView; + public string Description; + public string AliasPropertyName; + public string AliasTypeName; + public string TypeName; + + public Dictionary Columns; + public Dictionary ForeignKeys; } public partial class Column : Property { - public string ColumnName; // Column name in database - public bool IsNullable; - public bool IsIdentity; - public string ColumnType; // Type of the column in database - public DbType DbType; - public string Description; - public bool IsPrimaryKey; - public int PrimaryKeyOrder; - public bool SkipOnUpdate; - public bool SkipOnInsert; - public bool IsDuplicateOrEmpty; - public string AliasName; - public string MemberName; + public string ColumnName; // Column name in database + public bool IsNullable; + public bool IsIdentity; + public string ColumnType; // Type of the column in database + public DbType DbType; + public string Description; + public bool IsPrimaryKey; + public int PrimaryKeyOrder; + public bool SkipOnUpdate; + public bool SkipOnInsert; + public bool IsDuplicateOrEmpty; + public string AliasName; + public string MemberName; } public enum AssociationType { - Auto, - OneToOne, - OneToMany, - ManyToOne, + Auto, + OneToOne, + OneToMany, + ManyToOne, } public partial class ForeignKey : Property { - public string KeyName; - public Table OtherTable; - public List ThisColumns; - public List OtherColumns; - public bool CanBeNull; - public ForeignKey BackReference; - public string MemberName; - public AssociationType AssociationType; + public string KeyName; + public Table OtherTable; + public List ThisColumns; + public List OtherColumns; + public bool CanBeNull; + public ForeignKey BackReference; + public string MemberName; + public AssociationType AssociationType; } public partial class Procedure : Method { - public string Schema; - public string ProcedureName; - public bool IsFunction; - public bool IsTableFunction; - public bool IsDefaultSchema; - - public Table ResultTable; - public Exception ResultException; - public List SimilarTables; - public List ProcParameters; + public string Schema; + public string ProcedureName; + public bool IsFunction; + public bool IsTableFunction; + public bool IsDefaultSchema; + + public Table ResultTable; + public Exception ResultException; + public List
SimilarTables; + public List ProcParameters; } public class Parameter { - public string SchemaName; - public string SchemaType; - public bool IsIn; - public bool IsOut; - public bool IsResult; - public int? Size; - public string ParameterName; - public string ParameterType; - public Type SystemType; - public string DataType; + public string SchemaName; + public string SchemaType; + public bool IsIn; + public bool IsOut; + public bool IsResult; + public int? Size; + public string ParameterName; + public string ParameterType; + public Type SystemType; + public string DataType; } ``` + ## IEquatable interface implementation (Equatable.ttinclude) There is `Equatable.ttinclude` template that could be used to implement `IEquatable` interface. diff --git a/source/articles/cli-help.txt b/source/articles/cli-help.txt index 098e0e6..4bc6147 100644 --- a/source/articles/cli-help.txt +++ b/source/articles/cli-help.txt @@ -1,4 +1,4 @@ -dotnet linq2db - Linq To DB command-line utilities. Version: 5.2.1.0 +dotnet linq2db - Linq To DB command-line utilities. Version: 6.0.0.0 Usage: dotnet linq2db scaffold @@ -124,9 +124,9 @@ Options: If you choose T4, you can create initial empty template using 'dotnet linq2db template' command. It will generate initial template file with pre-generated extension points which you can modify to implement required customizations. Customization using compiled assembly has several requirements: - - it should be compatible with current runtime, used by 'dotnet linq2db' tool (netcoreapp3.1 by default); + - it should be compatible with current runtime, used by 'dotnet linq2db' tool; - assembly should contain exactly one interceptor class with customization logic. It should be inherited from ScaffoldInterceptors and has default public constructor; - - linq2db.Tools version should match tool's version to avoid possible compatibility issues/errors. + - linq2db.Scaffold version should match tool's version to avoid possible compatibility issues/errors. === Database Schema : database schema load @@ -229,7 +229,7 @@ Options: --include-tables Users,Roles,Permissions JSON examples: { "schema": { "include-tables": [ "Users", { "name": "Roles", "schema": "dbo" } ] } } // Users and dbo.Roles tables - { "schema": { "include-tables": [ { "regex": "^audit_.$+", "schema": "dbo" } ] } } // all tables starting from audit_ prefix + { "schema": { "include-tables": [ { "regex": "^audit_.+$", "schema": "dbo" } ] } } // all tables starting from audit_ prefix Provided table names should have same casing as actual table name in database. Specifying this option in command line has several limitations and it is recommended to use JSON for it instead: @@ -260,7 +260,7 @@ Options: --exclude-tables Users,Roles,Permissions JSON examples: { "schema": { "exclude-tables": [ "Users", { "name": "Roles", "schema": "dbo" } ] } } // Users and dbo.Roles tables ignored - { "schema": { "exclude-tables": [ { "regex": "^audit_.$+", "schema": "dbo" } ] } } // all tables starting from audit_ prefix ignored + { "schema": { "exclude-tables": [ { "regex": "^audit_.+$", "schema": "dbo" } ] } } // all tables starting from audit_ prefix ignored Provided table names should have same casing as actual table name in database. Specifying this option in command line has several limitations and it is recommended to use JSON for it instead: @@ -291,7 +291,7 @@ Options: --include-views Users,Roles,Permissions JSON examples: { "schema": { "include-views": [ "Users", { "name": "Roles", "schema": "dbo" } ] } } // Users and dbo.Roles views - { "schema": { "include-views": [ { "regex": "^audit_.$+", "schema": "dbo" } ] } } // all views starting from audit_ prefix + { "schema": { "include-views": [ { "regex": "^audit_.+$", "schema": "dbo" } ] } } // all views starting from audit_ prefix Provided view names should have same casing as actual view name in database. Specifying this option in command line has several limitations and it is recommended to use JSON for it i nstead: @@ -322,7 +322,7 @@ Options: --exclude-views Users,Roles,Permissions JSON examples: { "schema": { "exclude-views": [ "Users", { "name": "Roles", "schema": "dbo" } ] } } // Users and dbo.Roles views ignored - { "schema": { "exclude-views": [ { "regex": "^audit_.$+", "schema": "dbo" } ] } } // all views starting from audit_ prefix ignored + { "schema": { "exclude-views": [ { "regex": "^audit_.+$", "schema": "dbo" } ] } } // all views starting from audit_ prefix ignored Provided view names should have same casing as actual view name in database. Specifying this option in command line has several limitations and it is recommended to use JSON for it i nstead: @@ -353,7 +353,7 @@ Options: --procedures-with-schema GetUsers,GetRoles,LoadPermissions JSON examples: { "schema": { "procedures-with-schema": [ "GetUsers", { "name": "LoadPermissions", "schema": "dbo" } ] } } // GetUsers and dbo.LoadPermissions procedures - { "schema": { "procedures-with-schema": [ { "regex": "^Load.$+", "schema": "dbo" } ] } } // all procedures starting from Load prefix + { "schema": { "procedures-with-schema": [ { "regex": "^Load.+$", "schema": "dbo" } ] } } // all procedures starting from Load prefix Provided stored procedure names should have same casing as actual procedure name in database. Specifying this option in command line has several limitations and it is recommended to use JSON for it instead: @@ -384,7 +384,7 @@ Options: --procedures-without-schema FormatAllDrives,DropAllTables JSON examples: { "schema": { "procedures-without-schema": [ "DropAllTables", { "name": "FormatAllDrives", "schema": "dbo" } ] } } // DropAllTables and dbo.FormatAllDrives procedures schema not loaded - { "schema": { "procedures-without-schema": [ { "regex": "^Delete.$+", "schema": "dbo" } ] } } // all procedures starting from Delete prefix + { "schema": { "procedures-without-schema": [ { "regex": "^Delete.+$", "schema": "dbo" } ] } } // all procedures starting from Delete prefix Provided stored procedure names should have same casing as actual procedure name in database. Specifying this option in command line has several limitations and it is recommended to use JSON for it instead: @@ -415,7 +415,7 @@ Options: --include-stored-procedures GetUsers,GetRoles,LoadPermissions JSON examples: { "schema": { "include-stored-procedures": [ "ActiveUsers", { "name": "InactiveUsers", "schema": "dbo" } ] } } // ActiveUsers and dbo.InactiveUsers procedures - { "schema": { "include-stored-procedures": [ { "regex": "^Query.$+", "schema": "dbo" } ] } } // all stored procedures starting from Query prefix + { "schema": { "include-stored-procedures": [ { "regex": "^Query.+$", "schema": "dbo" } ] } } // all stored procedures starting from Query prefix Provided stored procedures names should have same casing as actual procedure name in database. Specifying this option in command line has several limitations and it is recommended to use JSON for it instead: @@ -446,7 +446,7 @@ Options: --exclude-stored-procedure GetUsers,GetRoles,LoadPermissions JSON examples: { "schema": { "exclude-stored-procedure": [ "TestProcedure", { "name": "CheckDb", "schema": "dbo" } ] } } // TestProcedure and dbo.CheckDb procedures ignored - { "schema": { "exclude-stored-procedure": [ { "regex": "^Audit.$+", "schema": "dbo" } ] } } // all stored procedures starting from Audit prefix ignored + { "schema": { "exclude-stored-procedure": [ { "regex": "^Audit.+$", "schema": "dbo" } ] } } // all stored procedures starting from Audit prefix ignored Provided stored procedures names should have same casing as actual procedure name in database. Specifying this option in command line has several limitations and it is recommended to use JSON for it instead: @@ -477,7 +477,7 @@ Options: --include-table-functions GetUsers,GetRoles,LoadPermissions JSON examples: { "schema": { "include-table-functions": [ "ActiveUsers", { "name": "InactiveUsers", "schema": "dbo" } ] } } // ActiveUsers and dbo.InactiveUsers functions - { "schema": { "include-table-functions": [ { "regex": "^Query.$+", "schema": "dbo" } ] } } // all table functions starting from Query prefix + { "schema": { "include-table-functions": [ { "regex": "^Query.+$", "schema": "dbo" } ] } } // all table functions starting from Query prefix Provided table functions names should have same casing as actual function name in database. Specifying this option in command line has several limitations and it is recommended to us e JSON for it instead: @@ -508,7 +508,7 @@ Options: --exclude-table-functions GetUsers,GetRoles,LoadPermissions JSON examples: { "schema": { "exclude-table-functions": [ "TestFunction", { "name": "CheckDb", "schema": "dbo" } ] } } // TestFunction and dbo.CheckDb functions ignored - { "schema": { "exclude-table-functions": [ { "regex": "^Audit.$+", "schema": "dbo" } ] } } // all table functions starting from Audit prefix ignored + { "schema": { "exclude-table-functions": [ { "regex": "^Audit.+$", "schema": "dbo" } ] } } // all table functions starting from Audit prefix ignored Provided table functions names should have same casing as actual function name in database. Specifying this option in command line has several limitations and it is recommended to us e JSON for it instead: @@ -539,7 +539,7 @@ Options: --include-scalar-functions GetUsers,GetRoles,LoadPermissions JSON examples: { "schema": { "include-scalar-functions": [ "ActiveUsers", { "name": "InactiveUsers", "schema": "dbo" } ] } } // ActiveUsers and dbo.InactiveUsers functions - { "schema": { "include-scalar-functions": [ { "regex": "^Query.$+", "schema": "dbo" } ] } } // all scalar functions starting from Query prefix + { "schema": { "include-scalar-functions": [ { "regex": "^Query.+$", "schema": "dbo" } ] } } // all scalar functions starting from Query prefix Provided scalar functions names should have same casing as actual function name in database. Specifying this option in command line has several limitations and it is recommended to u se JSON for it instead: @@ -570,7 +570,7 @@ Options: --exclude-scalar-functions GetUsers,GetRoles,LoadPermissions JSON examples: { "schema": { "exclude-scalar-functions": [ "TestFunction", { "name": "CheckDb", "schema": "dbo" } ] } } // TestFunction and dbo.CheckDb functions ignored - { "schema": { "exclude-scalar-functions": [ { "regex": "^Audit.$+", "schema": "dbo" } ] } } // all scalar functions starting from Audit prefix ignored + { "schema": { "exclude-scalar-functions": [ { "regex": "^Audit.+$", "schema": "dbo" } ] } } // all scalar functions starting from Audit prefix ignored Provided scalar functions names should have same casing as actual function name in database. Specifying this option in command line has several limitations and it is recommended to u se JSON for it instead: @@ -601,7 +601,7 @@ Options: --include-aggregate-functions GetUsers,GetRoles,LoadPermissions JSON examples: { "schema": { "include-aggregate-functions": [ "ActiveUsers", { "name": "InactiveUsers", "schema": "dbo" } ] } } // ActiveUsers and dbo.InactiveUsers functions - { "schema": { "include-aggregate-functions": [ { "regex": "^Query.$+", "schema": "dbo" } ] } } // all aggregate functions starting from Query prefix + { "schema": { "include-aggregate-functions": [ { "regex": "^Query.+$", "schema": "dbo" } ] } } // all aggregate functions starting from Query prefix Provided aggregate functions names should have same casing as actual function name in database. Specifying this option in command line has several limitations and it is recommended t o use JSON for it instead: @@ -632,7 +632,7 @@ Options: --exclude-aggregate-functions GetUsers,GetRoles,LoadPermissions JSON examples: { "schema": { "exclude-aggregate-functions": [ "TestFunction", { "name": "CheckDb", "schema": "dbo" } ] } } // TestFunction and dbo.CheckDb functions ignored - { "schema": { "exclude-aggregate-functions": [ { "regex": "^Audit.$+", "schema": "dbo" } ] } } // all aggregate functions starting from Audit prefix ignored + { "schema": { "exclude-aggregate-functions": [ { "regex": "^Audit.+$", "schema": "dbo" } ] } } // all aggregate functions starting from Audit prefix ignored Provided aggregate functions names should have same casing as actual function name in database. Specifying this option in command line has several limitations and it is recommended t o use JSON for it instead: @@ -775,6 +775,12 @@ Options: JSON examples: { "dataModel": { "base-context": "LinqToDB.DataContext" } } + --add-init-context : generate InitDataContext partial method on data context for custom context setup + type: bool (optional) + json: dataModel.add-init-context + default: true + default (T4 mode): true + --add-associations : generate association properties on entities type: bool (optional) json: dataModel.add-associations @@ -1690,66 +1696,6 @@ Options: - ignore_all_caps : bool : when set, casing not applied to names that contain only uppercase letters If you don't specify some property, CLI will use default value for current option. This allows you to override only some properties without need to specify all properties. - table-function-methodinfo-field-name : (allowed only in JSON) table function FieldInfo field naming options - type: object (optional) - json: dataModel.table-function-methodinfo-field-name - default: { - "case" : "camel_case", - "pluralization" : "none", - "prefix" : "_", - "suffix" : null, - "transformation" : "split_by_underscore", - "pluralize_if_ends_with_word_only": false, - "ignore_all_caps" : false, - } - default (T4 mode): { - "case" : "camel_case", - "pluralization" : "none", - "prefix" : "_", - "suffix" : null, - "transformation" : "split_by_underscore", - "pluralize_if_ends_with_word_only": false, - "ignore_all_caps" : false, - } - JSON examples: - -{ - "dataModel": - { - "table-function-methodinfo-field-name": - { - "case" : "pascal_case", - "pluralization": "singular", - "suffix" : "Record" - } - } -} - - Naming options could be specified only in JSON file and defined as object with following properties: - - case : string : specify name casing (see values below) - + "none" : no casing applied to identifier - + "pascal_case" : identifier cased using PascalCase - + "camel_case" : identifier cased using camelCase - + "snake_case" : identifier cased using snake_case - + "lower_case" : identifier cased using lowercase - + "upper_case" : identifier cased using UPPERCASE - + "t4_pluralized" : emulation of casing logic for pluralized names used by T4 templates (compat. option) - + "t4" : emulation of casing logic for non-pluralized names used by T4 templates (compat. option) - - pluralization : string : specify name pluralization (see values below) - + "none" : don't pluralize identifier - + "singular" : singularize identifier - + "plural" : pluralize identifier - + "plural_multiple_characters" : pluralize identifier only when last word is longer than one character - - prefix : string? : optional name prefix - - suffix : string? : optional name suffix - - transformation : string : base name transformation logic (see values below) - + "none" : no transformations applied, treat whole identifier as one word - + "split_by_underscore" : split base name, got from database object name, into separate words by underscore (_) - + "association" : emulation of identifier generation logic for association name used by T4 templates (compat. option) - - pluralize_if_ends_with_word_only : bool : when set, pluralization not applied if name ends with non-word (e.g. with digit) - - ignore_all_caps : bool : when set, casing not applied to names that contain only uppercase letters - If you don't specify some property, CLI will use default value for current option. This allows you to override only some properties without need to specify all properties. - function-tuple-class-name : (allowed only in JSON) tuple class naming options for scalar function with tuple return type type: object (optional) json: dataModel.function-tuple-class-name diff --git a/source/articles/general/interceptors.md b/source/articles/general/interceptors.md index 5867aea..6adda88 100644 --- a/source/articles/general/interceptors.md +++ b/source/articles/general/interceptors.md @@ -13,6 +13,7 @@ This API available since `Linq To DB` 4.0.0 - [`IDataContextInterceptor`](#idatacontextinterceptor) - [`ICommandInterceptor`](#icommandinterceptor) - [`IConnectionInterceptor`](#iconnectioninterceptor) + - [`IExceptionInterceptor`](#iexceptioninterceptor) - [Interceptors Registration](#interceptors-registration) - [Interceptors support per context](#interceptors-support-per-context) - [Migration](#migration) @@ -249,6 +250,24 @@ struct ConnectionEventData } ``` +### `IExceptionInterceptor` + +Base abstract class: `ExceptionInterceptor`. + +This interceptor provides access to query execution exception inspection/interception. + +```cs +public interface IExceptionInterceptor : IInterceptor +{ + void ProcessException(ExceptionEventData eventData, Exception exception); +} + +public readonly struct ExceptionEventData +{ + public IDataContext DataContext { get; } +} +``` + ## Interceptors Registration Interceptors could be registred using multiple ways: @@ -299,12 +318,14 @@ var dc = new DataConnection(options); - `IDataContextInterceptor` - `IEntityServiceInterceptor` - `IUnwrapDataObjectInterceptor` + - `IExceptionInterceptor` - `DataContext` and `DataConnection`: - `ICommandInterceptor` - `IConnectionInterceptor` - `IDataContextInterceptor` - `IEntityServiceInterceptor` - `IUnwrapDataObjectInterceptor` + - `IExceptionInterceptor` ## Migration diff --git a/source/articles/sql/CTE.md b/source/articles/sql/CTE.md index a5eccfc..151adaa 100644 --- a/source/articles/sql/CTE.md +++ b/source/articles/sql/CTE.md @@ -211,17 +211,17 @@ ORDER BY |Database Engine| Minimal version| |----------|----------| +|[ClickHouse](https://clickhouse.com/docs/en/sql-reference/statements/select/with/)| | +|[IBM DB2](https://www.ibm.com/docs/en/db2-for-zos/11?topic=statement-common-table-expression)| 8 | |[Firebird](https://firebirdsql.org/refdocs/langrefupd21-select.html#langrefupd21-select-cte)|2.1| -|[MS SQL](https://docs.microsoft.com/en-us/sql/t-sql/queries/with-common-table-expression-transact-sql)|2008| +|[IBM Informix](https://www.ibm.com/docs/en/informix-servers/14.10?topic=statements-statement-common-table-expressions)| 14.10 | |[MySQL](https://dev.mysql.com/doc/refman/8.0/en/with.html)|8.0.1| |[Oracle](https://docs.oracle.com/database/121/SQLRF/statements_10002.htm#BABCGAAJ)|11g Release 2| |[PostgreSQL](https://www.postgresql.org/docs/current/queries-with.html)|8.4| +|[SAP HANA](https://help.sap.com/docs/SAP_HANA_PLATFORM/4fe29514fd584807ac9f2a04f6754767/20fcf24075191014a89e9dc7b8408b26.html#loio20fcf24075191014a89e9dc7b8408b26__with_clause)| | |[SQLite](https://www.sqlite.org/lang_with.html)|3.8.3| -|[IBM DB2](https://www.ibm.com/docs/en/db2-for-zos/11?topic=statement-common-table-expression)| 8 | -|[IBM Informix](https://www.ibm.com/docs/en/informix-servers/14.10?topic=statements-statement-common-table-expressions)| 14.10 | -|[ClickHouse](https://clickhouse.com/docs/en/sql-reference/statements/select/with/)| | +|[MS SQL](https://docs.microsoft.com/en-us/sql/t-sql/queries/with-common-table-expression-transact-sql)|2008| ## Known limitations * Oracle and Firebird DML operations that use CTE are not completely implemented. -* Informix CTE are not yet [implemented](https://github.com/linq2db/linq2db/issues/1852). diff --git a/source/docfx.json b/source/docfx.json index ba97731..7d7bfd9 100644 --- a/source/docfx.json +++ b/source/docfx.json @@ -73,7 +73,20 @@ "src": [ { "files": [ - "linq2db.EntityFrameworkCore/Source/LinqToDB.EntityFrameworkCore/linq2db.EntityFrameworkCore.csproj" + "linq2db/Source/LinqToDB.Scaffold/LinqToDB.Scaffold.csproj" + ], + "src": "../submodules" + } + ], + "dest": "api/linq2db.scaffold", + "globalNamespaceId": "linq2db.scaffold", + "filter": "filterConfig.yml" + }, + { + "src": [ + { + "files": [ + "linq2db/Source/LinqToDB.EntityFrameworkCore/LinqToDB.EntityFrameworkCore.csproj" ], "src": "../submodules" } @@ -102,6 +115,7 @@ "files": [ "api/linq2db/*.yml", "api/linq2db.tools/*.yml", + "api/linq2db.scaffold/*.yml", "api/linq2db.extensions/*.yml", "api/linq2db.efcore/*.yml", "api/linq2db.identity/*.yml", diff --git a/submodules/LinqToDB.Identity b/submodules/LinqToDB.Identity index b7739f5..a9ca319 160000 --- a/submodules/LinqToDB.Identity +++ b/submodules/LinqToDB.Identity @@ -1 +1 @@ -Subproject commit b7739f5af4c8803364c8397fe2c43ac35c92ad63 +Subproject commit a9ca319f1c0e945deab292c4590abccd70170105 diff --git a/submodules/linq2db b/submodules/linq2db index 807d372..aa46880 160000 --- a/submodules/linq2db +++ b/submodules/linq2db @@ -1 +1 @@ -Subproject commit 807d37242d2ce78beb554d6a59ae8f73f0aa8c49 +Subproject commit aa4688005436d0954afc791335a59094a3221f41 diff --git a/submodules/linq2db.EntityFrameworkCore b/submodules/linq2db.EntityFrameworkCore deleted file mode 160000 index b50d696..0000000 --- a/submodules/linq2db.EntityFrameworkCore +++ /dev/null @@ -1 +0,0 @@ -Subproject commit b50d6968be55d537c1bc5f81df2ebd4d34a345ad From 2f409bafaa34d2d16bd34596354007ed6096a4cd Mon Sep 17 00:00:00 2001 From: MaceWindu Date: Wed, 22 Jan 2025 13:16:16 +0100 Subject: [PATCH 3/5] bump year --- source/docfx.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/docfx.json b/source/docfx.json index 7d7bfd9..18289bc 100644 --- a/source/docfx.json +++ b/source/docfx.json @@ -144,7 +144,7 @@ //https://github.com/dotnet/docfx/blob/main/docs/docs/template.md#modern-template "_appTitle": "Linq To DB", "_appName": "Linq To DB", - "_appFooter": "© 2011-2024 Linq To DB Team
Generated by DocFX", + "_appFooter": "© 2011-2025 Linq To DB Team
Generated by DocFX", "_appLogoPath": "images/icon.png", "_appFaviconPath": "images/icon.ico", "_enableSearch": true, From 230310ff1e59cf429c03d824936c7223c4054ff2 Mon Sep 17 00:00:00 2001 From: MaceWindu Date: Thu, 23 Jan 2025 11:58:27 +0100 Subject: [PATCH 4/5] more fixes --- .editorconfig | 2 + Directory.Build.props | 11 + build.ps1 | 11 +- global.json | 7 + source/docfx.json | 331 ++++++++++++------------ source/filterConfig.yml | 1 - source/templates/custom/public/main.css | 1 + source/templates/custom/public/main.js | 5 - source/toc.yml | 4 + 9 files changed, 198 insertions(+), 175 deletions(-) create mode 100644 Directory.Build.props create mode 100644 global.json delete mode 100644 source/filterConfig.yml create mode 100644 source/templates/custom/public/main.css diff --git a/.editorconfig b/.editorconfig index 11b3bb6..3c12de7 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,5 +1,7 @@ root = true [*] +indent_style = tab +indent_size = 4 insert_final_newline = true end_of_line = crlf diff --git a/Directory.Build.props b/Directory.Build.props new file mode 100644 index 0000000..261c297 --- /dev/null +++ b/Directory.Build.props @@ -0,0 +1,11 @@ + + + $(MSBuildThisFileDirectory)submodules\linq2db\.build + $(Configuration)\$(TargetFramework) + + + + + + + diff --git a/build.ps1 b/build.ps1 index 7f0c4fd..1bdd324 100644 --- a/build.ps1 +++ b/build.ps1 @@ -13,16 +13,13 @@ Write-Host Prepare tooling... dotnet tool install docfx -g Write-Host Restore... -dotnet restore 'submodules/linq2db/Source/LinqToDB/LinqToDB.csproj' -dotnet restore 'submodules/linq2db/Source/LinqToDB.AspNet/LinqToDB.AspNet.csproj' -dotnet restore 'submodules/linq2db/Source/LinqToDB.Remote.Grpc/LinqToDB.Remote.Grpc.csproj' -dotnet restore 'submodules/linq2db/Source/LinqToDB.Remote.Wcf/LinqToDB.Remote.Wcf.csproj' -dotnet restore 'submodules/linq2db/Source/LinqToDB.Tools/LinqToDB.Tools.csproj' -dotnet restore 'submodules/linq2db.EntityFrameworkCore/Source/LinqToDB.EntityFrameworkCore/linq2db.EntityFrameworkCore.csproj' -dotnet restore 'submodules/LinqToDB.Identity/src/LinqToDB.Identity/LinqToDB.Identity.csproj' +# workaround for https://github.com/dotnet/docfx/pull/8375 +# also works as workaround for https://github.com/dotnet/docfx/issues/9775 +dotnet build -c Release 'submodules/linq2db/Source/LinqToDB.FSharp/LinqToDB.FSharp.fsproj' Write-Host Build DocFX documentation... docfx source/docfx.json + if ($LASTEXITCODE -ne 0) { throw "DocFx build failed"; diff --git a/global.json b/global.json new file mode 100644 index 0000000..2c72eef --- /dev/null +++ b/global.json @@ -0,0 +1,7 @@ +{ + "sdk": { + "version": "9.0.0", + "rollForward": "minor", + "allowPrerelease": false + } +} diff --git a/source/docfx.json b/source/docfx.json index 18289bc..15e0956 100644 --- a/source/docfx.json +++ b/source/docfx.json @@ -1,164 +1,171 @@ { - //https://github.com/dotnet/docfx/tree/main/docs/docs - "metadata": [ - // specify path to non-test c# projects - // XML documentation comments from those projects will be used - // for API documentation generation - { - "src": [ - { - "files": [ - "linq2db/Source/LinqToDB/LinqToDB.csproj" - ], - "src": "../submodules" - } - ], - "dest": "api/linq2db", - "globalNamespaceId": "linq2db", - "filter": "filterConfig.yml" - }, - { - "src": [ - { - "files": [ - "linq2db/Source/LinqToDB.Extensions/LinqToDB.Extensions.csproj" - ], - "src": "../submodules" - } - ], - "dest": "api/linq2db.extensions", - "globalNamespaceId": "linq2db.extensions", - "filter": "filterConfig.yml" - }, - { - "src": [ - { - "files": [ - "linq2db/Source/LinqToDB.Remote.Grpc/LinqToDB.Remote.Grpc.csproj" - ], - "src": "../submodules" - } - ], - "dest": "api/linq2db.remote.grpc", - "globalNamespaceId": "linq2db.grpc", - "filter": "filterConfig.yml" - }, - { - "src": [ - { - "files": [ - "linq2db/Source/LinqToDB.Remote.Wcf/LinqToDB.Remote.Wcf.csproj" - ], - "src": "../submodules" - } - ], - "dest": "api/linq2db.remote.wcf", - "globalNamespaceId": "linq2db.wcf", - "filter": "filterConfig.yml" - }, - { - "src": [ - { - "files": [ - "linq2db/Source/LinqToDB.Tools/LinqToDB.Tools.csproj" - ], - "src": "../submodules" - } - ], - "dest": "api/linq2db.tools", - "globalNamespaceId": "linq2db.tools", - "filter": "filterConfig.yml" - }, - { - "src": [ - { - "files": [ - "linq2db/Source/LinqToDB.Scaffold/LinqToDB.Scaffold.csproj" - ], - "src": "../submodules" - } - ], - "dest": "api/linq2db.scaffold", - "globalNamespaceId": "linq2db.scaffold", - "filter": "filterConfig.yml" - }, - { - "src": [ - { - "files": [ - "linq2db/Source/LinqToDB.EntityFrameworkCore/LinqToDB.EntityFrameworkCore.csproj" - ], - "src": "../submodules" - } - ], - "dest": "api/linq2db.efcore", - "globalNamespaceId": "linq2db.efcore", - "filter": "filterConfig.yml" - }, - { - "src": [ - { - "files": [ - "LinqToDB.Identity/src/LinqToDB.Identity/LinqToDB.Identity.csproj" - ], - "src": "../submodules" - } - ], - "dest": "api/linq2db.identity", - "globalNamespaceId": "linq2db.identity", - "filter": "filterConfig.yml" - } - ], - "build": { - "content": [ - { - "files": [ - "api/linq2db/*.yml", - "api/linq2db.tools/*.yml", - "api/linq2db.scaffold/*.yml", - "api/linq2db.extensions/*.yml", - "api/linq2db.efcore/*.yml", - "api/linq2db.identity/*.yml", - "api/linq2db.remote.grpc/*.yml", - "api/linq2db.remote.wcf/*.yml", - "articles/**/*.md", - "articles/**/toc.yml", - "toc.yml", - "*.md" - ] - } - ], - "resource": [ - { - "files": [ - "images/**", - "**.png", - "**.jpg", - "articles/cli-help.txt" - ] - } - ], - "dest": "../_site", - "globalMetadataFiles": [], - "globalMetadata": { - //https://github.com/dotnet/docfx/blob/main/docs/docs/template.md#modern-template - "_appTitle": "Linq To DB", - "_appName": "Linq To DB", - "_appFooter": "© 2011-2025 Linq To DB Team
Generated by DocFX", - "_appLogoPath": "images/icon.png", - "_appFaviconPath": "images/icon.ico", - "_enableSearch": true, - "_disableNewTab": false, - "_disableContribution": true - }, - "fileMetadataFiles": [], - "template": [ - "default", - "modern", - "templates/custom" - ], - "postProcessors": [ "ExtractSearchIndex" ], - "noLangKeyword": false, - "keepFileLink": false - } + //https://github.com/dotnet/docfx/tree/main/docs/docs + "metadata": [ + // specify path to non-test c# projects + // XML documentation comments from those projects will be used + // for API documentation generation + { + "src": [ + { + "files": [ + "linq2db/Source/LinqToDB/LinqToDB.csproj" + ], + "src": "../submodules" + } + ], + "output": "api/linq2db", + "globalNamespaceId": "linq2db" + }, + { + "src": [ + { + "files": [ + "linq2db/Source/LinqToDB.Extensions/LinqToDB.Extensions.csproj" + ], + "src": "../submodules" + } + ], + "output": "api/linq2db.extensions", + "globalNamespaceId": "linq2db.extensions" + }, + { + "src": [ + { + "files": [ + // crashes with assert + //"linq2db/.build/bin/LinqToDB.FSharp/Release/**/linq2db.FSharp.dll", + "linq2db/.build/bin/LinqToDB.FSharp/Release/net9.0/linq2db.FSharp.dll" + ], + "src": "../submodules" + } + ], + "output": "api/linq2db.fsharp", + "globalNamespaceId": "linq2db.fsharp" + }, + { + "src": [ + { + "files": [ + "linq2db/Source/LinqToDB.Remote.Grpc/LinqToDB.Remote.Grpc.csproj" + ], + "src": "../submodules" + } + ], + "output": "api/linq2db.remote.grpc", + "globalNamespaceId": "linq2db.grpc" + }, + { + "src": [ + { + "files": [ + "linq2db/Source/LinqToDB.Remote.Wcf/LinqToDB.Remote.Wcf.csproj" + ], + "src": "../submodules" + } + ], + "output": "api/linq2db.remote.wcf", + "globalNamespaceId": "linq2db.wcf" + }, + { + "src": [ + { + "files": [ + "linq2db/Source/LinqToDB.Tools/LinqToDB.Tools.csproj" + ], + "src": "../submodules" + } + ], + "output": "api/linq2db.tools", + "globalNamespaceId": "linq2db.tools" + }, + { + "src": [ + { + "files": [ + "linq2db/Source/LinqToDB.Scaffold/LinqToDB.Scaffold.csproj" + ], + "src": "../submodules" + } + ], + "output": "api/linq2db.scaffold", + "globalNamespaceId": "linq2db.scaffold" + }, + { + "src": [ + { + "files": [ + "linq2db/Source/LinqToDB.EntityFrameworkCore/LinqToDB.EntityFrameworkCore.csproj" + ], + "src": "../submodules" + } + ], + "output": "api/linq2db.efcore", + "globalNamespaceId": "linq2db.efcore" + }, + { + "src": [ + { + "files": [ + "LinqToDB.Identity/src/LinqToDB.Identity/LinqToDB.Identity.csproj" + ], + "src": "../submodules" + } + ], + "output": "api/linq2db.identity", + "globalNamespaceId": "linq2db.identity" + } + ], + "build": { + "content": [ + { + "files": [ + "api/linq2db/*.yml", + "api/linq2db.tools/*.yml", + "api/linq2db.scaffold/*.yml", + "api/linq2db.extensions/*.yml", + "api/linq2db.efcore/*.yml", + "api/linq2db.fsharp/*.yml", + "api/linq2db.identity/*.yml", + "api/linq2db.remote.grpc/*.yml", + "api/linq2db.remote.wcf/*.yml", + "articles/**/*.md", + "articles/**/toc.yml", + "toc.yml", + "*.md" + ] + } + ], + "resource": [ + { + "files": [ + "images/**", + "**.png", + "**.jpg", + "articles/cli-help.txt" + ] + } + ], + "dest": "../_site", + "globalMetadataFiles": [], + "globalMetadata": { + //https://github.com/dotnet/docfx/blob/main/docs/docs/template.md#modern-template + "_appTitle": "Linq To DB", + "_appName": "Linq To DB", + "_appFooter": "© 2011-2025 Linq To DB Team
Generated by DocFX", + "_appLogoPath": "images/icon.png", + "_appFaviconPath": "images/icon.ico", + "_enableSearch": true, + "_disableNewTab": false, + "_disableContribution": true + }, + "fileMetadataFiles": [], + "template": [ + "default", + "modern", + "templates/custom" + ], + "postProcessors": [ "ExtractSearchIndex" ], + "noLangKeyword": false, + "keepFileLink": false + } } diff --git a/source/filterConfig.yml b/source/filterConfig.yml deleted file mode 100644 index 469d9f6..0000000 --- a/source/filterConfig.yml +++ /dev/null @@ -1 +0,0 @@ -apiRules: diff --git a/source/templates/custom/public/main.css b/source/templates/custom/public/main.css new file mode 100644 index 0000000..1b1f898 --- /dev/null +++ b/source/templates/custom/public/main.css @@ -0,0 +1 @@ +.dropdown-menu { white-space:nowrap } \ No newline at end of file diff --git a/source/templates/custom/public/main.js b/source/templates/custom/public/main.js index ec0db46..6c46587 100644 --- a/source/templates/custom/public/main.js +++ b/source/templates/custom/public/main.js @@ -4,11 +4,6 @@ export default { icon: 'github', href: 'https://github.com/linq2db/linq2db', title: 'Linq To DB' - }, - { - icon: 'twitter', - href: 'https://twitter.com/linq2db', - title: 'Releases Twitter Feed' } ] } diff --git a/source/toc.yml b/source/toc.yml index 4a22a3e..5777e27 100644 --- a/source/toc.yml +++ b/source/toc.yml @@ -7,12 +7,16 @@ href: api/linq2db/ - name: Linq To DB Extensions href: api/linq2db.extensions/ + - name: Linq To DB F# Extensions + href: api/linq2db.fsharp/ - name: Linq To DB over GRPC href: api/linq2db.remote.grpc/ - name: Linq To DB over WCF href: api/linq2db.remote.wcf/ - name: Linq To DB Tools href: api/linq2db.tools/ + - name: Linq To DB Scaffold Framework + href: api/linq2db.scaffold/ - name: Linq To DB for Entity Framework Core href: api/linq2db.efcore/ - name: Linq To DB ASP.NET Identity Provider From cc0c98895e43c9c8457efb4e678327417941bc0e Mon Sep 17 00:00:00 2001 From: MaceWindu Date: Sat, 8 Mar 2025 17:19:48 +0100 Subject: [PATCH 5/5] submodules --- submodules/linq2db | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/submodules/linq2db b/submodules/linq2db index aa46880..7121428 160000 --- a/submodules/linq2db +++ b/submodules/linq2db @@ -1 +1 @@ -Subproject commit aa4688005436d0954afc791335a59094a3221f41 +Subproject commit 712142809820266db488b9082b86fedb8d5eae6f