Skip to content

Add T IQueryAccessor.GetRequired<T>(string key) #163

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jaredcnance opened this issue Sep 22, 2017 · 0 comments
Closed

Add T IQueryAccessor.GetRequired<T>(string key) #163

jaredcnance opened this issue Sep 22, 2017 · 0 comments

Comments

@jaredcnance
Copy link
Contributor

jaredcnance commented Sep 22, 2017

public T GetRequired<T>(string key)
{
  if (TryGetValue<T>(key, out T result) == false)
    throw new JsonApiException(422, $"'{key}' is not a valid '{typeof(T)}' value for query parameter {key}");

  return result;
}
jaredcnance added a commit that referenced this issue Sep 23, 2017
feat(QueryAccessor): addGetRequired<T>(string)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

1 participant