internal static string DeleteUser(string id) { string _email; using (var context = new ExamProjectDbEntities()) { var _user = context.AspNetUsers.Where(u => u.Id == id).FirstOrDefault(); _email = _user.Email; var _exUser = context.AspNetUserExtended.Where(u => u.Id == id).FirstOrDefault(); context.Entry(_user).State = System.Data.Entity.EntityState.Deleted; context.Entry(_exUser).State = System.Data.Entity.EntityState.Deleted; context.SaveChanges(); } return(_email); }
internal void Create(string userId) { using (var context = new ExamProjectDbEntities()) { AspNetUserExtended _ext = new AspNetUserExtended() { Id = userId, Name = Name, SurName = Surname, UserType = UserType, }; context.Entry(_ext).State = System.Data.Entity.EntityState.Added; context.SaveChanges(); } }
internal void Create(int textId) { using (var context = new ExamProjectDbEntities()) { ExamProject.Database.Question _question = new Question() { Option_A = Option_A, Option_B = Option_B, Option_C = Option_C, Option_D = Option_D, Text_ID = textId, Soru = Soru, Answer = Answer, }; context.Entry(_question).State = System.Data.Entity.EntityState.Added; context.SaveChanges(); } }