예제 #1
0
 public CreationStatus CreateCourseData(TimetableDataDbModel model)
 {
     try
     {
         GetTimetableDataCollection()
         .InsertOne(model);
         return(CreationStatus.Created);
     }
     catch (Exception)
     {
         return(CreationStatus.ExceptionThrown);
     }
 }
        public TimetableData GetTimetableDataByHashCode(string name, int hashCode)
        {
            TimetableDataDbModel dbModel = _databaseService.GetTimetableDataByHashCode(name, hashCode);

            if (dbModel != null)
            {
                return(new TimetableData
                {
                    Owner = dbModel.Owner,
                    SourceName = dbModel.SourceName,
                    Time = dbModel.Time,
                    HashCode = dbModel._id.GetHashCode(),
                    CourseList = dbModel.CourseList,
                    CourseLecturerSettings = dbModel.CourseLecturerSettings
                });
            }
            return(null);
        }