Пример #1
0
        public RequirementVM GetRequirement(int requirementId)
        {
            var model       = new RequirementVM();
            var transformer = new RequirementTransformer();

            using (var db = new ManagementToolEntities())
            {
                var resp = new RequirementRepository(db);

                var requirement = resp.GetFirstOrDefault(r => r.RequirementId == requirementId);
                model = transformer.Transform(requirement);
            }

            return(model);
        }
Пример #2
0
        public List <RequirementVM> GetProjectRequirements(int projectId)
        {
            var model       = new List <RequirementVM>();
            var transformer = new RequirementTransformer();

            using (var db = new ManagementToolEntities())
            {
                var resp = new RequirementRepository(db);

                IEnumerable <DBModels.Requirement> requirements = resp.Get(r => r.ProjectId == projectId);
                model = transformer.Transform(requirements);
            }

            return(model);
        }