Esempio n. 1
0
        public Project ReadProjectRequirements(Identity id, RequirementType type)
        {
            var project = _projectRepository.Read(id.ToMongoIdentity());

            if (project == null)
            {
                throw new EntityNotFoundException($"ID={id}");
            }

            var user = _userRepository.Read(project.AuthorId);

            if (user == null)
            {
                throw new EntityNotFoundException($"ID={id}");
            }

            var requirementsFilter = Builders <MongoRequirement> .Filter
                                     .Eq(x => x.ProjectId, project.Id);

            var typeFilter = Builders <MongoRequirement> .Filter
                             .Eq(x => x.Type, type.ToString());

            var requirements = _requirementRepository.Find(requirementsFilter & typeFilter);

            return(project.ToDomainEntity(user, requirements));
        }
        public RequirementViewModel(Subject subject, RequirementType type)
        {
            if (subject is null)
            {
                throw new System.ArgumentNullException(nameof(subject));
            }

            Id             = subject.Id;
            Curriculum     = subject.CurriculumId;
            Code           = subject.Code;
            Description    = subject.Description;
            MinimumGrade   = subject.MinimumGrade;
            TargetSemester = subject.TargetSemester;
            Type           = type.ToString();
        }
Esempio n. 3
0
 public override string ToString()
 {
     return(immune.ToString());
 }