32 lines
640 B
C#
32 lines
640 B
C#
using BS.Shared.Interface.Feature.AICore;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace BS.Shared.Extensions
|
|
{
|
|
public static class AiPromptbausteinRoutineExtensions
|
|
{
|
|
public static bool CanExecuteRoutine(this IAiPromptbausteinRoutine routine)
|
|
{
|
|
if (routine?.Steps is null || !routine.Steps.Any())
|
|
return false;
|
|
|
|
foreach (var step in routine.Steps)
|
|
{
|
|
// Delete
|
|
if (step.Reference is null)
|
|
return false;
|
|
|
|
// Update
|
|
if (step.Reference.Version != step.ReferenceVersion)
|
|
return false;
|
|
}
|
|
|
|
return true;
|
|
}
|
|
}
|
|
}
|