示例#1
0
        public async Task <IUserModel> UpdateAsync(IUserModel user)
        {
            var _user = await _context.Users.FindAsync(user.UserID);

            _context.Entry(_user).CurrentValues.SetValues(_mapper.Map <IUserModel, User>(user));
            return(user);
        }
示例#2
0
        public async Task <ICriterionModel> UpdateAsync(ICriterionModel criterion)
        {
            var _criterion = await _context.Criteria.FindAsync(criterion.CriteriaID);

            _context.Entry(_criterion).CurrentValues.SetValues(_mapper.Map <ICriterionModel, Criterion>(criterion));
            return(criterion);
        }
示例#3
0
        public async Task <IChoiceModel> UpdateAsync(IChoiceModel choice)
        {
            var _choice = await _context.Choices.FindAsync(choice.ChoiceID);

            _context.Entry(_choice).CurrentValues.SetValues(_mapper.Map <IChoiceModel, Choice>(choice));
            return(choice);
        }
        public async Task <IAlternativeModel> UpdateAsync(IAlternativeModel alternative)
        {
            var _alternative = await _context.Alternatives.FindAsync(alternative.AlternativeID);

            _context.Entry(_alternative).CurrentValues.SetValues(_mapper.Map <IAlternativeModel, Alternative>(alternative));
            return(alternative);
        }
        public async Task <ICriteriaComparisonModel> UpdateAsync(ICriteriaComparisonModel cc)
        {
            var _cc = await _context.CriteriaComparisons.FindAsync(cc.CriteriaID1, cc.CriteriaID2);

            _context.Entry(_cc).CurrentValues.SetValues(_mapper.Map <ICriteriaComparisonModel, CriteriaComparison>(cc));
            return(cc);
        }
        public async Task <IAlternativeComparisonModel> UpdateAsync(IAlternativeComparisonModel ac)
        {
            var _ac = await _context.AlternativeComparisons.FindAsync(ac.CriteriaID, ac.AlternativeID1, ac.AlternativeID2);

            _context.Entry(_ac).CurrentValues.SetValues(_mapper.Map <IAlternativeComparisonModel, AlternativeComparison>(ac));
            return(ac);
        }