The IApplicationContext interface provides a principal. However, this principal might not always be present.
This is tested in most places in the framework code, but to benefit from nullable warning during compilation, the specification of the Principal property interface should be changed to reflect this:
public interface IApplicationContext
{
AppPrincipal? Principal { get; }
/// <summary>
/// Gets or sets the activity ID.
/// </summary>
/// <value>The activity ID.</value>
string ActivityID { get; set; }
void SetPrincipal(AppPrincipal principal);
}
There is at least one use case where SetPrincipal(null) would make sense, but I'm not sure if this would warrant making the parameter nullable as well. To be discussed.
The IApplicationContext interface provides a principal. However, this principal might not always be present.
This is tested in most places in the framework code, but to benefit from nullable warning during compilation, the specification of the
Principal
property interface should be changed to reflect this:There is at least one use case where
SetPrincipal(null)
would make sense, but I'm not sure if this would warrant making the parameter nullable as well. To be discussed.