public int SetUser(User user) { _logger.Info($"BLL.{nameof(UserBll)}.{nameof(SetUser)}: Retention of the user"); if (user.Role != null) { _logger.Info($"BLL.{nameof(UserBll)}.{nameof(SetUser)}: Role discovered"); user.Role.Id = _roleBll.SetRole(user.Role); } else { _logger.Info($"BLL.{nameof(UserBll)}.{nameof(SetUser)}: Role not discovered"); } if (user.Id != null) { int id = _userDao.ChangeUser(user); _logger.Info($"BLL.{nameof(UserBll)}.{nameof(SetUser)}: User id = {id} changed"); return(id); } else { int id = _userDao.AddUser(user); _logger.Info($"BLL.{nameof(UserBll)}.{nameof(SetUser)}: User id = {id} added"); return(id); } }