public IEnumerable <BLLProgrammer_Sphere> RateProgrammers(IEnumerable <string> sortings) { var res = new List <BLLProgrammer_Sphere>(); var Spheres = GetSphere(sortings); var users = uow.Programmers.GetAll(); foreach (var item in Spheres) { users = users.Intersect(uow.Spheres.GetUsersWithSphere(item), new UserComparer()); } foreach (var user in users) { var userSkills = new BLLProgrammer_Sphere(); var userProfile = uow.Programmers.GetById(user.Id); userSkills.IdProgrammer = user.Id; foreach (var sphere in Spheres) { var bllsphere = SphereMapper.GetBLLEntity(sphere); bllsphere.Level = uow.Spheres.GetLevelOfSphere(user.Id, sphere.Id); userSkills.Spheres.Add(bllsphere); } res.Add(userSkills); } return(res); }
public ActionResult CreateSphere(MvcSphere sphere) { if (ModelState.IsValid) { spheres.Create(SphereMapper.GetBLLEntity(sphere)); return(RedirectToRoute("Spheres")); } return(View()); }
public IEnumerable <BLLSphere> GetAll() { return(uow.Spheres.GetAll().Select(s => SphereMapper.GetBLLEntity(s))); }
public BLLSphere Get(int id) { return(SphereMapper.GetBLLEntity(uow.Spheres.GetById(id))); }