• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# LmPlatformRepositoriesContainer类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: SaveQuestion

        public Question SaveQuestion(Question question)
        {
            CheckForTestIsNotLocked(question.TestId);

            ValidateQuestion(question);

            using (var repositoriesContainer = new LmPlatformRepositoriesContainer())
            {
                repositoriesContainer.QuestionsRepository.Save(question);
                Question existingQuestion = GetQuestion(question.Id);
                var answersToDelete = existingQuestion.Answers.Where(a => question.Answers.All(answer => answer.Id != a.Id));

                // TODO: Resolve problem (items are saved only first time)
                foreach (Answer answer in question.Answers)
                {
                    answer.QuestionId = question.Id;
                }

                repositoriesContainer.RepositoryFor<Answer>().Save(question.Answers);
                repositoriesContainer.RepositoryFor<Answer>().Delete(answersToDelete);

                repositoriesContainer.ApplyChanges();
                return question;
            }
        }
开发者ID:slaq777,项目名称:lmsystem,代码行数:25,代码来源:QuestionsManagementService.cs


示例17: GetGroup

 public Group GetGroup(int groupId)
 {
     using (var repositoriesContainer = new LmPlatformRepositoriesContainer())
     {
         return repositoriesContainer.GroupsRepository.GetBy(new Query<Group>(e => e.Id == groupId).Include(e => e.Students.Select(x => x.LecturesVisitMarks)));
     }
 }
开发者ID:slaq777,项目名称:lmsystem,代码行数:7,代码来源:GroupManagementService.cs


示例18: GetGroups

 public List<Group> GetGroups(IQuery<Group> query = null)
 {
     using (var repositoriesContainer = new LmPlatformRepositoriesContainer())
     {
         return repositoriesContainer.GroupsRepository.GetAll(query).ToList();
     }
 }
开发者ID:slaq777,项目名称:lmsystem,代码行数:7,代码来源:GroupManagementService.cs


示例19: GetLecturers

 public List<Lecturer> GetLecturers()
 {
     using (var repositoriesContainer = new LmPlatformRepositoriesContainer())
     {
         return repositoriesContainer.LecturerRepository.GetAll(new Query<Lecturer>().Include(e => e.SubjectLecturers).Include(e => e.User)).ToList();
     }
 }
开发者ID:ze333,项目名称:lmsystem,代码行数:7,代码来源:LecturerManagementService.cs


示例20: GetObjects

 public ActionResult GetObjects()
 {
     using (var repositoriesContainer = new LmPlatformRepositoriesContainer())
     {
         return Json(repositoriesContainer.RepositoryFor<ScoObjects>().GetAll(new Query<ScoObjects>(e => !e.IsDeleted)).ToList(), JsonRequestBehavior.AllowGet);
     }
 }
开发者ID:slaq777,项目名称:lmsystem,代码行数:7,代码来源:ScormModController.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# LoadBalancerId类代码示例发布时间:2022-05-24
下一篇:
C# TutorParser.HardCodedParserMain类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap