Migrating from ASP.NET MVC 5.x to ASP.NET Core (07.09.2016 by Halil İbrahim Kalkan)

Image for post
Image for post

Introduction

Solution Structure

Image for post
Image for post
Image for post
Image for post
{
"version": "1.0.0.0-*",
"dependencies": {
"Abp": "0.11.2",
"Abp.AutoMapper": "0.11.2",
"Abp.Zero": "0.11.2",
"Abp.Zero.Ldap": "0.11.2",
"Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0",
"Microsoft.Extensions.Configuration.Json": "1.0.0",
"Microsoft.Extensions.Configuration.UserSecrets": "1.0.0"
},
"frameworks": {
"net461": {
}
},
"buildOptions": {
"embed": {
"include": [
"Localization/PhoneBook/*.xml",
"Emailing/EmailTemplates/default.html"
]
}
}
}

ASP.NET MVC

<environment names="Development">
<link rel="stylesheet" href="~/view-resources/Areas/AppAreaName/Views/Users/Index.css" asp-append-version="true" />
</environment>
<environment names="Staging,Production">
<link rel="stylesheet" href="~/view-resources/Areas/AppAreaName/Views/Users/Index.min.css" asp-append-version="true" />
</environment>
public partial class Added_ConnString_To_Tenant_Entity : DbMigration
{
public override void Up()
{
AddColumn("dbo.AbpTenants", "ConnectionString", c => c.String(maxLength: 1024));
}

public override void Down()
{
DropColumn("dbo.AbpTenants", "ConnectionString");
}
}
[GeneratedCode("EntityFramework.Migrations", "6.1.3-40302")]
public sealed partial class Added_ConnString_To_Tenant_Entity : IMigrationMetadata
{
private readonly ResourceManager Resources = new ResourceManager(typeof(Added_ConnString_To_Tenant_Entity));

string IMigrationMetadata.Id
{
get { return "201604201100303_Added_ConnString_To_Tenant_Entity"; }
}

string IMigrationMetadata.Source
{
get { return null; }
}

string IMigrationMetadata.Target
{
get { return Resources.GetString("Target"); }
}
}
[GeneratedCode("EntityFramework.Migrations", "6.1.3-40302")]
public sealed partial class Added_ConnString_To_Tenant_Entity : IMigrationMetadata
{
string IMigrationMetadata.Id
{
get { return "201604201100303_Added_ConnString_To_Tenant_Entity"; }
}
string IMigrationMetadata.Source
{
get { return null; }
}
string IMigrationMetadata.Target
{
get { return "H4s..........AQA="; }
}
}
public JsonResult SwitchToLinkedAccount(SwitchToLinkedAccountModel model)
{
//....
}
public JsonResult SwitchToLinkedAccount([FromBody] SwitchToLinkedAccountModel model)
{
//....
}
public static class BuilderExtensions
{
public static IApplicationBuilder UseAppBuilder(
this IApplicationBuilder app,
Action<IAppBuilder> configure)
{
app.UseOwin(addToPipeline =>
{
addToPipeline(next =>
{
var appBuilder = new AppBuilder();
appBuilder.Properties["builder.DefaultApp"] = next;
configure(appBuilder); return appBuilder.Build<Func<IDictionary<string, object>, Task>>();
});
});
return app;
}
}
app.UseAppBuilder(appBuilder =>
{
appBuilder.Properties["host.AppName"] = "MyProjectName";
appBuilder.MapSignalR();
});

Volosoft

Volosoft

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store