Add nullability to web.common

This commit is contained in:
Nikolaj Geisle
2022-03-29 13:44:21 +02:00
parent 86ae730b1e
commit b52c4e50cf
151 changed files with 731 additions and 675 deletions

View File

@@ -8,7 +8,7 @@ namespace Umbraco.Extensions
{
public static class CookieManagerExtensions
{
public static string GetPreviewCookieValue(this ICookieManager cookieManager)
public static string? GetPreviewCookieValue(this ICookieManager cookieManager)
{
return cookieManager.GetCookieValue(Constants.Web.PreviewCookieName);
}

View File

@@ -4,7 +4,7 @@ namespace Umbraco.Cms.Core.Web
public interface ICookieManager
{
void ExpireCookie(string cookieName);
string GetCookieValue(string cookieName);
string? GetCookieValue(string cookieName);
void SetCookieValue(string cookieName, string value);
bool HasCookie(string cookieName);
}

View File

@@ -17,6 +17,6 @@ namespace Umbraco.Cms.Core.Web
/// <summary>
/// Returns the current request uri
/// </summary>
Uri GetRequestUrl();
Uri? GetRequestUrl();
}
}

View File

@@ -2,7 +2,7 @@ namespace Umbraco.Cms.Core.Web
{
public interface ISessionManager
{
string GetSessionValue(string sessionName);
string? GetSessionValue(string sessionName);
void SetSessionValue(string sessionName, string value);
}
}

View File

@@ -45,14 +45,14 @@ namespace Umbraco.Cms.Core.Web
/// <summary>
/// Gets the domains cache.
/// </summary>
IDomainCache Domains { get; }
IDomainCache? Domains { get; }
/// <summary>
/// Gets or sets the PublishedRequest object
/// </summary>
//// TODO: Can we refactor this so it's not a settable thing required for routing?
//// The only nicer way would be to have a RouteRequest method directly on IUmbracoContext but that means adding another dep to the ctx/factory.
IPublishedRequest PublishedRequest { get; set; }
IPublishedRequest? PublishedRequest { get; set; }
/// <summary>
/// Gets a value indicating whether the request has debugging enabled