public GroupSpace DeleteGroupSpaceById(string id)
        {
            var groupSpaceRemoved = _context.Remove <GroupSpace>(new GroupSpace()
            {
                Id = Guid.Parse(id)
            }).Entity;

            _context.SaveChanges();
            return(groupSpaceRemoved);
        }
예제 #2
0
        public User DeleteUserById(int id)
        {
            var userRemoved = _context.Remove <User>(new User()
            {
                Id = id
            }).Entity;

            _context.SaveChanges();
            return(userRemoved);
        }
예제 #3
0
 public void Delete(int dni)
 {
     using (GlobalDbContext dbContext = new GlobalDbContext())
     {
         Profesor profesor = dbContext.Profesores(true)
                             .Where(s => s.DNI == dni)
                             .FirstOrDefault();
         if (profesor != null)
         {
             dbContext.Remove(profesor);
             dbContext.SaveChanges();
         }
     }
 }
예제 #4
0
 public void Delete(int num_orden)
 {
     using (GlobalDbContext dbContext = new GlobalDbContext())
     {
         TFC tfc = dbContext.TFCs(true)
                   .Where(s => s.Num_orden == num_orden)
                   .FirstOrDefault();
         if (tfc != null)
         {
             dbContext.Remove(tfc);
             dbContext.SaveChanges();
         }
     }
 }
 public void Delete(int num_matricula)
 {
     using (GlobalDbContext dbContext = new GlobalDbContext())
     {
         Alumno alumno = dbContext.Alumnos(true)
                         .Where(s => s.Num_Matricula == num_matricula)
                         .FirstOrDefault();
         if (alumno != null)
         {
             dbContext.Remove(alumno);
             dbContext.SaveChanges();
         }
     }
 }
예제 #6
0
 public void Delete(int num_grupo)
 {
     using (GlobalDbContext dbContext = new GlobalDbContext())
     {
         Grupo grupo = dbContext.Grupos(true)
                       .Where(s => s.Num_grupo == num_grupo)
                       .FirstOrDefault();
         if (grupo != null)
         {
             dbContext.Remove(grupo);
             dbContext.SaveChanges();
         }
     }
 }
 public void Delete(int num)
 {
     using (GlobalDbContext dbContext = new GlobalDbContext())
     {
         Tribunal tribunal = dbContext.Tribunales(true)
                             .Where(s => s.Num == num)
                             .FirstOrDefault();
         if (tribunal != null)
         {
             dbContext.Remove(tribunal);
             dbContext.SaveChanges();
         }
     }
 }
 public UserGroupSpace DeleteRefereceById(string groupSpaceId, int userId)
 {
     var referenceRemoved = _context.Remove<UserGroupSpace>(new UserGroupSpace() { GroupSpaceId = Guid.Parse(groupSpaceId), UserId = userId }).Entity;
     _context.SaveChanges();
     return referenceRemoved;
 }