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

Commit 43c3913

Browse files
committed
#265 Remove setters for IApplcationBuilder.Properties and Server.
1 parent f5267fc commit 43c3913

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

src/Microsoft.AspNet.Http.Core/IApplicationBuilder.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ public interface IApplicationBuilder
1010
{
1111
IServiceProvider ApplicationServices { get; set; }
1212

13-
object Server { get; set; }
13+
object Server { get; }
1414

15-
IDictionary<string, object> Properties { get; set; }
15+
IDictionary<string, object> Properties { get; }
1616

1717
IApplicationBuilder Use(Func<RequestDelegate, RequestDelegate> middleware);
1818

src/Microsoft.AspNet.Http/ApplicationBuilder.cs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@ public ApplicationBuilder(IServiceProvider serviceProvider)
1919
ApplicationServices = serviceProvider;
2020
}
2121

22+
public ApplicationBuilder(IServiceProvider serviceProvider, object server)
23+
: this(serviceProvider)
24+
{
25+
SetProperty(Constants.BuilderProperties.ServerInformation, server);
26+
}
27+
2228
private ApplicationBuilder(ApplicationBuilder builder)
2329
{
2430
Properties = builder.Properties;
@@ -42,13 +48,9 @@ public object Server
4248
{
4349
return GetProperty<object>(Constants.BuilderProperties.ServerInformation);
4450
}
45-
set
46-
{
47-
SetProperty<object>(Constants.BuilderProperties.ServerInformation, value);
48-
}
4951
}
5052

51-
public IDictionary<string, object> Properties { get; set; }
53+
public IDictionary<string, object> Properties { get; }
5254

5355
private T GetProperty<T>(string key)
5456
{

0 commit comments

Comments
 (0)