public static ApplicationUserManager Create( IdentityFactoryOptions <ApplicationUserManager> options, IOwinContext context) { IGwintContext gwintContext = context.GetAutofacLifetimeScope().Resolve <IGwintContext>(); var manager = new ApplicationUserManager(new UserStore(gwintContext)); manager.UserValidator = new UserValidator <ApplicationUser>(manager) { AllowOnlyAlphanumericUserNames = false, //RequireUniqueEmail = true }; // Konfigurieren der Überprüfungslogik für Kennwörter. manager.PasswordValidator = new PasswordValidator { //RequiredLength = 6 }; var dataProtectionProvider = options.DataProtectionProvider; if (dataProtectionProvider != null) { manager.UserTokenProvider = new DataProtectorTokenProvider <ApplicationUser>(dataProtectionProvider.Create("ASP.NET Identity")); } return(manager); }
private Deck GenerateDemoDeck(IGwintContext context) { var battleKingCard = context.Cards.Find(3002L); var cards = new List <Card>() { context.Cards.Find(0L), context.Cards.Find(0L), context.Cards.Find(1L), context.Cards.Find(2L), context.Cards.Find(3L), context.Cards.Find(4L), context.Cards.Find(5L), context.Cards.Find(6L), context.Cards.Find(7L), context.Cards.Find(8L), context.Cards.Find(9L), context.Cards.Find(10L), context.Cards.Find(11L), context.Cards.Find(12L), context.Cards.Find(306L), context.Cards.Find(306L), context.Cards.Find(306L), context.Cards.Find(306L), context.Cards.Find(306L), context.Cards.Find(306L), context.Cards.Find(306L), context.Cards.Find(306L), context.Cards.Find(306L) }; var demoDeck = new Deck { Faction = GwintFaction.Scoiatael, BattleKingCard = battleKingCard.ToDeckCard(), Cards = cards.Select(c => c.ToDeckCard()).ToList(), IsPrimaryDeck = true }; return(demoDeck); }
protected AuthenticatedApiController(IGwintContext context) { Context = context; }
public DeckController(IGwintContext context) : base(context) { }
private Game GetActiveGameByUserId(IGwintContext context, long userId) { return(context.Games.FirstOrDefault(g => g.IsActive && g.Players.Any(p => p.User.Id == userId))); }
public CardController(IGwintContext context) { _context = context; }
public UserController(IGwintContext context) : base(context) { }
public UserStore(IGwintContext context) { _context = context; }