public VmTicketHistoryRepository( IRepository <VmTicketHistory> repository, AppVersionContext context, IApiIdentity apiIdentity) : base(context, apiIdentity) { _repository = repository; _context = context; }
public UserClaimRepository( IRepository <UserClaim> repository, UserContext context, IApiIdentity apiIdentity) : base(context, apiIdentity) { _repository = repository; _context = context; }
public UserRoleRepository( IRepository <UserRole> repository, UserContext context, IUserClaimRepository userClaimRepository, IApiIdentity apiIdentity) : base(context, apiIdentity) { _repository = repository; //_context = context; _userClaimRepository = userClaimRepository; }
public ServiceSlaRepository( IRepository <ServiceSla> repository, ReportContext context, ICacheProvider cacheProvider, IApiIdentity apiIdentity) : base(context, apiIdentity) { _repository = repository; _context = context; _cacheProvider = cacheProvider; }
public void VisitApiIdentity(IApiIdentity apiIdentity, int depth) { Contract.Requires(apiIdentity != null); this.AddIndentToString(depth); var description = apiIdentity.ToString(); this.AddDescriptionToString(description); }
public CustomerRepository ( CustomersDbContext context, ICacheProvider cacheProvider, IApiIdentity apiIdentity ) { Context = context; this._cacheProvider = cacheProvider; _apiIdentity = apiIdentity; }
public DbUserService( UserContext context, IApiIdentity apiIdentity, ICacheProvider cacheProvider, IUserRoleRepository userRoleRepository ) { _context = context ?? throw new ArgumentNullException(nameof(context)); _apiIdentity = apiIdentity; _cacheProvider = cacheProvider; _userRoleRepository = userRoleRepository; }
public RestUserService( IHttpClientFactory httpClientFactory, IApiIdentity apiIdentity, ITokenAcquisition tokenAcquisition, IMapper mapper, IConfiguration configuration) : base(httpClientFactory, tokenAcquisition, apiIdentity, mapper, configuration) { ApiPart = "api/userclaim/"; Scope = Configuration.GetValue <string>(Core.ConstatCsro.Scopes.Scope_Auth_Api); ClientName = Core.ConstatCsro.EndPoints.ApiEndpointAuth; base.Init(); }
public ServiceOutageSummaryRepository( IRepository <ServiceOutageSummary> repository, IServiceSlaService serviceSlaService, IRefundSupportTicketRepository refundSupportTicketRepository, ReportContext context, ILogger <ServiceOutageSummaryRepository> logger, IApiIdentity apiIdentity) : base(context, apiIdentity) { _repository = repository; _serviceSlaService = serviceSlaService; _refundSupportTicketRepository = refundSupportTicketRepository; _context = context; _logger = logger; }
public SubcriptionService( IHttpClientFactory httpClientFactory, //IAuthCsroService authCsroService, ITokenAcquisition tokenAcquisition, IMapper mapper, IApiIdentity apiIdentity, IConfiguration configuration) : base(httpClientFactory, tokenAcquisition, apiIdentity, mapper, configuration) { ApiPart = "--"; Scope = Core.ConstatCsro.Scopes.MANAGEMENT_AZURE_SCOPE; ClientName = Core.ConstatCsro.ClientNames.MANAGEMENT_AZURE_EndPoint; base.Init(); }
public ApproveRejectAdoProjectAccessIdsCommandHandler ( IProjectAdoServices projectAdoServices, IAdoProjectAccessRepository adoProjectAccessRepository, IMapper mapper, IApiIdentity apiIdentity, ILogger <ApproveRejectAdoProjectAccessIdsCommandHandler> logger ) { _projectAdoServices = projectAdoServices; _adoProjectAccessRepository = adoProjectAccessRepository; _mapper = mapper; _userId = apiIdentity.GetUserName(); _logger = logger; //com 5 06 }
public BaseDataService( IHttpClientFactory httpClientFactory, ITokenAcquisition tokenAcquisition, IApiIdentity apiIdentity, IMapper mapper, IConfiguration configuration, bool useSpn = false) { HttpClientFactory = httpClientFactory; _tokenAcquisition = tokenAcquisition; ApiIdentity = apiIdentity; Mapper = mapper; Configuration = configuration; UseSpn = useSpn; }
public SupportAzureService( ILogger <SupportAzureService> logger, IHttpClientFactory httpClientFactory, ITokenAcquisition tokenAcquisition, IMapper mapper, IApiIdentity apiIdentity, IConfiguration configuration) : base(httpClientFactory, tokenAcquisition, apiIdentity, mapper, configuration) { _logger = logger; UseUrlNotApiPart = true; Scope = Core.ConstatCsro.Scopes.MANAGEMENT_AZURE_SCOPE; ClientName = Core.ConstatCsro.ClientNames.MANAGEMENT_AZURE_EndPoint; base.Init(); }
public ServiceIssueRepository( IRepository <ServiceIssue> repository, ReportContext context, IMapper mapper, ISubscriptionRepository subscriptionRepository, IAzureHealthService azureHealthService, ICacheProvider cacheProvider, IApiIdentity apiIdentity) : base(context, apiIdentity) { _repository = repository; _context = context; _mapper = mapper; _subscriptionRepository = subscriptionRepository; _azureHealthService = azureHealthService; _cacheProvider = cacheProvider; //_userId = ApiIdentity.GetUserName(); }
public VmOperationExecuteCommandHandler( IConfiguration configuration, IApiIdentity apiIdentity, IVmSdkService vmSdkService, IMessageBus messageBus, IVmTicketRepository repository, IVmTicketHistoryRepository vmTicketHistoryRepository, ILogger <VmOperationExecuteCommandHandler> logger) { _userId = apiIdentity.GetUserName(); _vmSdkService = vmSdkService; _messageBus = messageBus; _repository = repository; _vmTicketHistoryRepository = vmTicketHistoryRepository; _logger = logger; _serviceBusConfig = configuration.GetSection(nameof(ServiceBusConfig)).Get <ServiceBusConfig>(); }
public VmTicketRepository( IAzureVmManagementService azureVmManagementService, IRepository <VmTicket> repository, AppVersionContext context, IVmSdkService vmSdkService, IConfiguration configuration, IApiIdentity apiIdentity) : base(context, apiIdentity) { _azureVmManagementService = azureVmManagementService; _repository = repository; _context = context; _vmSdkService = vmSdkService; _configuration = configuration; _userId = ApiIdentity.GetUserName(); VmRebootDelay = configuration.GetValue <int>("VmRebootDelay"); }
public RefundSupportTicketRepository( IRepository <RefundSupportTicket> repository, ReportContext context, IMapper mapper, ISupportAzureService supportAzureService, ISubscriptionRepository subscriptionRepository, ICacheProvider cacheProvider, ILogger <RefundSupportTicketRepository> logger, IApiIdentity apiIdentity) : base(context, apiIdentity) { _repository = repository; _context = context; _mapper = mapper; _supportAzureService = supportAzureService; _subscriptionRepository = subscriptionRepository; _cacheProvider = cacheProvider; _logger = logger; }
public ServiceOutageSummaryService( IServiceSlaService serviceSlaService, IServiceOutageRepository serviceOutageRepository, IRefundSupportTicketRepository refundSupportTicketRepository, ISupportedRegionsService supportedRegionsService, IServiceOutageSummaryRepository serviceOutageSummaryRepository, IAzureHealthService azureHealthService, IAzureHealthSPNService azureHealthSPNService, IApiIdentity apiIdentity ) { _serviceSlaService = serviceSlaService; _serviceOutageRepository = serviceOutageRepository; _refundSupportTicketRepository = refundSupportTicketRepository; _supportedRegionsService = supportedRegionsService; _serviceOutageSummaryRepository = serviceOutageSummaryRepository; _azureHealthService = azureHealthService; _azureHealthSPNService = azureHealthSPNService; }
public AdoProjectAccessRepository( IConfiguration configuration, IRepository <AdoProjectAccess> repository, AdoContext context, //IAdoProjectHistoryRepository adoProjectHistoryRepository, IMapper mapper, ILogger <AdoProjectAccessRepository> logger, IMessageBus messageBus, IApiIdentity apiIdentity) : base(context, apiIdentity) { _repository = repository; _context = context; //_adoProjectHistoryRepository = adoProjectHistoryRepository; _mapper = mapper; _logger = logger; _messageBus = messageBus; _userId = ApiIdentity.GetUserName(); _serviceBusConfig = configuration.GetSection(nameof(ServiceBusConfig)).Get <ServiceBusConfig>(); }
public AzureHealthSPNService( IServiceProvider serviceProvider, IHttpClientFactory httpClientFactory, ISubscriptionRepository subscriptionRepository, ILogger <AzureHealthSPNService> logger, ITokenAcquisition tokenAcquisition, ISupportedRegionsService supportedRegionsService, IMapper mapper, IApiIdentity apiIdentity, IConfiguration configuration) : base(serviceProvider, httpClientFactory, subscriptionRepository, logger, tokenAcquisition, supportedRegionsService, mapper, apiIdentity, configuration) { UseSpn = true; UseUrlNotApiPart = true; Scope = Core.ConstatCsro.Scopes.MANAGEMENT_AZURE_SCOPE; ClientName = Core.ConstatCsro.ClientNames.MANAGEMENT_AZURE_EndPoint; base.Init(); }
public static ApiObjectType CreateApiObjectType(string apiName, string apiDescription, IEnumerable <IApiProperty> apiProperties, IApiIdentity apiIdentity, IEnumerable <IApiRelationship> apiRelationships, Type clrType) { Contract.Requires(apiName.SafeHasContent()); Contract.Requires(clrType != null); var apiPropertiesCollection = apiProperties.SafeToReadOnlyCollection(); var apiRelationshipsCollection = apiRelationships.SafeToReadOnlyCollection(); var apiObjectType = new ApiObjectType(apiName, apiDescription, apiPropertiesCollection, apiIdentity, apiRelationshipsCollection, clrType); return(apiObjectType); }
// PUBLIC CONSTRUCTORS ////////////////////////////////////////////// #region Constructors public ApiObjectType(string apiName, string apiDescription, IEnumerable <IApiProperty> apiProperties, IApiIdentity apiIdentity, IEnumerable <IApiRelationship> apiRelationships, Type clrObjectType) : base(apiName, apiDescription, clrObjectType) { Contract.Requires(apiName.SafeHasContent()); Contract.Requires(clrObjectType != null); this.ApiProperties = apiProperties.SafeToReadOnlyCollection(); this.ApiIdentity = apiIdentity; this.ApiRelationships = apiRelationships.SafeToReadOnlyCollection(); this.ApiPropertyByApiNameDictionary = this.ApiProperties.ToDictionary(x => x.ApiName); this.ApiPropertyByClrNameDictionary = this.ApiProperties.ToDictionary(x => x.ClrName); this.ApiRelationshipByApiNameDictionary = this.ApiRelationships.ToDictionary(x => x.ApiProperty.ApiName); this.ApiRelationshipByClrNameDictionary = this.ApiRelationships.ToDictionary(x => x.ApiProperty.ClrName); }
public ReportRepository(ReportContext context, IApiIdentity apiIdentity) : base(context, apiIdentity) { }
public Repository(DbContext context, IApiIdentity apiIdentity) { DatabaseContext = context; ApiIdentity = apiIdentity; }
public TicketRepository(IRepository <Ticket> repository, AppVersionContext context, IApiIdentity apiIdentity) : base(context, apiIdentity) { _repository = repository; _context = context; }
public UserRepository(UserContext context, IApiIdentity apiIdentity) : base(context, apiIdentity) { }
public AppRepository(AppVersionContext context, IApiIdentity apiIdentity) : base(context, apiIdentity) { }
// ReSharper disable once ReturnTypeCanBeEnumerable.Local private static IReadOnlyCollection <IApiRelationship> CreateApiRelationships(ApiMutableObjectType apiMutableObjectType, ApiSchemaProxy apiSchemaProxy, IEnumerable <IApiProperty> apiProperties, IApiIdentity apiIdentity) { Contract.Requires(apiMutableObjectType != null); Contract.Requires(apiSchemaProxy != null); Contract.Requires(apiProperties != null); // If this API object type has no identity, it may not contain any relationships. if (apiIdentity == null) { return(null); } var apiMutableSchema = apiMutableObjectType.ApiMutableSchema; var clrRelationshipPropertyCollection = apiMutableObjectType.ClrRelationshipPropertyCollection; var apiRelationships = clrRelationshipPropertyCollection .Where(x => { // Can not create an API relationship if the related API object type does not have identity (must be an API resource type). var clrPropertyType = x.ClrPropertyType; var apiPropertyTypeKind = clrPropertyType.GetApiTypeKind(out var clrPropertyItemType); switch (apiPropertyTypeKind) { case ApiTypeKind.Object: { var isApiResourceType = apiMutableSchema.ClrResourceTypes.Contains(clrPropertyType); if (!isApiResourceType) { return(false); } break; } case ApiTypeKind.Collection: { var apiItemTypeKind = clrPropertyItemType.GetApiTypeKind(); switch (apiItemTypeKind) { case ApiTypeKind.Collection: { // Unable to handle collections within collections. var message = $"Unable to create API relationship for an API property [{nameof(x.ClrPropertyName)}={x.ClrPropertyName}] that contains collections within collections"; throw new ApiSchemaException(message); } } var isApiResourceType = apiMutableSchema.ClrResourceTypes.Contains(clrPropertyItemType); if (!isApiResourceType) { return(false); } break; } default: { return(false); } } return(true); }) .Select(x => { var clrPropertyName = x.ClrPropertyName; var clrPropertyType = x.ClrPropertyType; var apiProperty = apiProperties.Single(y => y.ClrName == clrPropertyName); var apiPropertyTypeKind = clrPropertyType.GetApiTypeKind(out var clrPropertyItemType); ApiRelationshipCardinality apiCardinality; Type clrType; switch (apiPropertyTypeKind) { case ApiTypeKind.Object: { apiCardinality = ApiRelationshipCardinality.ToOne; clrType = clrPropertyType; break; } case ApiTypeKind.Collection: { apiCardinality = ApiRelationshipCardinality.ToMany; clrType = clrPropertyItemType; break; } default: { throw new ArgumentOutOfRangeException(); } } var apiRelatedTypeResolver = new ApiSchemaProxyTypeResolver(apiSchemaProxy, ApiTypeKind.Object, clrType); var apiRelationship = ApiTypeFactory.CreateApiRelationship(apiProperty, apiCardinality, apiRelatedTypeResolver); return(apiRelationship); }) .ToList(); foreach (var apiRelationship in apiRelationships) { ApiFrameworkLog.Debug($"Created {apiRelationship}".Indent(IndentConstants.ApiMutableObjectTypeRelationship)); } return(apiRelationships); }
public GenericDataService(IHttpClientFactory httpClientFactory, ITokenAcquisition tokenAcquisition, IApiIdentity apiIdentity, IMapper mapper, IConfiguration configuration, bool useSpn = false) : base(httpClientFactory, tokenAcquisition, apiIdentity, mapper, configuration, useSpn) { }
public AdoRepository(AdoContext context, IApiIdentity apiIdentity) : base(context, apiIdentity) { }