Skip to content
This repository was archived by the owner on Nov 20, 2018. It is now read-only.

Commit 0ba1731

Browse files
committed
Add more feature constructors.
1 parent dc055f7 commit 0ba1731

File tree

3 files changed

+19
-1
lines changed

3 files changed

+19
-1
lines changed

src/Microsoft.AspNet.PipelineCore/FormFeature.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved.
22
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
33

4+
using System.Collections.Generic;
45
using System.IO;
56
using System.Text;
67
using System.Threading;
@@ -20,6 +21,11 @@ public class FormFeature : IFormFeature
2021
private Stream _bodyStream;
2122
private IReadableStringCollection _form;
2223

24+
public FormFeature([NotNull] IDictionary<string, string[]> form)
25+
: this (new ReadableStringCollection(form))
26+
{
27+
}
28+
2329
public FormFeature([NotNull] IReadableStringCollection form)
2430
{
2531
_form = form;

src/Microsoft.AspNet.PipelineCore/QueryFeature.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved.
22
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
33

4+
using System.Collections.Generic;
45
using Microsoft.AspNet.FeatureModel;
56
using Microsoft.AspNet.Http;
67
using Microsoft.AspNet.HttpFeature;
@@ -16,6 +17,11 @@ public class QueryFeature : IQueryFeature
1617
private string _queryString;
1718
private IReadableStringCollection _query;
1819

20+
public QueryFeature([NotNull] IDictionary<string, string[]> query)
21+
: this (new ReadableStringCollection(query))
22+
{
23+
}
24+
1925
public QueryFeature([NotNull] IReadableStringCollection query)
2026
{
2127
_query = query;

src/Microsoft.AspNet.PipelineCore/RequestCookiesFeature.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
33

44
using System;
5+
using System.Collections.Generic;
6+
using Microsoft.AspNet.FeatureModel;
57
using Microsoft.AspNet.Http;
68
using Microsoft.AspNet.Http.Infrastructure;
7-
using Microsoft.AspNet.FeatureModel;
89
using Microsoft.AspNet.HttpFeature;
910
using Microsoft.AspNet.PipelineCore.Collections;
1011
using Microsoft.AspNet.PipelineCore.Infrastructure;
@@ -19,6 +20,11 @@ public class RequestCookiesFeature : IRequestCookiesFeature
1920
private RequestCookiesCollection _cookiesCollection;
2021
private IReadableStringCollection _cookies;
2122

23+
public RequestCookiesFeature([NotNull] IDictionary<string, string[]> cookies)
24+
: this (new ReadableStringCollection(cookies))
25+
{
26+
}
27+
2228
public RequestCookiesFeature([NotNull] IReadableStringCollection cookies)
2329
{
2430
_cookies = cookies;

0 commit comments

Comments
 (0)