public bool DeleteRoom(int roomId, out string error) { error = string.Empty; try { var entity = DiscussionClassRoomRepository.GetById(roomId); if (entity == null) { error = "Room entity not found"; return(false); } DiscussionClassRoomRepository.Delete(entity); DiscussionClassRoomRepository.UnitOfWork.CommitAndRefreshChanges(); return(true); } catch (Exception ex) { error = Utils.FormatError(ex); Logger.Error("delete room", roomId, ex, CommonEnums.LoggerObjectTypes.Discussion); return(false); } }
public DiscussionClassRoomDTO GetClassRoomDTO(int roomId) { return(roomId < 0 ? new DiscussionClassRoomDTO() : DiscussionClassRoomRepository.GetById(roomId).Entity2ClassRoomDto()); }