예제 #1
0
 public async Task <InvokeResult <DataStream> > LoadFullDataStreamConfigurationAsync(String id)
 {
     try
     {
         return(InvokeResult <DataStream> .Create(await _dataStreamRepo.GetDataStreamAsync(id)));
     }
     catch (RecordNotFoundException)
     {
         return(InvokeResult <DataStream> .FromErrors(ErrorCodes.CouldNotLoadDataStreamModule.ToErrorMessage($"ModuleId={id}")));
     }
 }
예제 #2
0
        public async Task <InvokeResult <DataStream> > LoadFullDataStreamConfigurationAsync(String id, EntityHeader org, EntityHeader user)
        {
            try
            {
                var stream = await _dataStreamRepo.GetDataStreamAsync(id);
                await AuthorizeAsync(stream, AuthorizeResult.AuthorizeActions.Read, user, org, "LoadWithSecrets");

                if (!EntityHeader.IsNullOrEmpty(stream.SharedConnection))
                {
                    return(await PopulateSharedConnectionAsync(stream, org, user));
                }
                else
                {
                    return(await PopulateCredentialsAsync(stream, org, user));
                }
            }
            catch (RecordNotFoundException)
            {
                return(InvokeResult <DataStream> .FromErrors(ErrorCodes.CouldNotLoadDataStreamModule.ToErrorMessage($"ModuleId={id}")));
            }
        }