/// <summary> /// Gets the terminal resource for a given type or null if there is no such resource /// </summary> public ITerminalResource <T> SafeGetTerminalResource <T>() where T : Terminal => ResourceByType.SafeGet(typeof(T)) as ITerminalResource <T>;
/// <summary> /// Gets the terminal resource for a given type, and throws an UnknownResource exception /// if there is no such resource /// </summary> public ITerminalResource <T> GetTerminalResource <T>() where T : Terminal => ResourceByType.SafeGet(typeof(T)) as ITerminalResource <T> ?? throw new UnknownResource(typeof(T).GetRESTableTypeName());
/// <summary> /// Gets the terminal resource for a given type or null if there is no such resource /// </summary> public IResource <T> SafeGetResource <T>() where T : class => ResourceByType.SafeGet(typeof(T)) as IResource <T>;
/// <summary> /// Gets the terminal resource for a given type, and throws an UnknownResource exception /// if there is no such resource /// </summary> public IResource <T> GetResource <T>() where T : class => ResourceByType.SafeGet(typeof(T)) as IResource <T> ?? throw new UnknownResource(typeof(T).GetRESTableTypeName());
/// <summary> /// Gets the resource for a given type or returns null if there is no such resource /// </summary> public IResource SafeGetResource(Type type) => ResourceByType.SafeGet(type);
/// Gets the resource for a given type, or throws an UnknownResource exception if there is no such resource /// </summary> public IResource GetResource(Type type) => ResourceByType.SafeGet(type) ?? throw new UnknownResource(type.GetRESTableTypeName());