Ejemplo n.º 1
0
        public async Task <Learner> Update(Learner learner)
        {
            var originalLearner = await _learnerRepository.GetById(learner.Id);

            if (originalLearner == null)
            {
                return(null);
            }

            learner.User.Id = originalLearner.User.Id;

            if (await _groupService.GetById(learner.GroupId) == null)
            {
                return(null);
            }
            if (await _organisationService.GetById(learner.User.OrganisationId) == null)
            {
                return(null);
            }

            await _learnerRepository.Update(learner);

            return(learner);
        }