コード例 #1
0
        /// <summary>
        /// Creates an instance of IImunizationFhirDelegate via configuration.
        /// </summary>
        /// <returns>The IImunizationFhirDelegate.</returns>
        public IImmunizationFhirDelegate CreateInstance()
        {
            string typeStr = this.configuration.GetValue <string>("ImmunizationDelegate", DefaultInstance);
            Type?  type    = Type.GetType(typeStr);
            IImmunizationFhirDelegate instance = (IImmunizationFhirDelegate)ActivatorUtilities.CreateInstance(this.serviceProvider, type);

            return(instance);
        }
コード例 #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ImmunizationService"/> class.
 /// </summary>
 /// <param name="logger">Injected Logger Provider.</param>
 /// <param name="httpAccessor">The injected http context accessor provider.</param>
 /// <param name="immunizationDelegateFactory">The factory to create immunization delegates.</param>
 /// <param name="patientDelegate">The injected patient delegate.</param>
 public ImmunizationService(
     ILogger <ImmunizationService> logger,
     IHttpContextAccessor httpAccessor,
     IImmunizationDelegateFactory immunizationDelegateFactory,
     IPatientDelegate patientDelegate)
 {
     this.logger = logger;
     this.httpContextAccessor  = httpAccessor;
     this.immunizationDelegate = immunizationDelegateFactory.CreateInstance();
     this.patientDelegate      = patientDelegate;
 }