示例#1
0
        public List <ObjectiveViewModel> GetAllObjectives()
        {
            List <Objective> objectives = _db.GetAllObjectives();

            return(objectives.Select(o => new ObjectiveViewModel
            {
                Name = o.Name,
                Photos = o.Photos,
                Score = o.Score,
                Id = o.Id,
                Reviews = o.Reviews
            }).ToList());
        }
        public List <ObjectiveViewModel> GetObjectivesForDropdown()
        {
            List <Objective> objs = _db.GetAllObjectives();

            return(objs.Select(o => new ObjectiveViewModel
            {
                Id = o.Id,
                Name = o.Name
            }).ToList());
        }