Skip to content

Commit df9ee2f

Browse files
committed
Adding DIM as discussion point
1 parent 2a2d15a commit df9ee2f

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/Http/Http.Features/src/IResponseCookies.cs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
// Copyright (c) .NET Foundation. All rights reserved.
22
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
33

4+
#if NET6_0
45
using System;
56
using System.Collections.Generic;
7+
#endif
68

79
namespace Microsoft.AspNetCore.Http
810
{
@@ -26,12 +28,20 @@ public interface IResponseCookies
2628
/// <param name="options"><see cref="CookieOptions"/> included in the new cookie setting.</param>
2729
void Append(string key, string value, CookieOptions options);
2830

31+
#if NET6_0
2932
/// <summary>
3033
/// Add elements of specified dictionary as cookies.
3134
/// </summary>
3235
/// <param name="keyValuePairs">Key value pair collections whose elements will be added as cookies.</param>
3336
/// <param name="options"><see cref="CookieOptions"/> included in new cookie settings.</param>
34-
void Append(ReadOnlySpan<KeyValuePair<string, string>> keyValuePairs, CookieOptions options);
37+
void Append(ReadOnlySpan<KeyValuePair<string, string>> keyValuePairs, CookieOptions options)
38+
{
39+
foreach (var keyValuePair in keyValuePairs)
40+
{
41+
Append(keyValuePair.Key, keyValuePair.Value, options);
42+
}
43+
}
44+
#endif
3545

3646
/// <summary>
3747
/// Sets an expired cookie.

0 commit comments

Comments
 (0)