Hi,
I would like to apply the new syntax of C# in to autofac code base, since this would make it more compact, removing any clutter. For instance, the DeferredCallback constructor could change from this
public DeferredCallback(Action<IComponentRegistry> callback)
{
if (callback == null)
{
throw new ArgumentNullException(nameof(callback));
}
this.Id = Guid.NewGuid();
this.Callback = callback;
get
{
return this._callback;
}
set
{
if (value == null)
{
throw new ArgumentNullException(nameof(value));
}
this._callback = value;
}
}
To the following:
public DeferredCallback(Action<IComponentRegistry> callback)
{
Callback = callback ?? throw new ArgumentNullException(nameof(callback));
Id = Guid.NewGuid();
get => _callback;
set => _callback = value ?? throw new ArgumentNullException(nameof(value));
}
I have noticed also other places of the code base, where could be benefit of the new features of the language.
I would like to ask you if you think that this could benefit the code base and if I could proceed with something like this?
Thanks in advance !