コード例 #1
0
 public UserRepository(JustCreativePublishingsContext context)
 {
     this.context = context;
         dbSet = context.Set<User>();
 }
コード例 #2
0
 public RoleRepository(JustCreativePublishingsContext context)
 {
     this.context = context;
     dbSet = context.Set<IdentityRole>();
 }
コード例 #3
0
 private bool ConfirmAccount(String confirmationToken)
 {
     using (var context = new JustCreativePublishingsContext())
     {
         var user = context.Users.SingleOrDefault(u => u.ConfirmationToken == confirmationToken);
         if (user != null)
         {
             user.IsConfirmed = true;
             var dbSet = context.Set<User>();
             dbSet.Attach(user);
             context.Entry(user).State = EntityState.Modified;
             context.SaveChanges();
             return true;
         }
     }
     return false;
 }