Files
agent-framework/dotnet/src/Microsoft.Agents.AI.Workflows/Execution/StateUpdate.cs
T
Ben ThomasandGitHub 647db9635a .NET: Rename workflows projects (#975)
* Renaming Microsoft.Agent.Workflows to Microsoft.Agents.AI.Workflows

* Removing local settings.

* Removing remining old files from merge.
2025-09-29 18:30:45 +00:00

28 lines
726 B
C#

// Copyright (c) Microsoft. All rights reserved.
using Microsoft.Shared.Diagnostics;
namespace Microsoft.Agents.AI.Workflows.Execution;
internal sealed class StateUpdate
{
public string Key { get; }
public object? Value { get; }
public bool IsDelete { get; }
private StateUpdate(string key, object? value, bool isDelete = false)
{
this.Key = Throw.IfNullOrEmpty(key);
this.Value = value;
this.IsDelete = isDelete;
}
public static StateUpdate Update<T>(string key, T? value) => new(key, value, value is null);
public static StateUpdate Delete(string key)
{
Throw.IfNullOrEmpty(key);
return new StateUpdate(key, null, isDelete: true);
}
}