Closed evil-shrike closed 9 years ago
@evil-shrike indeed there are quite a few differences between MVC 5 and 6, especially concerning Web API.
We have some brand new documentation that is in progress and hosted here: http://aspnet.readthedocs.org/en/latest/
In particular, these articles:
Please have a look through those documents and if you feel there is still content missing, please file a bug on https://github.com/aspnet/Docs/issues (though some bugs are already opened, so please take a quick look at those too and add any applicable comments).
Thanks! Sorry I didn't find that resource. I think it'd make sense to put the link in https://github.com/aspnet/Home#documentation-and-further-learning
Done, thanks!
these links are dead
@sulhome sorry about that! Not too long ago we moved the documentation to a new site, but with the same content (though much of it has been updated).
The main migration page moved to Migration, which has sub topics for:
@Eilon thank you
@evil-shrike please check this question on stackoverflow https://stackoverflow.com/questions/33178983/how-to-create-a-response-message-and-add-content-string-to-it-in-asp-net-5-mvc
It is commonly claimed that MVC 6 is "almost the same as MVC 5". I read and heard this in many videos on AspNet5\Mvc6. But the more I dive into it the more different it seems. Similar but different. Converting an Mvc5\WebApi2 app onto AspNet5\Mvc6 is a pain. There're some guidances on the Internet how cool creating Mvc6 apps is. But I found nothing about how to migrate existing code onto Mvc6 (and AspNet5 in general). The things are even worse due to terrible branding - "ASP.NET 5 MVC 6" (considering we have "MVC 5" already). Just google for "Migrating onto ASP.NET 5 MVC 6".
So it's highly desirable to provide some list of breaking changes. It should consist of two parts at least: Api compatibility and UseCases compatibility. Let me clarify. Api compatibility is a list of changes in types, methods and so on. UseCases compatibility is a list of common use-cases in developing apps which are changed. For example:
WebActivator.PreApplicationStartMethod
Startup
classHttpConfiguration
(Filters, Formatters, MessageHandlers, Services)MvcOptions
object in callback passed toIServiceCollection.Configure<MvcOptions>()
HttpConfiguration.Formatters.JsonFormatter.SerializerSettings
JsonInputFormatter
inMvcOptions.InputFormatters
orJsonOutputFormatter
inMvcOptions.OutputFormatters
(there're two formatters now - input and output)HttRequestMessage
HttRequestMessage.Properties
(usually with extension-methods likerequest.SetUserRights()
where SetUserRights just put an object into request.Properties[HttpPropertyKey.UserRights] ).IDependencyResolver
implementations (there were two ones: inSystem.Web.Http
and inSystem.Web.Mvc
) in HttpConfiguration.ServicesIServiceProvider
toIApplicationBuilder.ApplicationServices
inStartup.Configure
)HttpBrowserCapabilitiesBase
instance fromRequest.Browser
HttpRequstMessage
and return type ofHttpResponseMessage
. To create response:Request.CreateResponse
. Easy.HttpRequestMessage
and assign Headers (typed!):return Request.CreateResponse(statusCode, someObj)
new HttpStatusCodeResult((int)statusCode)
but how to pass the payload?and so on..
I personally encountered with the following "surprises" - disappearing of types/methods/properties
@RenderPage
Request.Browser
property)