From ab950ed3aa4d4a73d5ec50f4e028cceed7f1e9e6 Mon Sep 17 00:00:00 2001 From: Paul Schneider Date: Tue, 7 Jun 2016 15:58:14 +0200 Subject: [PATCH] nettoyages --- Yavsc/Auth/AuthServer/OAuthAuthorizationServerHandler.cs | 1 - Yavsc/Auth/AuthServer/OAuthAuthorizationServerMiddleware.cs | 1 - Yavsc/Controllers/OAuthController.cs | 4 ++-- Yavsc/Model/ApplicationDbContext.cs | 6 ++++++ 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Yavsc/Auth/AuthServer/OAuthAuthorizationServerHandler.cs b/Yavsc/Auth/AuthServer/OAuthAuthorizationServerHandler.cs index 8aa3b8f5..bb5cff45 100644 --- a/Yavsc/Auth/AuthServer/OAuthAuthorizationServerHandler.cs +++ b/Yavsc/Auth/AuthServer/OAuthAuthorizationServerHandler.cs @@ -22,7 +22,6 @@ namespace OAuth.AspNet.AuthServer { ApplicationStore = applicationStore; } - IServiceScope serviceScope; public IApplicationStore ApplicationStore { get; private set;} #region non-Public Members diff --git a/Yavsc/Auth/AuthServer/OAuthAuthorizationServerMiddleware.cs b/Yavsc/Auth/AuthServer/OAuthAuthorizationServerMiddleware.cs index e0d02bbc..51421f50 100644 --- a/Yavsc/Auth/AuthServer/OAuthAuthorizationServerMiddleware.cs +++ b/Yavsc/Auth/AuthServer/OAuthAuthorizationServerMiddleware.cs @@ -4,7 +4,6 @@ using Microsoft.AspNet.Builder; using Microsoft.AspNet.DataProtection; using Microsoft.Extensions.Logging; using Microsoft.Extensions.WebEncoders; -using Microsoft.Extensions.DependencyInjection; using System; namespace OAuth.AspNet.AuthServer diff --git a/Yavsc/Controllers/OAuthController.cs b/Yavsc/Controllers/OAuthController.cs index 22280ba1..cb438b9d 100644 --- a/Yavsc/Controllers/OAuthController.cs +++ b/Yavsc/Controllers/OAuthController.cs @@ -51,10 +51,10 @@ namespace Yavsc.Controllers [HttpGet("~/signin")] public ActionResult SignIn(string returnUrl = null) { - _logger.LogWarning($"Singin wanted: returnUrl: {returnUrl} "); // Note: the "returnUrl" parameter corresponds to the endpoint the user agent // will be redirected to after a successful authentication and not - // the redirect_uri of the requesting client application. + // the redirect_uri of the requesting client application against the third + // party identity provider. return View("SignIn", new LoginViewModel { ReturnUrl = returnUrl, diff --git a/Yavsc/Model/ApplicationDbContext.cs b/Yavsc/Model/ApplicationDbContext.cs index 875a9baf..0e3edd07 100644 --- a/Yavsc/Model/ApplicationDbContext.cs +++ b/Yavsc/Model/ApplicationDbContext.cs @@ -5,6 +5,7 @@ using System.Threading.Tasks; using Microsoft.AspNet.Authentication.OAuth; using Microsoft.AspNet.Identity.EntityFramework; using Microsoft.Data.Entity; +using Microsoft.Data.Entity.Infrastructure; using Yavsc.Models.Booking; namespace Yavsc.Models @@ -21,6 +22,11 @@ namespace Yavsc.Models builder.Entity().HasKey(x => new { x.OwnerId, x.UserId }); builder.Entity().Property(x=>x.CreationDate).HasDefaultValueSql("LOCALTIMESTAMP"); } + protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) + { + optionsBuilder.UseNpgsql(Startup.ConnectionString); + } + public DbSet Applications { get; set; } /// /// Activities referenced on this site