Beispiel #1
0
        public void DeletePhoto(int photoId, string uploadFolderPath)
        {
            var photo = context.Photos
                        .Where(p => p.Id == photoId).SingleOrDefault();

            if (photo != null)
            {
                string fileName = photo.PhotoName;
                context.Remove(photo);
                context.SaveChanges();

                if (Directory.Exists(uploadFolderPath) && File.Exists(fileName))
                {
                    File.Delete(fileName);
                }
            }
        }
 public void Remove(Team team)
 {
     _context.Remove(team);
 }
 public void Remove(ClientGroup clientGroup)
 {
     _context.Remove(clientGroup);
 }
Beispiel #4
0
 public void Remove(Vehicle vehicle)
 {
     context.Remove(vehicle);
 }
Beispiel #5
0
 public void Remove(TeamEnvironment environment)
 {
     _context.Remove(environment);
 }