-
-
Save serefarikan/2d3a4fb915b527c84cb0b0f5a03899b2 to your computer and use it in GitHub Desktop.
Packages and Startup for WebAPI 2.2 on Owin + IIS hosting
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<packages> | |
<package id="Microsoft.AspNet.WebApi.Owin" version="5.2.3" targetFramework="net461" /> | |
<package id="Microsoft.Owin" version="3.0.1" targetFramework="net461" /> | |
<package id="Microsoft.Owin.Host.SystemWeb" version="3.0.1" targetFramework="net461" /> | |
<package id="Owin" version="1.0" targetFramework="net461" /> | |
</packages> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[assembly: OwinStartup(typeof(Startup))] | |
namespace Api | |
{ | |
public class Startup | |
{ | |
public void Configuration(IAppBuilder app) | |
{ | |
var config = new HttpConfiguration(); | |
config.MapHttpAttributeRoutes(); | |
config.Formatters.Remove(config.Formatters.XmlFormatter); | |
config.Formatters.JsonFormatter.SerializerSettings.ContractResolver = new CamelCasePropertyNamesContractResolver(); | |
app.UseWebApi(config); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment