public void Delete(Board board) { List<HomeWork> homeWorks = repository.HomeWorks.Get().ToList(); var homeWorksByBoard = homeWorks.Where(hw => hw.board == board); foreach (var hw in homeWorksByBoard) { repository.HomeWorks.Delete(hw); } data.Remove(board); dbProvider.RemoveFromDB<Board>(board); }
public void Delete(HomeWork entity) { data.Remove(entity); dbProvider.RemoveFromDB <HomeWork>(entity); }