Skip to content

Commit 334ae01

Browse files
committed
Analyzer changes.
In some cases, this was "change a private method to return the concrete type instead of an interface." This seemed reasonable and not breaking.
1 parent 7f43baa commit 334ae01

File tree

8 files changed

+13
-13
lines changed

8 files changed

+13
-13
lines changed

src/Autofac/Builder/MetadataConfiguration.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ namespace Autofac.Builder;
1616
/// <remarks>This feature was suggested by OJ Reeves (@TheColonial).</remarks>
1717
public class MetadataConfiguration<TMetadata>
1818
{
19-
private readonly IDictionary<string, object?> _properties = new Dictionary<string, object?>();
19+
private readonly Dictionary<string, object?> _properties = new Dictionary<string, object?>();
2020

2121
/// <summary>
2222
/// Gets the set of properties that have been provided.

src/Autofac/ContainerBuilder.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public sealed class ContainerBuilder
3939
private static int _builderAlreadyAllocated;
4040

4141
private readonly bool _clearRegistrationCaches;
42-
private readonly IList<DeferredCallback> _configurationCallbacks = new List<DeferredCallback>();
42+
private readonly List<DeferredCallback> _configurationCallbacks = new List<DeferredCallback>();
4343
private BuildCallbackService? _buildCallbacks;
4444
private bool _wasBuilt;
4545

@@ -150,7 +150,7 @@ public ContainerBuilder RegisterBuildCallback(Action<ILifetimeScope> buildCallba
150150
/// <summary>
151151
/// Create a new container with the component registrations that have been made.
152152
/// </summary>
153-
/// <param name="options">Options that influence the way the container is initialised.</param>
153+
/// <param name="options">Options that influence the way the container is initialized.</param>
154154
/// <remarks>
155155
/// Build can only be called once per <see cref="ContainerBuilder"/>
156156
/// - this prevents ownership issues for provided instances.

src/Autofac/Core/DependencyResolutionException.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ public class DependencyResolutionException : Exception
1717
/// <summary>
1818
/// Initializes a new instance of the <see cref="DependencyResolutionException"/> class.
1919
/// </summary>
20-
/// <param name="info">The serialisation info.</param>
21-
/// <param name="context">The serialisation streaming context.</param>
20+
/// <param name="info">The serialization info.</param>
21+
/// <param name="context">The serialization streaming context.</param>
2222
protected DependencyResolutionException(SerializationInfo info, StreamingContext context)
2323
: base(info, context)
2424
{

src/Autofac/Core/Lifetime/LifetimeScope.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ namespace Autofac.Core.Lifetime;
2424
public class LifetimeScope : Disposable, ISharingLifetimeScope, IServiceProvider
2525
{
2626
/// <summary>
27-
/// Protects shared instances from concurrent access. Other members and the base class are threadsafe.
27+
/// Protects shared instances from concurrent access. Other members and the base class are thread-safe.
2828
/// </summary>
2929
private readonly object _synchRoot = new();
3030
private readonly ConcurrentDictionary<Guid, object> _sharedInstances = new();
@@ -235,7 +235,7 @@ public ILifetimeScope BeginLoadContextLifetimeScope(object tag, AssemblyLoadCont
235235
}
236236
#endif
237237

238-
private ILifetimeScope InternalBeginLifetimeScope(object tag, Action<ContainerBuilder> configurationAction, bool isolatedScope)
238+
private LifetimeScope InternalBeginLifetimeScope(object tag, Action<ContainerBuilder> configurationAction, bool isolatedScope)
239239
{
240240
if (configurationAction == null)
241241
{
@@ -278,7 +278,7 @@ private ILifetimeScope InternalBeginLifetimeScope(object tag, Action<ContainerBu
278278
/// <remarks>It is the responsibility of the caller to make sure that the registry is properly
279279
/// disposed of. This is generally done by adding the registry to the <see cref="Disposer"/>
280280
/// property of the child scope.</remarks>
281-
private IComponentRegistryBuilder CreateScopeRestrictedRegistry(object tag, Action<ContainerBuilder> configurationAction, bool isolatedScope)
281+
private ComponentRegistryBuilder CreateScopeRestrictedRegistry(object tag, Action<ContainerBuilder> configurationAction, bool isolatedScope)
282282
{
283283
var restrictedRootScopeLifetime = new MatchingScopeLifetime(tag);
284284
var tracker = new ScopeRestrictedRegisteredServicesTracker(restrictedRootScopeLifetime);

src/Autofac/Core/Resolving/Pipeline/ResolvePipelineBuilder.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ public IResolvePipeline Build()
233233
return BuildPipeline(_last);
234234
}
235235

236-
private static IResolvePipeline BuildPipeline(MiddlewareDeclaration? lastDecl)
236+
private static ResolvePipeline BuildPipeline(MiddlewareDeclaration? lastDecl)
237237
{
238238
// When we build, we go through the set and construct a single call stack, starting from the end.
239239
var current = lastDecl;

src/Autofac/Features/AttributeFilters/MetadataFilterAttribute.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ private static Type GetElementType(Type type)
190190
.FirstOrDefault();
191191
}
192192

193-
private static IEnumerable<T> FilterAll<T>(IComponentContext context, string metadataKey, object metadataValue)
193+
private static T[] FilterAll<T>(IComponentContext context, string metadataKey, object metadataValue)
194194
{
195195
// Using Lazy<T> to ensure components that aren't actually used won't get activated.
196196
return context.Resolve<IEnumerable<Meta<Lazy<T>>>>()

src/Autofac/Features/LightweightAdapters/LightweightAdapterRegistrationExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ private static Service ServiceWithKey<TService>(object? key)
6363
return new KeyedService(key, typeof(TService));
6464
}
6565

66-
private static IRegistrationBuilder<TTo, LightweightAdapterActivatorData, DynamicRegistrationStyle>
66+
private static RegistrationBuilder<TTo, LightweightAdapterActivatorData, DynamicRegistrationStyle>
6767
RegisterAdapter<TFrom, TTo>(
6868
ContainerBuilder builder,
6969
Func<IComponentContext, IEnumerable<Parameter>, TFrom, TTo> adapter,

src/Autofac/Util/Enforce.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ internal static class Enforce
1414
/// <summary>
1515
/// Enforce that sequence does not contain null. Returns the
1616
/// value if valid so that it can be used inline in
17-
/// base initialiser syntax.
17+
/// base initializer syntax.
1818
/// </summary>
1919
/// <param name="value">The value.</param>
2020
/// <param name="name">The parameter name.</param>
@@ -55,7 +55,7 @@ public static T NotNull<T>([ValidatedNotNull] T value)
5555
/// <summary>
5656
/// Enforce that an argument is not null or empty. Returns the
5757
/// value if valid so that it can be used inline in
58-
/// base initialiser syntax.
58+
/// base initializer syntax.
5959
/// </summary>
6060
/// <param name="value">The value.</param>
6161
/// <param name="description">The description.</param>

0 commit comments

Comments
 (0)