public void Add(string key, object value) { MyValidator.ThrowIfNullOrEmpty(key, nameof(key)); MyValidator.ThrowIfNull(value, nameof(value)); this.values[key] = value; }
public ConnectionHandler(Socket client, IServerRouteConfig serverRouteConfig) { MyValidator.ThrowIfNull(client, nameof(client)); MyValidator.ThrowIfNull(serverRouteConfig, nameof(serverRouteConfig)); this.client = client; this.serverRouteConfig = serverRouteConfig; }
public RoutingContext(RequestHandler handler, IEnumerable <string> parameters) { MyValidator.ThrowIfNull(handler, nameof(handler)); MyValidator.ThrowIfNull(parameters, nameof(parameters)); this.Handler = handler; this.Parameters = parameters; }
public HttpCookie GetCookie(string key) { MyValidator.ThrowIfNull(key, nameof(key)); if (!this.cookies.ContainsKey(key)) { throw new InvalidOperationException($"The given key {key} is not present in the cookies collection."); } return(this.cookies[key]); }
public object Get(string key) { MyValidator.ThrowIfNull(key, nameof(key)); if (!this.values.ContainsKey(key)) { return(null); } return(this.values[key]); }
public HttpContext(IHttpRequest request) { MyValidator.ThrowIfNull(request, nameof(request)); this.request = request; }
public bool ContainsKey(string key) { MyValidator.ThrowIfNull(key, nameof(key)); return(this.cookies.ContainsKey(key)); }
public void Add(HttpCookie cookie) { MyValidator.ThrowIfNull(cookie, nameof(cookie)); this.cookies[cookie.Key] = cookie; }
public HttpHandler(IServerRouteConfig serverRouteConfig) { MyValidator.ThrowIfNull(serverRouteConfig, nameof(serverRouteConfig)); this.serverRouteConfig = serverRouteConfig; }