public TResponse Login <TRequest, TResponse>(TRequest request) where TRequest : IJokJaBreIdentityRequest where TResponse : IJokJaBreIdentityResponse { var model = request.ToIdentityModel <TRequest, TIdentityModel>(m_configuration); var user = m_repository.Get(model); if (user == null) { throw ApiExceptions.NotFound("Username, email or password are not correct"); } return(user.ToIdentityResponse <TResponse>(m_configuration)); }