Ooui-tws-port/PlatformSamples/AspNetCoreMvc/Startup.cs

51 lines
1.4 KiB
C#
Raw Normal View History

2017-11-10 02:54:50 +00:00
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
namespace AspNetCoreMvc
{
public class Startup
{
2017-11-10 05:00:15 +00:00
public Startup (IConfiguration configuration)
2017-11-10 02:54:50 +00:00
{
Configuration = configuration;
}
public IConfiguration Configuration { get; }
// This method gets called by the runtime. Use this method to add services to the container.
2017-11-10 05:00:15 +00:00
public void ConfigureServices (IServiceCollection services)
2017-11-10 02:54:50 +00:00
{
2017-11-10 05:00:15 +00:00
services.AddMvc ();
2017-11-10 02:54:50 +00:00
}
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
2017-11-10 05:00:15 +00:00
public void Configure (IApplicationBuilder app, IHostingEnvironment env)
2017-11-10 02:54:50 +00:00
{
2017-11-10 05:00:15 +00:00
if (env.IsDevelopment ()) {
app.UseDeveloperExceptionPage ();
2017-11-10 02:54:50 +00:00
}
2017-11-10 05:00:15 +00:00
else {
app.UseExceptionHandler ("/Home/Error");
2017-11-10 02:54:50 +00:00
}
2017-11-10 05:00:15 +00:00
app.UseStaticFiles ();
2017-11-10 02:54:50 +00:00
2017-11-10 05:00:15 +00:00
app.UseOoui ();
2017-11-10 17:57:45 +00:00
Xamarin.Forms.Forms.Init ();
2017-11-10 05:00:15 +00:00
app.UseMvc (routes => {
routes.MapRoute (
2017-11-10 02:54:50 +00:00
name: "default",
template: "{controller=Home}/{action=Index}/{id?}");
});
}
}
}