diff --git a/binaries/Debug/yavsccli b/binaries/Debug/yavsccli deleted file mode 100755 index 596d81ec..00000000 Binary files a/binaries/Debug/yavsccli and /dev/null differ diff --git a/src/Yavsc.Abstract/Interfaces/IBillingService.cs b/src/Yavsc.Abstract/Interfaces/IBillingService.cs index 5e123b36..99317145 100644 --- a/src/Yavsc.Abstract/Interfaces/IBillingService.cs +++ b/src/Yavsc.Abstract/Interfaces/IBillingService.cs @@ -9,7 +9,7 @@ namespace Yavsc.Services { // TODO ensure a default value at using this: /// - /// maps a command type name to a bolling code, used to get bill assets + /// maps a command type name to a billing code, used to get bill assets /// /// Dictionary BillingMap { get; } @@ -33,7 +33,7 @@ namespace Yavsc.Services /// /// /// - Task> GetPerformersSettingsAsync(string activityCode); + Task> GetPerformersSettingsAsync(string activityCode); /// /// Perfomer settings for the specified performer in the activity diff --git a/src/Yavsc/ApiControllers/accounting/AccountController.cs b/src/Yavsc/ApiControllers/accounting/AccountController.cs index d5066d5c..a9934a2b 100644 --- a/src/Yavsc/ApiControllers/accounting/AccountController.cs +++ b/src/Yavsc/ApiControllers/accounting/AccountController.cs @@ -28,7 +28,6 @@ namespace Yavsc.WebApi.Controllers _signInManager = signInManager; _logger = loggerFactory.CreateLogger("ApiAuth"); _dbContext = dbContext; - IViewComponentHelper h; } public UserManager UserManager diff --git a/src/Yavsc/Services/BillingService.cs b/src/Yavsc/Services/BillingService.cs index 76fdac04..1aaefe8b 100644 --- a/src/Yavsc/Services/BillingService.cs +++ b/src/Yavsc/Services/BillingService.cs @@ -32,19 +32,17 @@ namespace Yavsc.Services public static IDecidableQuery GetBillable(ApplicationDbContext context, string billingCode, long queryId ) => Billing[billingCode](context, queryId); public async Task GetPerformerSettingsAsync(string activityCode, string userId) { - return await (await GetPerformersSettingsAsync(activityCode)).SingleOrDefaultAsync(s=> s.UserId == userId); + return (await GetPerformersSettingsAsync(activityCode)).SingleOrDefault(s=> s.UserId == userId); } - public async Task> GetPerformersSettingsAsync(string activityCode) + public async Task> GetPerformersSettingsAsync(string activityCode) { var activity = await DbContext.Activities.SingleAsync(a=>a.Code == activityCode); if (activity.SettingsClassName==null) return null; - var dbSetPropInfo = UserSettings.SingleOrDefault(s => s.PropertyType.GenericTypeArguments[0].FullName == activity.SettingsClassName); - - if (dbSetPropInfo == null) return null; - return (IQueryable) dbSetPropInfo.GetValue(DbContext); + return UserSettings.Where(s => s.PropertyType.GenericTypeArguments[0].FullName == activity.SettingsClassName) + .Cast(); } } } diff --git a/src/Yavsc/Startup/Startup.cs b/src/Yavsc/Startup/Startup.cs index c8b59414..f309a158 100755 --- a/src/Yavsc/Startup/Startup.cs +++ b/src/Yavsc/Startup/Startup.cs @@ -17,6 +17,7 @@ using Microsoft.Extensions.Options; using Yavsc.Models; using Yavsc.Services; using Microsoft.IdentityModel.Tokens; +using Microsoft.AspNetCore.Identity; namespace Yavsc { @@ -250,6 +251,12 @@ namespace Yavsc { options.ResourcesPath = "Resources"; }); + + services.AddIdentity() + .AddDefaultTokenProviders() + .AddEntityFrameworkStores(); + services.AddControllersWithViews(); + } public static IServiceProvider Services { get; private set; } diff --git a/src/Yavsc/Views/Shared/DisplayTemplates/PerformerProfileViewModel.cshtml b/src/Yavsc/Views/Shared/DisplayTemplates/PerformerProfileViewModel.cshtml index 5be70b9a..a14ebed3 100644 --- a/src/Yavsc/Views/Shared/DisplayTemplates/PerformerProfileViewModel.cshtml +++ b/src/Yavsc/Views/Shared/DisplayTemplates/PerformerProfileViewModel.cshtml @@ -2,8 +2,8 @@
@Html.DisplayFor(m=>m.UserName) - @if (Model.SettingsClassName!=null) - { await Html.RenderPartialAsync( Model.SettingsClassName,Model.Settings); } + @if (!string.IsNullOrWhiteSpace(Model.SettingsClassName)) + { await Html.RenderPartialAsync(Model.SettingsClassName, Model.Settings); } @if (Model.WebSite!=null) { WebSite: @Model.WebSite diff --git a/src/Yavsc/Views/_ViewImports.cshtml b/src/Yavsc/Views/_ViewImports.cshtml index 1f6ec24b..88cfb2e3 100755 --- a/src/Yavsc/Views/_ViewImports.cshtml +++ b/src/Yavsc/Views/_ViewImports.cshtml @@ -25,6 +25,7 @@ @using Microsoft.AspNetCore.Authorization;; @using Microsoft.AspNetCore.Mvc; @using Microsoft.AspNetCore.Html; +@using Microsoft.AspNetCore.Identity; @using Yavsc.Helpers; @using PayPal.PayPalAPIInterfaceService.Model; @@ -33,3 +34,5 @@ @inject IAuthorizationService AuthorizationService @inject Microsoft.AspNetCore.Mvc.Localization.IHtmlLocalizer SR @inject Microsoft.Extensions.Options.IOptions SiteSettings +@inject SignInManager SignInManager +@inject UserManager UserManager diff --git a/src/cli/Commands/UserListCleanUp.cs b/src/cli/Commands/UserListCleanUp.cs index 40b1b8a5..4ea5f410 100644 --- a/src/cli/Commands/UserListCleanUp.cs +++ b/src/cli/Commands/UserListCleanUp.cs @@ -43,7 +43,7 @@ namespace cli.Commands var mailer = app.Services.GetService(); var loggerFactory = app.Services.GetService(); var logger = loggerFactory.CreateLogger(); - var userManager = app.Services.GetService>(); + var userManager = app.Services.GetService>(); ApplicationDbContext dbContext = app.Services.GetService(); Func criteria = UserPolicies.Criterias["user-to-remove"]; diff --git a/src/cli/Startup.cs b/src/cli/Startup.cs index 5dcd3db1..13639e3d 100644 --- a/src/cli/Startup.cs +++ b/src/cli/Startup.cs @@ -158,7 +158,6 @@ namespace cli } ); - services.AddTransient(typeof(CompilationEngine), svs => { var logger = svs.GetService().CreateLogger(); @@ -175,6 +174,7 @@ namespace cli PlatformServices.Default.Runtime, PlatformServices.Default.AssemblyLoadContextAccessor.Default, new CompilationCache())); }); + services.AddTransient(typeof(IFrameworkReferenceResolver), svs => new FrameworkReferenceResolver());