Ejemplo n.º 1
0
        public void AssignTestToUser(long testId, long userId)
        {
            using (var ctx = new HrmContext())
            {
                var user = ctx.Users.Single(x => x.Id == userId);
                var test = ctx.Tests.Single(x => x.Id == testId);
                user.AssignedTests.Add(test);

                ctx.SaveChanges();
            }
        }
Ejemplo n.º 2
0
        public void SaveSelectedCandidates(IList<long> selected)
        {
            using (var ctx = new HrmContext())
            {
                var curJob = ctx.Jobs.Single(x => x.Id == this.CurrentJobId);
                foreach (var userId in selected)
                {
                    curJob.SelectedCandidates.Add(ctx.Users.Single(x=>x.Id == userId));
                }

                ctx.SaveChanges();
            }

            this.CurrentSelectedCandidatesIds = selected;
        }