Skip to content

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

Closed
@jaredcnance

Description

@jaredcnance
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;
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions