Exemplo n.º 1
0
        public ActionResult Competences()
        {
            var allCompetences = userRepository
                                .Query(m => m.Users.Select(u => u.Competences));

            WeightedTags tags = new WeightedTags();
            tags.Add(allCompetences);

            return Json(tags.SortedStrings(), JsonRequestBehavior.AllowGet);
        }
Exemplo n.º 2
0
        private IOrderedEnumerable<KeyValuePair<string, int>> GetWeightedCompetencesNeeded()
        {
            // TODO: include CompetencesNeeded?
            var allCompetences = userRepository
                .Query(m => m.Users.Select(u => u.Ideas.First().SearchProfile.CompetencesNeeded));

            WeightedTags tags = new WeightedTags();
            tags.Add(allCompetences);

            return tags.Tags.OrderByDescending(t => t.Value);
        }
Exemplo n.º 3
0
        public void Test()
        {
            var modelFactory = new ModelFactory<UserModel>(() => new UserModel()); // {OnRestore = model => model.Invalidate()};
            UserRepository userRepository = new UserRepository(new RepositoryConfiguration(), modelFactory) { Path = @"c:\temp\yoyyin\users" };

            var allCompetences = userRepository
                .Query(m => m.Users.Select(u => u.Ideas.First().SearchProfile.CompetencesNeeded));

            WeightedTags tags = new WeightedTags();
            tags.Add(allCompetences);

            tags.Print();

            Assert.That(allCompetences.Count(), Is.GreaterThanOrEqualTo(40));
        }