Ejemplo n.º 1
0
        /// <summary>
        /// Update an Existing Interview
        /// </summary>
        /// <param name="InterviewId"></param>
        /// <param name="interview"></param>
        /// <returns></returns>
        public async Task <Interview> UpdateInterview(Interview interview)
        {
            if (interview == null)
            {
                throw new ArgumentNullException(typeof(Interview).Name + "Object or may be InterviewId is Null");
            }
            _interviewDb.Entry(interview).State = EntityState.Modified;
            var rseult = await _interviewDb.SaveChangesAsync();

            return(interview);
        }
        /// <summary>
        /// Update an Existing user by passing its object
        /// </summary>
        /// <param name="user"></param>
        /// <returns></returns>
        public async Task <ApplicationUser> UpdateUser(ApplicationUser user)
        {
            if (user == null)
            {
                throw new ArgumentNullException(typeof(ApplicationUser).Name + "Object or may be UserId is Null");
            }
            try
            {
                _interviewDb.Entry(user).State = EntityState.Modified;
                var rseult = await _interviewDb.SaveChangesAsync();

                return(user);
            }
            catch (Exception ex)
            {
                throw (ex);
            }
        }