public Uri GetLocator( [Parent] Data.GetHttpsResource getHttpsResource, [Service] AppSettings appSettings ) { return(new Uri($"{appSettings.Host}/api/resources/{getHttpsResource.Id}")); }
protected GetHttpsResourcePayload( Data.GetHttpsResource getHttpsResource, IReadOnlyCollection <TGetHttpsResourceError> errors ) { GetHttpsResource = getHttpsResource; Errors = errors; }
public Task <Data.GetHttpsResource[]> GetChildren( [Parent] Data.GetHttpsResource getHttpsResource, GetHttpsResourceChildrenByGetHttpsResourceIdDataLoader byId, CancellationToken cancellationToken ) { return(byId.LoadAsync(getHttpsResource.Id, cancellationToken) !); }
protected GetHttpsResourcePayload( Data.GetHttpsResource getHttpsResource, TGetHttpsResourceError error ) : this( getHttpsResource, new[] { error } ) { }
public async Task <Data.GetHttpsResource?> GetParent( [Parent] Data.GetHttpsResource getHttpsResource, GetHttpsResourceByIdDataLoader byId, CancellationToken cancellationToken ) { // TODO Why is `?? Guid.Empty` below necessary although `getHttpsResource.ParentId` is not null? return(getHttpsResource.ParentId is null ? null : await byId.LoadAsync(getHttpsResource.ParentId ?? Guid.Empty, cancellationToken) !); }
public async Task <Data.IData?> GetData( [Parent] Data.GetHttpsResource getHttpsResource, CalorimetricDataByIdDataLoader calorimetricDataById, HygrothermalDataByIdDataLoader hygrothermalDataById, OpticalDataByIdDataLoader opticalDataById, PhotovoltaicDataByIdDataLoader photovoltaicDataById, CancellationToken cancellationToken ) { if (getHttpsResource.CalorimetricDataId is not null) { return(await calorimetricDataById.LoadAsync( getHttpsResource.CalorimetricDataId ?? throw new Exception("Impossible!"), cancellationToken ).ConfigureAwait(false)); } if (getHttpsResource.HygrothermalDataId is not null) { return(await hygrothermalDataById.LoadAsync( getHttpsResource.HygrothermalDataId ?? throw new Exception("Impossible!"), cancellationToken ).ConfigureAwait(false)); } if (getHttpsResource.OpticalDataId is not null) { return(await opticalDataById.LoadAsync( getHttpsResource.OpticalDataId ?? throw new Exception("Impossible!"), cancellationToken ).ConfigureAwait(false)); } if (getHttpsResource.PhotovoltaicDataId is not null) { return(await photovoltaicDataById.LoadAsync( getHttpsResource.PhotovoltaicDataId ?? throw new Exception("Impossible!"), cancellationToken ).ConfigureAwait(false)); } return(null); }
protected GetHttpsResourcePayload( Data.GetHttpsResource getHttpsResource ) { GetHttpsResource = getHttpsResource; }
public CreateGetHttpsResourcePayload( Data.GetHttpsResource getHttpsResource ) : base(getHttpsResource) { }