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; } }
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(); } }
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; } }