restore l'edition du profile

This commit is contained in:
2017-06-08 22:45:34 +02:00
parent 15d050c8f9
commit c7f26fb636
4 changed files with 24 additions and 36 deletions

View File

@ -6,29 +6,29 @@ using Microsoft.Data.Entity;
namespace Yavsc.Controllers.Generic
{
using System.Linq;
using Models;
using Yavsc.Services;
[Authorize]
public abstract class SettingsController<TSettings> : Controller where TSettings : class, ISpecializationSettings, new()
{
protected ApplicationDbContext _context;
IBillingService billing;
DbSet<TSettings> dbSet=null;
protected string activityCode=null;
protected DbSet<TSettings> Settings { get {
if (dbSet == null) Task.Run( async () => {
dbSet = (DbSet<TSettings>) await billing.GetPerformersSettingsAsync(activityCode);
});
if (dbSet == null) {
dbSet = (DbSet<TSettings>) Startup.UserSettings.Single(s=>s.Name == typeof(TSettings).Name).GetValue(_context);
}
return dbSet;
} }
public SettingsController(ApplicationDbContext context, IBillingService billing)
public SettingsController(ApplicationDbContext context)
{
_context = context;
this.billing = billing;
}
public async Task<IActionResult> Index()