예제 #1
0
        public bool Delete(Guid userId)
        {
            var user = new User();

            try
            {
                userRepo.DbContext.BeginTransaction();

                user = userRepo.GetAll().Single(u => u.UserId == userId);
                user.Audit.IsDeleted = true;

                userRepo.DbContext.CommitTransaction();

                return true;
            }
            catch (Exception ex)
            {
                LogManager.LogException(ex);
                return false;
            }
        }
예제 #2
0
        public User GetUserById(Guid userId)
        {
            var user = new User();

            try
            {
                userRepo.DbContext.BeginTransaction();
                user = userRepo.GetAll().Single(u=>u.UserId == userId);
                userRepo.DbContext.CommitTransaction();

                return user;
            }
            catch (Exception ex)
            {
                LogManager.LogException(ex);
                return new User();
            }
        }
예제 #3
0
        public bool UpdateUser(User user)
        {
            try
            {
                userRepo.DbContext.BeginTransaction();
                userRepo.SaveOrUpdate(user);
                userRepo.DbContext.CommitTransaction();

                return true;
            }
            catch (Exception ex)
            {
                LogManager.LogException(ex);
                return false;
            }
        }