示例#1
0
        public static async Task <Guid?> CreateRunAsync(
            EventEntity eventEntity,
            CasterApiClient casterApiClient,
            bool isDestroy,
            ILogger logger,
            CancellationToken ct)
        {
            var runCommand = new CreateRunCommand()
            {
                WorkspaceId = eventEntity.WorkspaceId.Value,
                IsDestroy   = isDestroy
            };

            try
            {
                var casterRun = await casterApiClient.CreateRunAsync(runCommand, ct);

                return(casterRun.Id);
            }
            catch (Exception ex)
            {
                logger.LogError(ex, "Error Creating Run");
                return(null);
            }
        }
示例#2
0
        public static async Task <Guid?> CreateRunAsync(
            ImplementationEntity implementationEntity,
            CasterApiClient casterApiClient,
            bool isDestroy,
            CancellationToken ct)
        {
            var runCommand = new CreateRunCommand()
            {
                WorkspaceId = implementationEntity.WorkspaceId,
                IsDestroy   = isDestroy
            };

            try
            {
                var casterRun = await casterApiClient.CreateRunAsync(runCommand, ct);

                return(casterRun.Id);
            }
            catch (Exception ex)
            {
                return(null);
            }
        }