当前位置: 首页>>代码示例>>C#>>正文


C# LmPlatformRepositoriesContainer类代码示例

本文整理汇总了C#中LmPlatformRepositoriesContainer的典型用法代码示例。如果您正苦于以下问题:C# LmPlatformRepositoriesContainer类的具体用法?C# LmPlatformRepositoriesContainer怎么用?C# LmPlatformRepositoriesContainer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


LmPlatformRepositoriesContainer类属于命名空间,在下文中一共展示了LmPlatformRepositoriesContainer类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetRootElementsBySubject

 public IEnumerable<Concept> GetRootElementsBySubject(int subjectId)
 {
     using (var repositoriesContainer = new LmPlatformRepositoriesContainer())
     {
         return repositoriesContainer.ConceptRepository.GetRootElementsBySubjectId(subjectId);
     }
 }
开发者ID:slaq777,项目名称:lmsystem,代码行数:7,代码来源:ConceptManagementService.cs

示例2: GetStudents

 public IEnumerable<Student> GetStudents()
 {
     using (var repositoriesContainer = new LmPlatformRepositoriesContainer())
     {
         return repositoriesContainer.StudentsRepository.GetAll(new Query<Student>().Include(e => e.Group).Include(e => e.User)).ToList();
     }
 }
开发者ID:MikhailGogolushko,项目名称:lmsystem,代码行数:7,代码来源:StudentManagementService.cs

示例3: GetGroupSubjects

		public List<Subject> GetGroupSubjects(int groupId)
		{
			using (var repositoriesContainer = new LmPlatformRepositoriesContainer())
			{
				return repositoriesContainer.SubjectRepository.GetSubjects(groupId: groupId).Where(e => !e.IsArchive).ToList();
			}
		}
开发者ID:MikhailGogolushko,项目名称:lmsystem,代码行数:7,代码来源:SubjectManagementService.cs

示例4: DeleteLabs

        public void DeleteLabs(int id)
        {
            using (var repositoriesContainer = new LmPlatformRepositoriesContainer())
            {
                var labs =
                    repositoriesContainer.LabsRepository.GetBy(
                        new Query<Labs>(e => e.Id == id).Include(e => e.StudentLabMarks));

                var deleteFiles =
                        repositoriesContainer.AttachmentRepository.GetAll(
                            new Query<Attachment>(e => e.PathName == labs.Attachments)).ToList();

                var studentLabMarks =
                    repositoriesContainer.RepositoryFor<StudentLabMark>()
                        .GetAll(new Query<StudentLabMark>(e => e.LabId == id))
                        .ToList();

                foreach (var attachment in deleteFiles)
                {
                    FilesManagementService.DeleteFileAttachment(attachment);
                }

                foreach (var mark in studentLabMarks)
                {
                    repositoriesContainer.RepositoryFor<StudentLabMark>().Delete(mark);
                }

                repositoriesContainer.ApplyChanges();

                repositoriesContainer.LabsRepository.Delete(labs);

                repositoriesContainer.ApplyChanges();
            }
        }
开发者ID:ze333,项目名称:lmsystem,代码行数:34,代码来源:SubjectManagementService.cs

示例5: GetFileDisplayName

 public string GetFileDisplayName(string guid)
 {
     using (var repositoriesContainer = new LmPlatformRepositoriesContainer())
     {
         return repositoriesContainer.AttachmentRepository.GetBy(new Query<Attachment>(e => e.FileName == guid)).Name;
     }
 }
开发者ID:slaq777,项目名称:lmsystem,代码行数:7,代码来源:FilesManagementService.cs

示例6: GetModules

 public ICollection<Module> GetModules()
 {
     using (var repositoriesContainer = new LmPlatformRepositoriesContainer())
     {
         return repositoriesContainer.ModulesRepository.GetAll().ToList();
     }
 }
开发者ID:slaq777,项目名称:lmsystem,代码行数:7,代码来源:ModulesManagementService.cs

示例7: GetById

 public Concept GetById(int id)
 {
     using (var repositoriesContainer = new LmPlatformRepositoriesContainer())
     {
         return repositoriesContainer.ConceptRepository.GetById(id);
     }
 }
开发者ID:slaq777,项目名称:lmsystem,代码行数:7,代码来源:ConceptManagementService.cs

示例8: GetBugs

 public List<Bug> GetBugs()
 {
     using (var repositoriesContainer = new LmPlatformRepositoriesContainer())
     {
         return repositoriesContainer.BugsRepository.GetAll().ToList();
     }
 }
开发者ID:slaq777,项目名称:lmsystem,代码行数:7,代码来源:BugManagementService.cs

示例9: GetBugLogs

 public List<BugLog> GetBugLogs(int bugId)
 {
     using (var repositoriesContainer = new LmPlatformRepositoriesContainer())
     {
         return repositoriesContainer.BugLogsRepository.GetAll(new Query<BugLog>(e => e.BugId == bugId).Include(e => e.User)).ToList();
     }
 }
开发者ID:slaq777,项目名称:lmsystem,代码行数:7,代码来源:BugManagementService.cs

示例10: GetBug

 public Bug GetBug(int bugId)
 {
     using (var repositoriesContainer = new LmPlatformRepositoriesContainer())
     {
         return repositoriesContainer.BugsRepository.GetBy(new Query<Bug>(e => e.Id == bugId));
     }
 }
开发者ID:slaq777,项目名称:lmsystem,代码行数:7,代码来源:BugManagementService.cs

示例11: GetUserByName

        public User GetUserByName(string firstName, string lastName, string middleName)
        {
            using (var repositoriesContainer = new LmPlatformRepositoriesContainer())
            {
                var checkPatronymic = !string.IsNullOrEmpty(middleName);

                var lecturers = repositoriesContainer.LecturerRepository.GetAll(
                        new Query<Lecturer>(e =>
                            (e.FirstName == firstName && e.LastName == lastName && !checkPatronymic)
                            || (checkPatronymic && (e.MiddleName == middleName && e.FirstName == firstName && e.LastName == lastName))))
                            .Select(l => l.User).ToList();

                if (lecturers.Any())
                {
                    return lecturers.First();
                }

                var students = repositoriesContainer.StudentsRepository.GetAll(
                        new Query<Student>(e =>
                            (e.FirstName == firstName && e.LastName == lastName && !checkPatronymic)
                            || (checkPatronymic && (e.MiddleName == middleName && e.FirstName == firstName && e.LastName == lastName))))
                            .Select(l => l.User);

                return students.Any() ? students.First() : null;
            }
        }
开发者ID:MikhailGogolushko,项目名称:lmsystem,代码行数:26,代码来源:UsersManagementService.cs

示例12: GetRemainingTime

        private int GetRemainingTime(int testId, int questionId, int userId)
        {
            var test = GetTest(testId);
            TestPassResult testPassResult = GetTestPassResult(testId, userId);

            double seconds = 0;

            if (test.SetTimeForAllTest)
            {
                seconds = (test.TimeForCompleting * 60) - (DateTime.UtcNow - testPassResult.StartTime).TotalSeconds;
            }
            else
            {
                if (testPassResult.Comment == questionId.ToString())
                {
                    seconds = test.TimeForCompleting - ((DateTime.UtcNow.Ticks - testPassResult.StartTime.Ticks) / TimeSpan.TicksPerSecond);
                }
                else
                {
                    seconds = test.TimeForCompleting;
                    testPassResult.StartTime = DateTime.UtcNow;
                    testPassResult.Comment = questionId.ToString();
                }

                using (var repositoriesContainer = new LmPlatformRepositoriesContainer())
                {
                    repositoriesContainer.RepositoryFor<TestPassResult>().Save(testPassResult);
                    repositoriesContainer.ApplyChanges();
                }
            }

            return seconds > 0 ? (int)seconds : 0;
        }
开发者ID:slaq777,项目名称:lmsystem,代码行数:33,代码来源:TestPassingService.cs

示例13: GetProjectsOfUser

 public List<ProjectUser> GetProjectsOfUser(int userId)
 {
     using (var repositoriesContainer = new LmPlatformRepositoriesContainer())
     {
         return repositoriesContainer.ProjectUsersRepository.GetAll(new Query<ProjectUser>(e => e.UserId == userId).Include(e => e.Project).Include(e => e.User).Include(e => e.ProjectRole)).ToList();
     }
 }
开发者ID:slaq777,项目名称:lmsystem,代码行数:7,代码来源:ProjectManagementService.cs

示例14: GetRootElements

 public IEnumerable<Concept> GetRootElements(Int32 authorId)
 {
     using (var repositoriesContainer = new LmPlatformRepositoriesContainer())
     {
         return repositoriesContainer.ConceptRepository.GetRootElementsByAuthorId(authorId);
     }
 }
开发者ID:slaq777,项目名称:lmsystem,代码行数:7,代码来源:ConceptManagementService.cs

示例15: GetProjectUser

 public ProjectUser GetProjectUser(int projectUserId)
 {
     using (var repositoriesContainer = new LmPlatformRepositoriesContainer())
     {
         return repositoriesContainer.ProjectUsersRepository.GetBy(new Query<ProjectUser>(e => e.Id == projectUserId).Include(e => e.Project).Include(e => e.User).Include(e => e.ProjectRole));
     }
 }
开发者ID:slaq777,项目名称:lmsystem,代码行数:7,代码来源:ProjectManagementService.cs


注:本文中的LmPlatformRepositoriesContainer类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。