[Canonical page](<https://docs.dhtmlx.com/planning-engine/net/api/core/resources/load-profile-options/>)
[Full documentation index](<https://docs.dhtmlx.com/planning-engine/llms.txt>)


# LoadProfileOptions

Options for [`Project.LoadProfile`](<https://docs.dhtmlx.com/planning-engine/net/api/project-load-profile.md>): a [`ProfileQuery`](<https://docs.dhtmlx.com/planning-engine/net/api/core/resources/profile-query.md>) that sets what the profile covers, plus the baseline the call expects. Build one with `new LoadProfileOptions(query)`, or pass a `ProfileQuery` directly, since it converts implicitly.

## Declaration

```csharp
public sealed class LoadProfileOptions : IDeepCloneable<LoadProfileOptions>
{
    public LoadProfileOptions(ProfileQuery query);

    public required ProfileQuery Query { get; set; }
    public string? BaselineId { get; set; }

    public static implicit operator LoadProfileOptions(ProfileQuery query);

    public LoadProfileOptions DeepClone();
}
```

`LoadProfileOptions` doesn't implement `IEquatable<T>`, so two instances compare by reference.

## Constructors

### LoadProfileOptions(ProfileQuery)

```csharp
public LoadProfileOptions(ProfileQuery query)
```

Wraps `query` with no baseline check (`BaselineId` is `null`). The instance keeps a reference to `query` and doesn't copy it.

**Parameters**

| Name | Type | Description |
|---|---|---|
| `query` | [`ProfileQuery`](<https://docs.dhtmlx.com/planning-engine/net/api/core/resources/profile-query.md>) | Range, resources, basis and task lists of the profile. |

## Properties

| Property | Type | Default | Description |
|---|---|---|---|
| `Query` | [`ProfileQuery`](<https://docs.dhtmlx.com/planning-engine/net/api/core/resources/profile-query.md>) | required | What the profile covers: range, resources, basis and which buckets list their tasks. |
| `BaselineId` | `string?` | `null` | The baseline the call expects. `null` skips the check. |

### Query

```csharp
public required ProfileQuery Query { get; set; }
```

The range, resources, basis and task lists of the returned [`LoadProfile`](<https://docs.dhtmlx.com/planning-engine/net/api/core/resources/load-profile.md>). See [`ProfileQuery`](<https://docs.dhtmlx.com/planning-engine/net/api/core/resources/profile-query.md>) for each field and its default.

### BaselineId

```csharp
public string? BaselineId { get; set; }
```

A baseline token taken from the latest [`ScheduleResult.BaselineId`](<https://docs.dhtmlx.com/planning-engine/net/api/core/results/schedule-result.md>). When it isn't `null` and doesn't name the project's current baseline, [`Project.LoadProfile`](<https://docs.dhtmlx.com/planning-engine/net/api/project-load-profile.md>) throws a [`ProjectException`](<https://docs.dhtmlx.com/planning-engine/net/api/core/errors/project-exception.md>) with `Code == ProjectError.StaleBaseline`.

## Operators

### Implicit conversion from ProfileQuery

```csharp
public static implicit operator LoadProfileOptions(ProfileQuery query)
```

Same as `new LoadProfileOptions(query)`: the query with no baseline check. This lets `project.LoadProfile(query)` take a [`ProfileQuery`](<https://docs.dhtmlx.com/planning-engine/net/api/core/resources/profile-query.md>) directly.

## Methods

### DeepClone

```csharp
public LoadProfileOptions DeepClone()
```

Returns a copy whose `Query` is a deep copy too, so the two instances share no list.

## Example

```csharp
using Plen;

static Moment Day(int day) =>
    Moment.FromYmdHm(2026, 1, day, 0, 0) ?? throw new InvalidOperationException("invalid date");

var data = new ProjectData
{
    Tasks = [new TaskData("a") { StartDate = Day(1), Duration = 2.0 }],
    Resources = [new ResourceData { Id = "dev" }],
    Assignments = [new AssignmentData { Task = "a", Resource = "dev", Value = 1.0 }],
};

var project = new Project();
var solved = project.Solve(data, new SolveOptions());

var options = new LoadProfileOptions(new ProfileQuery(Day(1), Day(5)) { Tasks = ProfileTasks.All })
{
    BaselineId = solved.BaselineId,
};
var profile = project.LoadProfile(options);
```

## Related

- [`Project.LoadProfile`](<https://docs.dhtmlx.com/planning-engine/net/api/project-load-profile.md>) - the call these options configure
- [`ProfileQuery`](<https://docs.dhtmlx.com/planning-engine/net/api/core/resources/profile-query.md>) - range, resources, basis and task lists of the profile
- [`LoadProfile`](<https://docs.dhtmlx.com/planning-engine/net/api/core/resources/load-profile.md>) - the returned profile
- [Resource load](<https://docs.dhtmlx.com/planning-engine/net/resources-and-assignment/resource-load.md#pinning-the-profile-to-a-baseline>) - querying profiles and pinning them to a baseline
