public OicHostDevice(OicConfiguration configuration, IServiceProvider services) { _configuration = configuration; _services = services; _resources.Add("/oic/res", _resourceDirectory); _discoverableOicResources.Add(OicResourceLink.FromResource(new OicResourceDirectory())); }
public ResourceRepositoryMiddleware(RequestDelegate next, IServiceProvider services, IOptions <ResourceRepositoryOptions> options) { _next = next; _options = options.Value; _oicConfiguration = services.GetRequiredService <OicConfiguration>(); _resourceRepository = _options.ResourceRepository ?? (_options.ResourceRepositoryType != null ? (IOicResourceRepository)ActivatorUtilities.CreateInstance(services, _options.ResourceRepositoryType, _options.ResourceRepositoryArgs) : ActivatorUtilities.CreateInstance <DefaultResourceRepository>(services)); }
public MyResources(OicConfiguration configuration) { _configuration = configuration; _helloResource = new OicBaseResouece <string> { Interfaces = OicResourceInterface.Baseline | OicResourceInterface.ReadOnly, ResourceTypes = { "oicnet.hello" }, RelativeUri = "/hello", Value = "Hello World" }; }
public void CreateOicConfiguration() { _configuration = new OicConfiguration(new TestResourceResolver()); }