Skip to content

Commit

Permalink
Upgrading to beta6
Browse files Browse the repository at this point in the history
  • Loading branch information
jchadwick committed Aug 30, 2015
1 parent 86f9642 commit ced7372
Show file tree
Hide file tree
Showing 7 changed files with 43 additions and 29 deletions.
4 changes: 2 additions & 2 deletions AspNetBlog/global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
{
"projects": [ "src", "test" ],
"sdk": {
"version": "1.0.0-beta4"
"version": "1.0.0-beta6"
}
}
4 changes: 2 additions & 2 deletions AspNetBlog/src/AspNetBlog/Controllers/AccountController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ public async Task<IActionResult> Login(LoginViewModel login, string returnUrl =
}

[HttpPost]
public IActionResult Logout(string returnUrl = null)
public async Task<IActionResult> Logout(string returnUrl = null)
{
_signInManager.SignOut();
await _signInManager.SignOutAsync();

if (string.IsNullOrWhiteSpace(returnUrl))
return RedirectToAction("Index", "Home");
Expand Down
7 changes: 0 additions & 7 deletions AspNetBlog/src/AspNetBlog/Models/BlogDataContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,5 @@ public IQueryable<ArchivedPostsSummary> GetArchivedPosts()
Month = group.Key.Month,
});
}

protected override void OnModelCreating(ModelBuilder modelBuilder)
{
base.OnModelCreating(modelBuilder);

modelBuilder.ForSqlServer().UseIdentity();
}
}
}
14 changes: 8 additions & 6 deletions AspNetBlog/src/AspNetBlog/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,25 @@
using Microsoft.AspNet.Builder;
using Microsoft.AspNet.Http;
using Microsoft.Framework.DependencyInjection;
using Microsoft.Framework.ConfigurationModel;
using Microsoft.Framework.Configuration;
using Microsoft.Data.Entity;
using Microsoft.AspNet.Identity.EntityFramework;
using Microsoft.Framework.Runtime;

namespace AspNetBlog
{
public class Startup
{
private IConfiguration config;

public Startup()
public Startup(IApplicationEnvironment env)
{
config = new Configuration()
config = new ConfigurationBuilder(env.ApplicationBasePath)
.AddEnvironmentVariables()
.AddJsonFile("config.json")
.AddJsonFile("config.dev.json", true)
.AddUserSecrets();
.AddUserSecrets()
.Build();
}

// For more information on how to configure your application, visit http://go.microsoft.com/fwlink/?LinkID=398940
Expand Down Expand Up @@ -50,7 +52,7 @@ public void Configure(IApplicationBuilder app)
{
var password = config.Get("password");

if (config.Get<bool>("RecreateDatabase"))
if (config.Get("RecreateDatabase") == "true")
{
var context = app.ApplicationServices.GetService<Models.BlogDataContext>();
context.Database.EnsureDeleted();
Expand All @@ -60,7 +62,7 @@ public void Configure(IApplicationBuilder app)

app.UseIdentity();

if (config.Get<bool>("debug"))
if (config.Get("debug") == "true")
{
app.UseErrorPage();
app.UseRuntimeInfoPage();
Expand Down
22 changes: 11 additions & 11 deletions AspNetBlog/src/AspNetBlog/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@
"version": "1.0.0-*",

"dependencies": {
"Microsoft.AspNet.Server.IIS": "1.0.0-beta4",
"Microsoft.AspNet.Server.WebListener": "1.0.0-beta4",
"Microsoft.AspNet.StaticFiles": "1.0.0-beta4",
"Microsoft.AspNet.Mvc": "6.0.0-beta4",
"Microsoft.AspNet.Mvc.TagHelpers": "6.0.0-beta4",
"EntityFramework.SqlServer": "7.0.0-beta4",
"Microsoft.AspNet.Diagnostics": "1.0.0-beta4",
"Microsoft.Framework.ConfigurationModel": "1.0.0-beta4",
"Microsoft.Framework.ConfigurationModel.UserSecrets": "1.0.0-beta4",
"Microsoft.Framework.ConfigurationModel.Json": "1.0.0-beta4",
"Microsoft.AspNet.Identity.EntityFramework": "3.0.0-beta4"
"Microsoft.AspNet.Server.IIS": "1.0.0-beta6",
"Microsoft.AspNet.Server.WebListener": "1.0.0-beta6",
"Microsoft.AspNet.StaticFiles": "1.0.0-beta6",
"Microsoft.AspNet.Mvc": "6.0.0-beta6",
"Microsoft.AspNet.Mvc.TagHelpers": "6.0.0-beta6",
"EntityFramework.SqlServer": "7.0.0-beta6",
"Microsoft.AspNet.Diagnostics": "1.0.0-beta6",
"Microsoft.Framework.Configuration": "1.0.0-beta6",
"Microsoft.Framework.Configuration.UserSecrets": "1.0.0-beta6",
"Microsoft.Framework.Configuration.Json": "1.0.0-beta6",
"Microsoft.AspNet.Identity.EntityFramework": "3.0.0-beta6"
},

"commands": {
Expand Down
1 change: 0 additions & 1 deletion AspNetBlog/src/AspNetBlog/wwwroot/lib/.gitignore

This file was deleted.

20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,23 @@ Demo source code and links for Lynda.com Up and Running with ASP.NET 5 training

## Exercise File versions
* __1.0.0-beta4__ *(what is shown in the videos)*__:__ [Sample application code](https://github.com/jchadwick/UpAndRunningWithAspNet5/tree/beta4/AspNetBlog)
* __1.0.0-beta6__: [Sample application code](https://github.com/jchadwick/UpAndRunningWithAspNet5/tree/beta6/AspNetBlog)

## Release Notes

### beta4 to beta6 [(Full file comparison)](https://github.com/jchadwick/UpAndRunningWithAspNet5/compare/beta4...beta6)

__Namespace/Library changes__
* `Microsoft.Framework.ConfigurationModel` renamed to `Microsoft.Framework.Configuration`

__API changes__
* __Configuration__
* *[Startup.cs: line 21]* Must use `ConfigurationBuilder` instead of `Configuration` to create configuration objects
* *[Startup.cs: line 21]* New `ConfigurationBuilder` requires base path for configuration files; inject `IApplicationEnvironment` into the `Startup` constructor *[Startup.cs: line 19]* and call `IApplicationEnvironment.ApplicationBasePath`
* *[Startup.cs: line 26]* Must call `.Build()` after adding configuration sources to generate configuration object
* *[Startup.cs: lines 55, 65]* `IConfiguration.Get<T>()` no longer offered - must use non-generic version, which returns a string
* __Entity Framework__
* *[BlogDataContext.cs: line 36]* `ModelBuilder.ForSqlServer()` extension no longer provided/required - removed entire extraneous section
* __Identity__
* *[AccountController.cs: line 58]* Synchronous version of `SignInManager.SignOut()` no longer offered - must use `.SignOutAync()`.
*Also converted the controller action to an async action, though this is not required*

0 comments on commit ced7372

Please sign in to comment.