public bool Register(User user) { try { if (user == null) { throw new NullReferenceException(); } if (user.Avatar == "/Content/img/Avatars/no_avatar") { user.Avatar = "~/Content/img/Avatars/avatar.jpg"; } DataAccessLayer.User userForDatabase = userMapper.MapToDatabaseType(user); usersRepository.Register(userForDatabase); log.Info("User successfully registered"); } catch (Exception e) { log.Error(e.Message); return(false); } return(true); }