Skip to content

Commit

Permalink
Tweaks after final review of PR code.
Browse files Browse the repository at this point in the history
  • Loading branch information
gmcelhanon committed Nov 25, 2024
1 parent 9de26d2 commit 2b248f4
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 9 deletions.
5 changes: 0 additions & 5 deletions Application/EdFi.Ods.Api/Startup/OdsStartupBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
using EdFi.Ods.Common.Models;
using EdFi.Ods.Common.Models.Resource;
using EdFi.Ods.Common.Profiles;
using EdFi.Ods.Common.Repositories;
using EdFi.Ods.Common.Security.Claims;
using log4net;
using Microsoft.AspNetCore.Authentication;
Expand Down Expand Up @@ -443,10 +442,6 @@ void SetStaticResolvers()
GeneratedArtifactStaticDependencies.Resolvers.Set(() => Container.Resolve<IContextProvider<DataPolicyException>>());
GeneratedArtifactStaticDependencies.Resolvers.Set(() => Container.Resolve<ISessionFactoryImplementor>());

GeneratedArtifactStaticDependencies.Resolvers.SetEnabledFeatures(
apiSettings.IsFeatureEnabled(ApiFeature.SerializedData.GetConfigKeyName()),
apiSettings.IsFeatureEnabled(ApiFeature.ResourceLinks.GetConfigKeyName()));

// netcore has removed the claims principal from the thread, to be on the controller.
// as a workaround for our current application we can resolve the IHttpContextAccessor.
// c.f. https://docs.microsoft.com/en-us/aspnet/core/migration/claimsprincipal-current?view=aspnetcore-3.1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@

namespace EdFi.Ods.Common.Repositories;

/// <summary>
/// Implements a contextual object for tracking the "ReferenceData" entities that need to have the key values
/// resolved to the associated entity's Id and Discriminator values for generating resource reference links.
/// </summary>
public class ReferenceDataLookupContext
{
private readonly Lazy<ISet<IEntityReferenceData>> _values = new(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ public override void ApplyConfigurationSpecificRegistrations(ContainerBuilder bu
GeneratedArtifactStaticDependencies.Resolvers.Set(container.Resolve<IContextProvider<ReferenceDataLookupContext>>);
});

// NOTE: To the extent feasible, all reference data resolution logic related to serialized data scenarios have been
// implemented using SOLID principles -- as separate components that modify system behavior through extension
// rather than modification.

builder.RegisterDecorator(
typeof(ReferenceDataUpsertPipelineStepsProviderDecorator),
typeof(IUpsertPipelineStepsProvider));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,4 @@ public Type[] GetSteps()
typeof(InitializeReferenceDataLookupContext<,,,>))
.ToArray();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,4 @@ public async Task<TEntity> GetByIdAsync(Guid id, CancellationToken cancellationT

return result;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ public async Task ResolveReferenceDataAsync()
using var scope = new SessionScope(_sessionFactory);
var conn = scope.Session.Connection;


StringBuilder sb = new StringBuilder();
DynamicParameters parameters = null;
int statementIndex = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -359,4 +359,4 @@
{{/HasSerializedReferenceDataMappings}}
}

{{/DelegatedProperty}}
{{/DelegatedProperty}}

0 comments on commit 2b248f4

Please sign in to comment.