Skip to content

Commit

Permalink
Fix issue with resource reference types
Browse files Browse the repository at this point in the history
  • Loading branch information
ciprianjichici committed Sep 18, 2024
1 parent ce1c92e commit 0bcaa4b
Show file tree
Hide file tree
Showing 11 changed files with 650 additions and 298 deletions.
2 changes: 1 addition & 1 deletion src/dotnet/AIModel/Models/AIModelReference.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class AIModelReference : ResourceReference
/// The object type of the data source.
/// </summary>
[JsonIgnore]
public Type AIModelType =>
public override Type ResourceType =>
Type switch
{
AIModelTypes.Basic => typeof(AIModelBase),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ private async Task<ResourceProviderUpsertResult> UpdateAIModel(ResourcePath reso

aiModel.ObjectId = resourcePath.GetObjectId(_instanceSettings.Id, _name);

var validator = _resourceValidatorFactory.GetValidator(aiModelReference.AIModelType);
var validator = _resourceValidatorFactory.GetValidator(aiModelReference.ResourceType);
if (validator is IValidator aiModelValidator)
{
var context = new ValidationContext<object>(aiModel);
Expand Down
2 changes: 1 addition & 1 deletion src/dotnet/Agent/Models/Resources/AgentReference.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class AgentReference : ResourceReference
/// The object type of the agent.
/// </summary>
[JsonIgnore]
public Type AgentType =>
public override Type ResourceType =>
Type switch
{
AgentTypes.Basic => typeof(AgentBase),
Expand Down
31 changes: 0 additions & 31 deletions src/dotnet/Agent/Models/Resources/AgentReferenceStore.cs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ private async Task<ResourceProviderUpsertResult> UpdateAgent(ResourcePath resour
StatusCodes.Status500InternalServerError);
}

var validator = _resourceValidatorFactory.GetValidator(agentReference.AgentType);
var validator = _resourceValidatorFactory.GetValidator(agentReference.ResourceType);
if (validator is IValidator agentValidator)
{
var context = new ValidationContext<object>(agent);
Expand Down
2 changes: 1 addition & 1 deletion src/dotnet/DataSource/Models/DataSourceReference.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class DataSourceReference : ResourceReference
/// The object type of the data source.
/// </summary>
[JsonIgnore]
public Type DataSourceType =>
public override Type ResourceType =>
Type switch
{
DataSourceTypes.Basic => typeof(DataSourceBase),
Expand Down
35 changes: 0 additions & 35 deletions src/dotnet/DataSource/Models/DataSourceReferenceStore.cs

This file was deleted.

Loading

0 comments on commit 0bcaa4b

Please sign in to comment.