diff --git a/eng/Versions.props b/eng/Versions.props index aa6f4730143..d3be03759f5 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -30,6 +30,7 @@ 3.0.0 3.0.0 1.1.118 + 1.0.0-beta.59 0.12.0 2.0.0-preview3.20122.2 4.7.0 diff --git a/rulesets/Documentation.ruleset b/rulesets/Documentation.ruleset new file mode 100644 index 00000000000..6b054df0cb3 --- /dev/null +++ b/rulesets/Documentation.ruleset @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/rulesets/EFCore.ruleset b/rulesets/EFCore.ruleset index bc907b9cb2a..890557c136b 100644 --- a/rulesets/EFCore.ruleset +++ b/rulesets/EFCore.ruleset @@ -2,4 +2,5 @@ + diff --git a/src/Directory.Build.props b/src/Directory.Build.props index 4eabc53d2a1..966d548d18a 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -9,6 +9,7 @@ + diff --git a/src/EFCore.Relational/Extensions/RelationalDatabaseFacadeExtensions.cs b/src/EFCore.Relational/Extensions/RelationalDatabaseFacadeExtensions.cs index a586c83e806..36760b4975e 100644 --- a/src/EFCore.Relational/Extensions/RelationalDatabaseFacadeExtensions.cs +++ b/src/EFCore.Relational/Extensions/RelationalDatabaseFacadeExtensions.cs @@ -127,9 +127,7 @@ public static Task MigrateAsync( /// attack. You can include parameter place holders in the SQL query string and then supply parameter values as additional /// arguments. Any parameter values you supply will automatically be converted to a DbParameter: /// - /// - /// context.Database.ExecuteSqlRaw("SELECT * FROM [dbo].[SearchBlogs]({0})", userSuppliedSearchTerm) - /// + /// context.Database.ExecuteSqlRaw("SELECT * FROM [dbo].[SearchBlogs]({0})", userSuppliedSearchTerm) /// /// However, never pass a concatenated or interpolated string ($"") with non-validated user-provided values /// into this method. Doing so may expose your application to SQL injection attacks. To use the interpolated string syntax, @@ -165,9 +163,7 @@ public static int ExecuteSqlRaw( /// attack. You can include parameter place holders in the SQL query string and then supply parameter values as additional /// arguments. Any parameter values you supply will automatically be converted to a DbParameter: /// - /// - /// context.Database.ExecuteSqlInterpolated($"SELECT * FROM [dbo].[SearchBlogs]({userSuppliedSearchTerm})") - /// + /// context.Database.ExecuteSqlInterpolated($"SELECT * FROM [dbo].[SearchBlogs]({userSuppliedSearchTerm})") /// /// The for the context. /// The interpolated string representing a SQL query with parameters. @@ -196,9 +192,7 @@ public static int ExecuteSqlInterpolated( /// attack. You can include parameter place holders in the SQL query string and then supply parameter values as additional /// arguments. Any parameter values you supply will automatically be converted to a DbParameter: /// - /// - /// context.Database.ExecuteSqlRawAsync("SELECT * FROM [dbo].[SearchBlogs]({0})", userSuppliedSearchTerm) - /// + /// context.Database.ExecuteSqlRawAsync("SELECT * FROM [dbo].[SearchBlogs]({0})", userSuppliedSearchTerm) /// /// However, never pass a concatenated or interpolated string ($"") with non-validated user-provided values /// into this method. Doing so may expose your application to SQL injection attacks. To use the interpolated string syntax, @@ -258,9 +252,7 @@ public static int ExecuteSqlRaw( /// attack. You can include parameter place holders in the SQL query string and then supply parameter values as additional /// arguments. Any parameter values you supply will automatically be converted to a DbParameter: /// - /// - /// context.Database.ExecuteSqlInterpolatedAsync($"SELECT * FROM [dbo].[SearchBlogs]({userSuppliedSearchTerm})") - /// + /// context.Database.ExecuteSqlInterpolatedAsync($"SELECT * FROM [dbo].[SearchBlogs]({userSuppliedSearchTerm})") /// /// The for the context. /// The interpolated string representing a SQL query with parameters. @@ -324,9 +316,7 @@ public static Task ExecuteSqlRawAsync( /// attack. You can include parameter place holders in the SQL query string and then supply parameter values as additional /// arguments. Any parameter values you supply will automatically be converted to a DbParameter: /// - /// - /// context.Database.ExecuteSqlRawAsync("SELECT * FROM [dbo].[SearchBlogs]({0})", userSuppliedSearchTerm) - /// + /// context.Database.ExecuteSqlRawAsync("SELECT * FROM [dbo].[SearchBlogs]({0})", userSuppliedSearchTerm) /// /// However, never pass a concatenated or interpolated string ($"") with non-validated user-provided values /// into this method. Doing so may expose your application to SQL injection attacks. To use the interpolated string syntax, @@ -364,9 +354,7 @@ public static Task ExecuteSqlRawAsync( /// attack. You can include parameter place holders in the SQL query string and then supply parameter values as additional /// arguments. Any parameter values you supply will automatically be converted to a DbParameter: /// - /// - /// context.Database.ExecuteSqlRawAsync("SELECT * FROM [dbo].[SearchBlogs]({0})", userSuppliedSearchTerm) - /// + /// context.Database.ExecuteSqlRawAsync("SELECT * FROM [dbo].[SearchBlogs]({0})", userSuppliedSearchTerm) /// /// However, never pass a concatenated or interpolated string ($"") with non-validated user-provided values /// into this method. Doing so may expose your application to SQL injection attacks. To use the interpolated string syntax, diff --git a/src/EFCore.Relational/Extensions/RelationalQueryableExtensions.cs b/src/EFCore.Relational/Extensions/RelationalQueryableExtensions.cs index a9abc8536a7..1d210b48edd 100644 --- a/src/EFCore.Relational/Extensions/RelationalQueryableExtensions.cs +++ b/src/EFCore.Relational/Extensions/RelationalQueryableExtensions.cs @@ -66,9 +66,7 @@ public static DbCommand CreateDbCommand([NotNull] this IQueryable source) /// attack. You can include parameter place holders in the SQL query string and then supply parameter values as additional /// arguments. Any parameter values you supply will automatically be converted to a DbParameter: /// - /// - /// context.Blogs.FromSqlRaw("SELECT * FROM [dbo].[SearchBlogs]({0})", userSuppliedSearchTerm) - /// + /// context.Blogs.FromSqlRaw("SELECT * FROM [dbo].[SearchBlogs]({0})", userSuppliedSearchTerm) /// /// However, never pass a concatenated or interpolated string ($"") with non-validated user-provided values /// into this method. Doing so may expose your application to SQL injection attacks. To use the interpolated string syntax, @@ -78,9 +76,7 @@ public static DbCommand CreateDbCommand([NotNull] this IQueryable source) /// This overload also accepts DbParameter instances as parameter values. This allows you to use named /// parameters in the SQL query string: /// - /// - /// context.Blogs.FromSqlRaw("SELECT * FROM [dbo].[SearchBlogs]({@searchTerm})", new SqlParameter("@searchTerm", userSuppliedSearchTerm)) - /// + /// context.Blogs.FromSqlRaw("SELECT * FROM [dbo].[SearchBlogs]({@searchTerm})", new SqlParameter("@searchTerm", userSuppliedSearchTerm)) /// /// The type of the elements of . /// @@ -114,16 +110,15 @@ public static IQueryable FromSqlRaw( /// /// /// If the database provider supports composing on the supplied SQL, you can compose on top of the raw SQL query using - /// LINQ operators - context.Blogs.FromSqlInterpolated($"SELECT * FROM dbo.Blogs").OrderBy(b => b.Name). + /// LINQ operators: /// + /// context.Blogs.FromSqlInterpolated($"SELECT * FROM dbo.Blogs").OrderBy(b => b.Name) /// /// As with any API that accepts SQL it is important to parameterize any user input to protect against a SQL injection /// attack. You can include interpolated parameter place holders in the SQL query string. Any interpolated parameter values /// you supply will automatically be converted to a DbParameter: /// - /// - /// context.Blogs.FromSqlInterpolated($"SELECT * FROM [dbo].[SearchBlogs]({userSuppliedSearchTerm})") - /// + /// context.Blogs.FromSqlInterpolated($"SELECT * FROM [dbo].[SearchBlogs]({userSuppliedSearchTerm})") /// /// The type of the elements of . /// diff --git a/src/EFCore/Diagnostics/InterceptionResult`.cs b/src/EFCore/Diagnostics/InterceptionResult`.cs index 2948d1d81d6..75e894a07e9 100644 --- a/src/EFCore/Diagnostics/InterceptionResult`.cs +++ b/src/EFCore/Diagnostics/InterceptionResult`.cs @@ -47,8 +47,8 @@ private InterceptionResult(TResult result) /// The property can only be accessed if is true. The concept here /// is the same as and /// - /// when is . /// + /// when is . public TResult Result { get diff --git a/src/EFCore/Diagnostics/WarningsConfiguration.cs b/src/EFCore/Diagnostics/WarningsConfiguration.cs index fbc2809a70f..ff70af7d546 100644 --- a/src/EFCore/Diagnostics/WarningsConfiguration.cs +++ b/src/EFCore/Diagnostics/WarningsConfiguration.cs @@ -134,9 +134,10 @@ public virtual WarningsConfiguration WithExplicit( : null; /// - /// Gets the set for the given event ID, or null + /// Gets the set for the given event ID, or /// if no explicit behavior has been set. /// + /// The set for the given event ID. public virtual LogLevel? GetLevel(EventId eventId) => _explicitBehaviors.TryGetValue(eventId.Id, out var warningBehavior) ? warningBehavior.Level diff --git a/src/EFCore/EF.cs b/src/EFCore/EF.cs index 4255941dc54..b7697ebfe16 100644 --- a/src/EFCore/EF.cs +++ b/src/EFCore/EF.cs @@ -25,7 +25,9 @@ internal static readonly MethodInfo PropertyMethod /// property in other scenarios. /// /// - /// The following code performs a filter using the a LastUpdated shadow state property. + /// + /// The following code performs a filter using the a LastUpdated shadow state property. + /// /// /// var blogs = context.Blogs /// .Where(b => EF.Property<DateTime>(b, "LastUpdated") > DateTime.Now.AddDays(-5)); diff --git a/src/EFCore/Extensions/EntityFrameworkQueryableExtensions.cs b/src/EFCore/Extensions/EntityFrameworkQueryableExtensions.cs index 0e43977a763..9a8fe20784f 100644 --- a/src/EFCore/Extensions/EntityFrameworkQueryableExtensions.cs +++ b/src/EFCore/Extensions/EntityFrameworkQueryableExtensions.cs @@ -2385,32 +2385,32 @@ internal static readonly MethodInfo IncludeMethodInfo /// /// /// - /// The following query shows including a single level of related entities. - /// context.Blogs.Include(blog => blog.Posts) + /// The following query shows including a single level of related entities: /// + /// context.Blogs.Include(blog => blog.Posts) /// - /// The following query shows including two levels of entities on the same branch. - /// + /// The following query shows including two levels of entities on the same branch: + /// + /// /// context.Blogs /// .Include(blog => blog.Posts).ThenInclude(post => post.Tags) - /// - /// + /// /// - /// The following query shows including multiple levels and branches of related data. - /// + /// The following query shows including multiple levels and branches of related data: + /// + /// /// context.Blogs /// .Include(blog => blog.Posts).ThenInclude(post => post.Tags).ThenInclude(tag => tag.TagInfo) /// .Include(blog => blog.Contributors) - /// - /// + /// /// - /// The following query shows including a single level of related entities on a derived type using casting. - /// context.Blogs.Include(blog => ((SpecialBlog)blog).SpecialPosts) + /// The following query shows including a single level of related entities on a derived type using casting: /// + /// context.Blogs.Include(blog => ((SpecialBlog)blog).SpecialPosts) /// - /// The following query shows including a single level of related entities on a derived type using 'as' operator. - /// context.Blogs.Include(blog => (blog as SpecialBlog).SpecialPosts) + /// The following query shows including a single level of related entities on a derived type using 'as' operator: /// + /// context.Blogs.Include(blog => (blog as SpecialBlog).SpecialPosts) /// /// The type of entity being queried. /// The type of the related entity to be included. @@ -2466,33 +2466,34 @@ internal static readonly MethodInfo ThenIncludeAfterReferenceMethodInfo /// /// /// - /// The following query shows including a single level of related entities. - /// context.Blogs.Include(blog => blog.Posts) + /// The following query shows including a single level of related entities: /// + /// context.Blogs.Include(blog => blog.Posts) /// - /// The following query shows including two levels of entities on the same branch. - /// + /// The following query shows including two levels of entities on the same branch: + /// + /// /// context.Blogs /// .Include(blog => blog.Posts).ThenInclude(post => post.Tags) - /// - /// + /// /// - /// The following query shows including multiple levels and branches of related data. - /// + /// The following query shows including multiple levels and branches of related data: + /// + /// /// context.Blogs /// .Include(blog => blog.Posts).ThenInclude(post => post.Tags).ThenInclude(tag => tag.TagInfo) /// .Include(blog => blog.Contributors) - /// - /// + /// /// - /// The following query shows including two levels of entities on the same branch, second one being on derived type using casting. - /// context.Blogs.Include(blog => blog.Posts).ThenInclude(post => ((SpecialPost)post).SpecialTags) + /// The following query shows including two levels of entities on the same branch, second one being on derived type using + /// casting: /// + /// context.Blogs.Include(blog => blog.Posts).ThenInclude(post => ((SpecialPost)post).SpecialTags) /// - /// The following query shows including two levels of entities on the same branch, second one being on derived type using 'as' - /// operator. - /// context.Blogs.Include(blog => blog.Posts).ThenInclude(post => (post as SpecialPost).SpecialTags) + /// The following query shows including two levels of entities on the same branch, second one being on derived type using + /// the operator. /// + /// context.Blogs.Include(blog => blog.Posts).ThenInclude(post => (post as SpecialPost).SpecialTags) /// /// The type of entity being queried. /// The type of the entity that was just included. @@ -2523,30 +2524,30 @@ source.Provider is EntityQueryProvider /// /// /// - /// The following query shows including a single level of related entities. - /// context.Blogs.Include(blog => blog.Posts) + /// The following query shows including a single level of related entities: /// + /// context.Blogs.Include(blog => blog.Posts) /// - /// The following query shows including two levels of entities on the same branch. - /// context.Blogs.Include(blog => blog.Posts).ThenInclude(post => post.Tags) + /// The following query shows including two levels of entities on the same branch: /// + /// context.Blogs.Include(blog => blog.Posts).ThenInclude(post => post.Tags) /// - /// The following query shows including multiple levels and branches of related data. - /// + /// The following query shows including multiple levels and branches of related data: + /// + /// /// context.Blogs /// .Include(blog => blog.Posts).ThenInclude(post => post.Tags).ThenInclude(tag => tag.TagInfo) /// .Include(blog => blog.Contributors) - /// - /// + /// /// - /// The following query shows including two levels of entities on the same branch, second one being on derived type. - /// context.Blogs.Include(blog => blog.Posts).ThenInclude(post => ((SpecialPost)post).SpecialTags) + /// The following query shows including two levels of entities on the same branch, second one being on derived type: /// + /// context.Blogs.Include(blog => blog.Posts).ThenInclude(post => ((SpecialPost)post).SpecialTags) /// - /// The following query shows including two levels of entities on the same branch, second one being on derived type using alternative - /// method. - /// context.Blogs.Include(blog => blog.Posts).ThenInclude(post => (post as SpecialPost).SpecialTags) + /// The following query shows including two levels of entities on the same branch, second one being on derived type using + /// alternative method. /// + /// context.Blogs.Include(blog => blog.Posts).ThenInclude(post => (post as SpecialPost).SpecialTags) /// /// The type of entity being queried. /// The type of the entity that was just included. @@ -2607,21 +2608,21 @@ internal static readonly MethodInfo StringIncludeMethodInfo /// /// /// - /// The following query shows including a single level of related entities. - /// context.Blogs.Include("Posts") + /// The following query shows including a single level of related entities: /// + /// context.Blogs.Include("Posts") /// - /// The following query shows including two levels of entities on the same branch. - /// context.Blogs.Include("Posts.Tags") + /// The following query shows including two levels of entities on the same branch: /// + /// context.Blogs.Include("Posts.Tags") /// - /// The following query shows including multiple levels and branches of related data. - /// + /// The following query shows including multiple levels and branches of related data: + /// + /// /// context.Blogs /// .Include("Posts.Tags.TagInfo') /// .Include("Contributors") - /// - /// + /// /// /// The type of entity being queried. /// The source query. diff --git a/src/EFCore/Extensions/EntityFrameworkServiceCollectionExtensions.cs b/src/EFCore/Extensions/EntityFrameworkServiceCollectionExtensions.cs index 53724b67cd7..a294f350778 100644 --- a/src/EFCore/Extensions/EntityFrameworkServiceCollectionExtensions.cs +++ b/src/EFCore/Extensions/EntityFrameworkServiceCollectionExtensions.cs @@ -123,12 +123,12 @@ public static IServiceCollection AddDbContext as a service in the , /// and enables DbContext pooling for this registration. /// + /// /// DbContext pooling can increase performance in high-throughput scenarios by re-using context instances. /// However, for most application this performance gain is very small. /// Note that when using pooling, the context configuration cannot change between uses, and scoped services /// injected into the context will only be resolved once from the initial scope. /// Only consider using DbContext pooling when performance testing indicates it provides a real boost. - /// /// /// /// Use this method when using dependency injection in your application, such as with ASP.NET Core. @@ -168,12 +168,12 @@ public static IServiceCollection AddDbContextPool( /// Registers the given as a service in the , /// and enables DbContext pooling for this registration. /// + /// /// DbContext pooling can increase performance in high-throughput scenarios by re-using context instances. /// However, for most application this performance gain is very small. /// Note that when using pooling, the context configuration cannot change between uses, and scoped services /// injected into the context will only be resolved once from the initial scope. /// Only consider using DbContext pooling when performance testing indicates it provides a real boost. - /// /// /// /// Use this method when using dependency injection in your application, such as with ASP.NET Core. @@ -219,12 +219,12 @@ public static IServiceCollection AddDbContextPool as a service in the , /// and enables DbContext pooling for this registration. /// + /// /// DbContext pooling can increase performance in high-throughput scenarios by re-using context instances. /// However, for most application this performance gain is very small. /// Note that when using pooling, the context configuration cannot change between uses, and scoped services /// injected into the context will only be resolved once from the initial scope. /// Only consider using DbContext pooling when performance testing indicates it provides a real boost. - /// /// /// /// Use this method when using dependency injection in your application, such as with ASP.NET Core. @@ -272,12 +272,12 @@ public static IServiceCollection AddDbContextPool( /// Registers the given as a service in the , /// and enables DbContext pooling for this registration. /// + /// /// DbContext pooling can increase performance in high-throughput scenarios by re-using context instances. /// However, for most application this performance gain is very small. /// Note that when using pooling, the context configuration cannot change between uses, and scoped services /// injected into the context will only be resolved once from the initial scope. /// Only consider using DbContext pooling when performance testing indicates it provides a real boost. - /// /// /// /// Use this method when using dependency injection in your application, such as with ASP.NET Core. diff --git a/src/EFCore/Extensions/EntityTypeExtensions.cs b/src/EFCore/Extensions/EntityTypeExtensions.cs index 1dc3efd3411..856663840bd 100644 --- a/src/EFCore/Extensions/EntityTypeExtensions.cs +++ b/src/EFCore/Extensions/EntityTypeExtensions.cs @@ -411,8 +411,10 @@ public static bool IsOwned([NotNull] this IEntityType entityType) /// /// The entity type. /// Entity type to search for in ownership path. + /// /// if is in ownership path of , /// otherwise . + /// public static bool IsInOwnershipPath([NotNull] this IEntityType entityType, [NotNull] IEntityType targetType) { var owner = entityType; diff --git a/src/EFCore/Metadata/Conventions/KeyDiscoveryConvention.cs b/src/EFCore/Metadata/Conventions/KeyDiscoveryConvention.cs index 1a895d896e5..bab38409089 100644 --- a/src/EFCore/Metadata/Conventions/KeyDiscoveryConvention.cs +++ b/src/EFCore/Metadata/Conventions/KeyDiscoveryConvention.cs @@ -20,9 +20,9 @@ namespace Microsoft.EntityFrameworkCore.Metadata.Conventions /// * Id /// * [entity name]Id /// - /// If the entity type is owned through a reference navigation property then the corresponding foreign key - /// properties are used. /// + /// If the entity type is owned through a reference navigation property then the corresponding foreign key + /// properties are used. /// /// /// If the entity type is owned through a collection navigation property then a composite primary key diff --git a/src/Microsoft.Data.Sqlite.Core/SqliteTransaction.cs b/src/Microsoft.Data.Sqlite.Core/SqliteTransaction.cs index fb919ad4a80..4ff1439fd65 100644 --- a/src/Microsoft.Data.Sqlite.Core/SqliteTransaction.cs +++ b/src/Microsoft.Data.Sqlite.Core/SqliteTransaction.cs @@ -117,7 +117,7 @@ public override void Rollback() /// Releases any resources used by the transaction and rolls it back. /// /// - /// to release managed and unmanaged resources; + /// to release managed and unmanaged resources; /// to release only unmanaged resources. /// protected override void Dispose(bool disposing)