Add more feature constructors.

This commit is contained in:
Chris Ross 2014-07-17 09:57:27 -07:00
parent dc055f783a
commit 0ba1731928
3 changed files with 19 additions and 1 deletions

View File

@ -1,6 +1,7 @@
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Collections.Generic;
using System.IO;
using System.Text;
using System.Threading;
@ -20,6 +21,11 @@ namespace Microsoft.AspNet.PipelineCore
private Stream _bodyStream;
private IReadableStringCollection _form;
public FormFeature([NotNull] IDictionary<string, string[]> form)
: this (new ReadableStringCollection(form))
{
}
public FormFeature([NotNull] IReadableStringCollection form)
{
_form = form;

View File

@ -1,6 +1,7 @@
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Collections.Generic;
using Microsoft.AspNet.FeatureModel;
using Microsoft.AspNet.Http;
using Microsoft.AspNet.HttpFeature;
@ -16,6 +17,11 @@ namespace Microsoft.AspNet.PipelineCore
private string _queryString;
private IReadableStringCollection _query;
public QueryFeature([NotNull] IDictionary<string, string[]> query)
: this (new ReadableStringCollection(query))
{
}
public QueryFeature([NotNull] IReadableStringCollection query)
{
_query = query;

View File

@ -2,9 +2,10 @@
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using System.Collections.Generic;
using Microsoft.AspNet.FeatureModel;
using Microsoft.AspNet.Http;
using Microsoft.AspNet.Http.Infrastructure;
using Microsoft.AspNet.FeatureModel;
using Microsoft.AspNet.HttpFeature;
using Microsoft.AspNet.PipelineCore.Collections;
using Microsoft.AspNet.PipelineCore.Infrastructure;
@ -19,6 +20,11 @@ namespace Microsoft.AspNet.PipelineCore
private RequestCookiesCollection _cookiesCollection;
private IReadableStringCollection _cookies;
public RequestCookiesFeature([NotNull] IDictionary<string, string[]> cookies)
: this (new ReadableStringCollection(cookies))
{
}
public RequestCookiesFeature([NotNull] IReadableStringCollection cookies)
{
_cookies = cookies;