Browse Source

Resolve warnings.

pull/6809/head
Halil İbrahim Kalkan 6 years ago
parent
commit
b38084f071
  1. 6
      framework/src/Volo.Abp.Authorization/Microsoft/AspNetCore/Authorization/AuthorizationOptionsExtensions.cs
  2. 16
      framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/Permissions/PermissionDefinition.cs
  3. 10
      framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/Permissions/PermissionGroupDefinition.cs
  4. 4
      framework/src/Volo.Abp.BackgroundJobs.Abstractions/Volo/Abp/BackgroundJobs/IAsyncBackgroundJob.cs
  5. 4
      framework/src/Volo.Abp.BackgroundJobs.Abstractions/Volo/Abp/BackgroundJobs/IBackgroundJob.cs
  6. 3
      framework/src/Volo.Abp.BlobStoring/Volo/Abp/BlobStoring/BlobContainerFactoryExtensions.cs
  7. 2
      framework/src/Volo.Abp.Core/System/AbpStringExtensions.cs
  8. 2
      framework/src/Volo.Abp.Core/System/Collections/Generic/AbpCollectionExtensions.cs
  9. 4
      framework/src/Volo.Abp.Core/Volo/Abp/Reflection/TypeFinder.cs
  10. 6
      framework/src/Volo.Abp.Core/Volo/Abp/Text/Formatting/FormattedStringValueExtracter.cs
  11. 6
      framework/src/Volo.Abp.Data/Volo/Abp/Data/DataSeedContext.cs
  12. 6
      framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/DependencyInjection/IAbpCommonDbContextRegistrationOptionsBuilder.cs
  13. 4
      framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/IEventBus.cs
  14. 4
      framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/IEventDataMayHaveTenantId.cs
  15. 4
      framework/src/Volo.Abp.Features/Volo/Abp/Features/FeatureDefinition.cs
  16. 8
      framework/src/Volo.Abp.Features/Volo/Abp/Features/FeatureGroupDefinition.cs
  17. 4
      framework/src/Volo.Abp.Uow/Volo/Abp/Uow/UnitOfWorkFailedEventArgs.cs
  18. 4
      framework/test/Volo.Abp.AutoMapper.Tests/Volo/Abp/AutoMapper/AbpAutoMapperModule_Basic_Tests.cs
  19. 34
      framework/test/Volo.Abp.Uow.Tests/Volo/Abp/Uow/UnitOfWork_Events_Tests.cs

6
framework/src/Volo.Abp.Authorization/Microsoft/AspNetCore/Authorization/AuthorizationOptionsExtensions.cs

@ -11,9 +11,9 @@ namespace Microsoft.AspNetCore.Authorization
/// <summary>
/// Gets all policies.
///
///
/// IMPORTANT NOTE: Use this method carefully.
/// It relies on reflection to get all policies from a private field of the <see cref="options"/>.
/// It relies on reflection to get all policies from a private field of the <paramref name="options"/>.
/// This method may be removed in the future if internals of <see cref="AuthorizationOptions"/> changes.
/// </summary>
/// <param name="options"></param>
@ -23,4 +23,4 @@ namespace Microsoft.AspNetCore.Authorization
return ((IDictionary<string, AuthorizationPolicy>) PolicyMapProperty.GetValue(options)).Keys.ToList();
}
}
}
}

16
framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/Permissions/PermissionDefinition.cs

@ -54,7 +54,7 @@ namespace Volo.Abp.Authorization.Permissions
///
/// Disabling a permission would be helpful to hide a related application
/// functionality from users/clients.
///
///
/// Default: true.
/// </summary>
public bool IsEnabled { get; set; }
@ -64,8 +64,8 @@ namespace Volo.Abp.Authorization.Permissions
/// </summary>
/// <param name="name">Name of the property</param>
/// <returns>
/// Returns the value in the <see cref="Properties"/> dictionary by given <see cref="name"/>.
/// Returns null if given <see cref="name"/> is not present in the <see cref="Properties"/> dictionary.
/// Returns the value in the <see cref="Properties"/> dictionary by given <paramref name="name"/>.
/// Returns null if given <paramref name="name"/> is not present in the <see cref="Properties"/> dictionary.
/// </returns>
public object this[string name]
{
@ -74,7 +74,7 @@ namespace Volo.Abp.Authorization.Permissions
}
protected internal PermissionDefinition(
[NotNull] string name,
[NotNull] string name,
ILocalizableString displayName = null,
MultiTenancySides multiTenancySide = MultiTenancySides.Both,
bool isEnabled = true)
@ -90,14 +90,14 @@ namespace Volo.Abp.Authorization.Permissions
}
public virtual PermissionDefinition AddChild(
[NotNull] string name,
[NotNull] string name,
ILocalizableString displayName = null,
MultiTenancySides multiTenancySide = MultiTenancySides.Both,
bool isEnabled = true)
{
var child = new PermissionDefinition(
name,
displayName,
name,
displayName,
multiTenancySide,
isEnabled)
{
@ -138,4 +138,4 @@ namespace Volo.Abp.Authorization.Permissions
return $"[{nameof(PermissionDefinition)} {Name}]";
}
}
}
}

10
framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/Permissions/PermissionGroupDefinition.cs

@ -36,8 +36,8 @@ namespace Volo.Abp.Authorization.Permissions
/// </summary>
/// <param name="name">Name of the property</param>
/// <returns>
/// Returns the value in the <see cref="Properties"/> dictionary by given <see cref="name"/>.
/// Returns null if given <see cref="name"/> is not present in the <see cref="Properties"/> dictionary.
/// Returns the value in the <see cref="Properties"/> dictionary by given <paramref name="name"/>.
/// Returns null if given <paramref name="name"/> is not present in the <see cref="Properties"/> dictionary.
/// </returns>
public object this[string name]
{
@ -46,7 +46,7 @@ namespace Volo.Abp.Authorization.Permissions
}
protected internal PermissionGroupDefinition(
string name,
string name,
ILocalizableString displayName = null,
MultiTenancySides multiTenancySide = MultiTenancySides.Both)
{
@ -59,7 +59,7 @@ namespace Volo.Abp.Authorization.Permissions
}
public virtual PermissionDefinition AddPermission(
string name,
string name,
ILocalizableString displayName = null,
MultiTenancySides multiTenancySide = MultiTenancySides.Both,
bool isEnabled = true)
@ -131,4 +131,4 @@ namespace Volo.Abp.Authorization.Permissions
return null;
}
}
}
}

4
framework/src/Volo.Abp.BackgroundJobs.Abstractions/Volo/Abp/BackgroundJobs/IAsyncBackgroundJob.cs

@ -8,9 +8,9 @@ namespace Volo.Abp.BackgroundJobs
public interface IAsyncBackgroundJob<in TArgs>
{
/// <summary>
/// Executes the job with the <see cref="args"/>.
/// Executes the job with the <paramref name="args"/>.
/// </summary>
/// <param name="args">Job arguments.</param>
Task ExecuteAsync(TArgs args);
}
}
}

4
framework/src/Volo.Abp.BackgroundJobs.Abstractions/Volo/Abp/BackgroundJobs/IBackgroundJob.cs

@ -6,9 +6,9 @@
public interface IBackgroundJob<in TArgs>
{
/// <summary>
/// Executes the job with the <see cref="args"/>.
/// Executes the job with the <paramref name="args"/>.
/// </summary>
/// <param name="args">Job arguments.</param>
void Execute(TArgs args);
}
}
}

3
framework/src/Volo.Abp.BlobStoring/Volo/Abp/BlobStoring/BlobContainerFactoryExtensions.cs

@ -6,7 +6,6 @@
/// Gets a named container.
/// </summary>
/// <param name="blobContainerFactory">The blob container manager</param>
/// <param name="cancellationToken">Cancellation token</param>
/// <returns>
/// The container object.
/// </returns>
@ -19,4 +18,4 @@
);
}
}
}
}

2
framework/src/Volo.Abp.Core/System/AbpStringExtensions.cs

@ -88,7 +88,7 @@ namespace System
/// Gets index of nth occurrence of a char in a string.
/// </summary>
/// <param name="str">source string to be searched</param>
/// <param name="c">Char to search in <see cref="str"/></param>
/// <param name="c">Char to search in <paramref name="str"/></param>
/// <param name="n">Count of the occurrence</param>
public static int NthIndexOf(this string str, char c, int n)
{

2
framework/src/Volo.Abp.Core/System/Collections/Generic/AbpCollectionExtensions.cs

@ -107,7 +107,7 @@ namespace System.Collections.Generic
}
/// <summary>
/// Removes all items from the collection those satisfy the given <paramref name="predicate"/>.
/// Removes all items from the collection.
/// </summary>
/// <typeparam name="T">Type of the items in the collection</typeparam>
/// <param name="source">The collection</param>

4
framework/src/Volo.Abp.Core/Volo/Abp/Reflection/TypeFinder.cs

@ -37,7 +37,7 @@ namespace Volo.Abp.Reflection
allTypes.AddRange(typesInThisAssembly.Where(type => type != null));
}
catch (Exception ex)
catch
{
//TODO: Trigger a global event?
}
@ -46,4 +46,4 @@ namespace Volo.Abp.Reflection
return allTypes;
}
}
}
}

6
framework/src/Volo.Abp.Core/Volo/Abp/Text/Formatting/FormattedStringValueExtracter.cs

@ -11,7 +11,7 @@ namespace Volo.Abp.Text.Formatting
/// </summary>
/// <example>
/// Say that str is "My name is Neo." and format is "My name is {name}.".
/// Then Extract method gets "Neo" as "name".
/// Then Extract method gets "Neo" as "name".
/// </example>
public class FormattedStringValueExtracter
{
@ -84,7 +84,7 @@ namespace Volo.Abp.Text.Formatting
}
/// <summary>
/// Checks if given <see cref="str"/> fits to given <see cref="format"/>.
/// Checks if given <paramref name="str"/> fits to given <paramref name="format"/>.
/// Also gets extracted values.
/// </summary>
/// <param name="str">String including dynamic values</param>
@ -127,4 +127,4 @@ namespace Volo.Abp.Text.Formatting
}
}
}
}
}

6
framework/src/Volo.Abp.Data/Volo/Abp/Data/DataSeedContext.cs

@ -13,8 +13,8 @@ namespace Volo.Abp.Data
/// </summary>
/// <param name="name">Name of the property</param>
/// <returns>
/// Returns the value in the <see cref="Properties"/> dictionary by given <see cref="name"/>.
/// Returns null if given <see cref="name"/> is not present in the <see cref="Properties"/> dictionary.
/// Returns the value in the <see cref="Properties"/> dictionary by given <paramref name="name"/>.
/// Returns null if given <paramref name="name"/> is not present in the <see cref="Properties"/> dictionary.
/// </returns>
[CanBeNull]
public object this[string name]
@ -45,4 +45,4 @@ namespace Volo.Abp.Data
return this;
}
}
}
}

6
framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/DependencyInjection/IAbpCommonDbContextRegistrationOptionsBuilder.cs

@ -9,11 +9,11 @@ namespace Volo.Abp.DependencyInjection
IServiceCollection Services { get; }
/// <summary>
/// Registers default repositories for this DbContext.
/// Registers default repositories for this DbContext.
/// </summary>
/// <param name="includeAllEntities">
/// Registers repositories only for aggregate root entities by default.
/// set <see cref="includeAllEntities"/> to true to include all entities.
/// set <paramref name="includeAllEntities"/> to true to include all entities.
/// </param>
IAbpCommonDbContextRegistrationOptionsBuilder AddDefaultRepositories(bool includeAllEntities = false);
@ -67,4 +67,4 @@ namespace Volo.Abp.DependencyInjection
/// <param name="otherDbContextType">The DbContext type to be replaced</param>
IAbpCommonDbContextRegistrationOptionsBuilder ReplaceDbContext(Type otherDbContextType);
}
}
}

4
framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/IEventBus.cs

@ -33,7 +33,7 @@ namespace Volo.Abp.EventBus
/// <summary>
/// Registers to an event.
/// A new instance of <see cref="THandler"/> object is created for every event occurrence.
/// A new instance of <typeparamref name="THandler"/> object is created for every event occurrence.
/// </summary>
/// <typeparam name="TEvent">Event type</typeparam>
/// <typeparam name="THandler">Type of the event handler</typeparam>
@ -116,4 +116,4 @@ namespace Volo.Abp.EventBus
/// <param name="eventType">Event type</param>
void UnsubscribeAll(Type eventType);
}
}
}

4
framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/IEventDataMayHaveTenantId.cs

@ -16,8 +16,8 @@ namespace Volo.Abp.EventBus
{
/// <summary>
/// Returns true if this event data has a Tenant Id information.
/// If so, it should set the <see cref="tenantId"/> our parameter.
/// Otherwise, the <see cref="tenantId"/> our parameter value should not be informative
/// If so, it should set the <paramref name="tenantId"/> our parameter.
/// Otherwise, the <paramref name="tenantId"/> our parameter value should not be informative
/// (it will be null as expected, but doesn't indicate a tenant with null tenant id).
/// </summary>
/// <param name="tenantId">

4
framework/src/Volo.Abp.Features/Volo/Abp/Features/FeatureDefinition.cs

@ -69,8 +69,8 @@ namespace Volo.Abp.Features
/// </summary>
/// <param name="name">Name of the property</param>
/// <returns>
/// Returns the value in the <see cref="Properties"/> dictionary by given <see cref="name"/>.
/// Returns null if given <see cref="name"/> is not present in the <see cref="Properties"/> dictionary.
/// Returns the value in the <see cref="Properties"/> dictionary by given <paramref name="name"/>.
/// Returns null if given <paramref name="name"/> is not present in the <see cref="Properties"/> dictionary.
/// </returns>
[CanBeNull]
public object this[string name]

8
framework/src/Volo.Abp.Features/Volo/Abp/Features/FeatureGroupDefinition.cs

@ -29,8 +29,8 @@ namespace Volo.Abp.Features
/// </summary>
/// <param name="name">Name of the property</param>
/// <returns>
/// Returns the value in the <see cref="Properties"/> dictionary by given <see cref="name"/>.
/// Returns null if given <see cref="name"/> is not present in the <see cref="Properties"/> dictionary.
/// Returns the value in the <see cref="Properties"/> dictionary by given <paramref name="name"/>.
/// Returns null if given <paramref name="name"/> is not present in the <see cref="Properties"/> dictionary.
/// </returns>
public object this[string name]
{
@ -39,7 +39,7 @@ namespace Volo.Abp.Features
}
protected internal FeatureGroupDefinition(
string name,
string name,
ILocalizableString displayName = null)
{
Name = name;
@ -108,4 +108,4 @@ namespace Volo.Abp.Features
return $"[{nameof(FeatureGroupDefinition)} {Name}]";
}
}
}
}

4
framework/src/Volo.Abp.Uow/Volo/Abp/Uow/UnitOfWorkFailedEventArgs.cs

@ -9,8 +9,8 @@ namespace Volo.Abp.Uow
public class UnitOfWorkFailedEventArgs : UnitOfWorkEventArgs
{
/// <summary>
/// Exception that caused failure. This is set only if an error occurred during <see cref="IUnitOfWork.Complete"/>.
/// Can be null if there is no exception, but <see cref="IUnitOfWork.Complete"/> is not called.
/// Exception that caused failure. This is set only if an error occurred during <see cref="IUnitOfWork.CompleteAsync"/>.
/// Can be null if there is no exception, but <see cref="IUnitOfWork.CompleteAsync"/> is not called.
/// Can be null if another exception occurred during the UOW.
/// </summary>
[CanBeNull]

4
framework/test/Volo.Abp.AutoMapper.Tests/Volo/Abp/AutoMapper/AbpAutoMapperModule_Basic_Tests.cs

@ -38,12 +38,12 @@ namespace Volo.Abp.AutoMapper
}
//[Fact] TODO: Disabled because of https://github.com/AutoMapper/AutoMapper/pull/2379#issuecomment-355899664
public void Should_Not_Map_Objects_With_AutoMap_Attributes()
/*public void Should_Not_Map_Objects_With_AutoMap_Attributes()
{
Assert.ThrowsAny<Exception>(() =>
{
_objectMapper.Map<MyEntity, MyNotMappedDto>(new MyEntity {Number = 42});
});
}
}*/
}
}

34
framework/test/Volo.Abp.Uow.Tests/Volo/Abp/Uow/UnitOfWork_Events_Tests.cs

@ -26,7 +26,7 @@ namespace Volo.Abp.Uow
{
uow.OnCompleted(() =>
{
completed = true;
completed = true;
return Task.CompletedTask;
});
@ -50,7 +50,12 @@ namespace Volo.Abp.Uow
{
using (var childUow = _unitOfWorkManager.Begin())
{
childUow.OnCompleted(async () => completed = true);
childUow.OnCompleted(() =>
{
completed = true;
return Task.CompletedTask;
});
uow.Disposed += (sender, args) => disposed = true;
await childUow.CompleteAsync();
@ -80,9 +85,14 @@ namespace Volo.Abp.Uow
using (var uow = _unitOfWorkManager.Begin())
{
uow.OnCompleted(async () => completed = true);
uow.Failed += (sender, args) => failed = true;
uow.Disposed += (sender, args) => disposed = true;
uow.OnCompleted(() =>
{
completed = true;
return Task.CompletedTask;
});
uow.Failed += (_, _) => failed = true;
uow.Disposed += (_, _) => disposed = true;
}
completed.ShouldBeFalse();
@ -101,7 +111,12 @@ namespace Volo.Abp.Uow
{
using (var uow = _unitOfWorkManager.Begin())
{
uow.OnCompleted(async () => completed = true);
uow.OnCompleted(() =>
{
completed = true;
return Task.CompletedTask;
});
uow.Failed += (sender, args) => failed = true;
uow.Disposed += (sender, args) => disposed = true;
@ -125,7 +140,12 @@ namespace Volo.Abp.Uow
using (var uow = _unitOfWorkManager.Begin())
{
uow.OnCompleted(async () => completed = true);
uow.OnCompleted(() =>
{
completed = true;
return Task.CompletedTask;
});
uow.Failed += (sender, args) => { failed = true; args.IsRolledback.ShouldBeTrue(); };
uow.Disposed += (sender, args) => disposed = true;

Loading…
Cancel
Save