private static AuthenticateParameter GetAuthenticateParameter(DocumentManagementApiOptions options)
 {
     return(new AuthenticateParameter
     {
         ClientId = options.OAuth.ClientId,
         ClientSecret = options.OAuth.ClientSecret,
         WellKnownConfigurationUrl = options.OAuth.WellKnownConfiguration
     });
 }
 public OfficeDocumentsController(IOfficeDocumentActions officeDocumentActions, DocumentManagementApiOptions options)
 {
     _officeDocumentActions = officeDocumentActions;
     _options = options;
 }
Ejemplo n.º 3
0
        public static IServiceCollection AddDocumentManagementHost(this IServiceCollection services, DocumentManagementApiOptions options)
        {
            if (services == null)
            {
                throw new ArgumentNullException(nameof(services));
            }

            if (options == null)
            {
                throw new ArgumentNullException(nameof(options));
            }


            var loader  = new LicenseLoader();
            var license = loader.TryGetLicense();

            if (license.ExpirationDateTime < DateTime.UtcNow)
            {
                throw new LicenseExpiredException();
            }

            services.AddSingleton(options);
            services.AddDocumentManagementCore();
            return(services);
        }