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); }
public void Remove(Vehicle vehicle) { context.Remove(vehicle); }
public void Remove(TeamEnvironment environment) { _context.Remove(environment); }