Table of Contents

Class CodeAction

Namespace
adas_core.Domain.Models
Assembly
adas-core.Domain.dll

Represents a code action that encapsulates an operation or transformation to be performed on code.

public class CodeAction
Inheritance
CodeAction
Inherited Members
Extension Methods

Properties

Action

public ActionsEnum.ResourceAction Action { get; set; }

Property Value

ActionsEnum.ResourceAction

Code

public required Code Code { get; set; }

Property Value

Code

Methods

Apply(List<CodeAction>)

Applies a list of CodeAction items and returns the resulting Code list, using the default (null) context by delegating to the contextual overload.

public static List<Code>? Apply(List<CodeAction> actions)

Parameters

actions List<CodeAction>

The list of code actions to apply.

Returns

List<Code>

A List<T> with the applied changes, or null if no codes are produced.

Apply(List<Code>?, List<CodeAction>?)

Applies a list of code actions to the source list, handling addition, deletion, and update operations while avoiding duplicates. Returns null if the resulting source list is empty.

public static List<Code>? Apply(List<Code>? source, List<CodeAction>? actions)

Parameters

source List<Code>

The list of codes to modify. If null, an empty list is used as the starting point.

actions List<CodeAction>

The list of code actions to apply. If null, the source list is returned unchanged.

Returns

List<Code>

The modified list of codes, or null if the list is empty after applying the actions.