Ejemplo n.º 1
0
 //confirm user email
 public static void EmailConfirm(string email)
 {
     using (var context = new NeedleWork2016Context())
     {
         var user = context.AspNetUsers.Where(m => m.Email == email).FirstOrDefault();
         user.EmailConfirmed = true;
         context.SaveChanges();
     }
 }
Ejemplo n.º 2
0
        //User deletion by Id
        public static void DeleteUserData(string _id)
        {
            //GetAllUsers(x=>x.Email=="@mail.ru");

            using (var context = new NeedleWork2016Context())
            {
                //Linq request for delition user by Id
                var User = context.AspNetUsers.Where(c => c.Id == _id).FirstOrDefault();
                context.AspNetUsers.Remove(User);
                context.SaveChanges();
            }
        }
Ejemplo n.º 3
0
 //User editing by Id
 public static void EditUser(AspNetUsers user)
 {
     using (var context = new NeedleWork2016Context())
     {
         var User = context.AspNetUsers.Where(c => c.Id == user.Id).FirstOrDefault();
         if (User != null)
         {
             User.Id = user.Id;
             User.Email = user.Email;
             User.FirstName = user.FirstName;
             User.LastName = user.LastName;
             context.SaveChanges();
         }
     }
 }