Skip to content

Commit

Permalink
updating to rc1
Browse files Browse the repository at this point in the history
  • Loading branch information
damienbod committed Nov 18, 2015
1 parent 296a716 commit 1c7c2f1
Show file tree
Hide file tree
Showing 8 changed files with 2,040 additions and 2,203 deletions.
8 changes: 4 additions & 4 deletions global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"projects": [ "src", "test" ],
"sdk": {
"version": "1.0.0-beta8"
}
"projects": [ "src", "test" ],
"sdk": {
"version": "1.0.0-rc1-final"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
using Microsoft.Net.Http.Headers;
using ProtoBuf.Meta;


namespace AspNetMvc6Protobuf.Formatters
{
public class ProtobufInputFormatter : InputFormatter
Expand Down
23 changes: 7 additions & 16 deletions src/AspNetMvc6Protobuf/Formatters/ProtobufOutputFormatter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,28 +26,19 @@ public ProtobufOutputFormatter()
SupportedEncodings.Add(Encoding.GetEncoding("utf-8"));
}

public override bool CanWriteResult(OutputFormatterContext context, MediaTypeHeaderValue contentType)
{
return true;
}

public override async Task WriteResponseBodyAsync(OutputFormatterContext context)
{
var response = context.HttpContext.Response;
var selectedEncoding = context.SelectedEncoding;

Model.Serialize(response.Body, context.Object);
return;

// await response.Body.WriteAsync(valueAsString, context.SelectedEncoding);
}

private static RuntimeTypeModel CreateTypeModel()
{
var typeModel = TypeModel.Create();
typeModel.UseImplicitZeroDefaults = false;
return typeModel;
}

public override Task WriteResponseBodyAsync(OutputFormatterWriteContext context)
{
var response = context.HttpContext.Response;

Model.Serialize(response.Body, context.Object);
return Task.FromResult(response);
}
}
}
203 changes: 0 additions & 203 deletions src/AspNetMvc6Protobuf/Project_Readme.html

This file was deleted.

20 changes: 17 additions & 3 deletions src/AspNetMvc6Protobuf/Properties/launchSettings.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,26 @@
{
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:8389/",
"sslPort": 0
}
},
"profiles": {
"IIS Express": {
"commandName" : "IISExpress",
"commandName": "IISExpress",
"launchBrowser": true,
"launchUrl": "api/values",
"environmentVariables" : {
"environmentVariables": {
"ASPNET_ENV": "Development"
}
},
"web": {
"commandName": "web",
"environmentVariables": {
"Hosting:Environment": "Development"
}
}
}
}
}
13 changes: 8 additions & 5 deletions src/AspNetMvc6Protobuf/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using AspNetMvc6Protobuf.Formatters;
using Microsoft.AspNet.Builder;
using Microsoft.AspNet.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;

using AspNetMvc6Protobuf.Formatters;
using Microsoft.AspNet.Http;
using Microsoft.AspNet.Mvc;
using Microsoft.AspNet.Routing;
using Microsoft.Framework.DependencyInjection;
using Microsoft.Framework.Logging;
using Microsoft.Net.Http.Headers;

namespace AspNetMvc6Protobuf
Expand Down Expand Up @@ -39,8 +41,6 @@ public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerF

app.UseIISPlatformHandler();

app.UseExceptionHandler("/Home/Error");

app.UseStaticFiles();
app.UseMvc(routes =>
{
Expand All @@ -49,5 +49,8 @@ public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerF
template: "{controller=Home}/{action=Index}/{id?}");
});
}

// Entry point for the application.
public static void Main(string[] args) => WebApplication.Run<Startup>(args);
}
}
20 changes: 11 additions & 9 deletions src/AspNetMvc6Protobuf/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,17 @@
"version": "1.0.0-*",

"dependencies": {
"Microsoft.AspNet.Diagnostics": "1.0.0-beta8",
"Microsoft.AspNet.IISPlatformHandler": "1.0.0-beta8",
"Microsoft.AspNet.Mvc": "6.0.0-beta8",
"Microsoft.AspNet.Mvc.TagHelpers": "6.0.0-beta8",
"Microsoft.AspNet.Server.Kestrel": "1.0.0-beta8",
"Microsoft.AspNet.StaticFiles": "1.0.0-beta8",
"Microsoft.Framework.Logging": "1.0.0-beta8",
"Microsoft.Framework.Logging.Console": "1.0.0-beta8",
"Microsoft.Framework.Logging.Debug": "1.0.0-beta8",

"Microsoft.AspNet.IISPlatformHandler": "1.0.0-rc1-final",
"Microsoft.AspNet.Mvc": "6.0.0-rc1-final",
"Microsoft.AspNet.Server.Kestrel": "1.0.0-rc1-final",
"Microsoft.AspNet.StaticFiles": "1.0.0-rc1-final",
"Microsoft.Extensions.Configuration.FileProviderExtensions" : "1.0.0-rc1-final",
"Microsoft.Extensions.Configuration.Json": "1.0.0-rc1-final",
"Microsoft.Extensions.Logging": "1.0.0-rc1-final",
"Microsoft.Extensions.Logging.Console": "1.0.0-rc1-final",
"Microsoft.Extensions.Logging.Debug": "1.0.0-rc1-final",

"protobuf-net": "2.0.0.668"
},

Expand Down
Loading

0 comments on commit 1c7c2f1

Please sign in to comment.