Skip to content

Commit

Permalink
#1351 Corrected the Id to match RavenDb
Browse files Browse the repository at this point in the history
  • Loading branch information
bolsson committed Oct 4, 2023
1 parent ddad445 commit 883f4da
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions Assessments.Transformation/PublishDynamicProperties.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ public async Task ImportRedlist2021()
var AlienSpeciesAssessments = await _dataRepository.GetSpeciesAssessments();

var alienSpeciesAssessmentsTransformed = AlienSpeciesAssessments.Select(x => new DynamicProperty
{
Id = x.Id.ToString(),
{
Id = "DynamicProperty/Rodliste2021-" + x.Id.ToString(),
References = new[] { "ScientificNames/" + x.ScientificNameId.ToString() },
Properties = new[]
{
Expand Down Expand Up @@ -107,7 +107,7 @@ public async Task ImportAlienList2023()

var alienSpeciesAssessmentsTransformed = AlienSpeciesAssessments.Select(x => new DynamicProperty
{
Id = x.Id.ToString(),
Id = "DynamicProperty/FremmedArt2023-" + x.Id.ToString(),
References = new[] { "ScientificNames/" + x.ScientificName.ScientificNameId.ToString() },
Properties = new[]
{
Expand Down Expand Up @@ -153,6 +153,16 @@ private static IDocumentStore CreateStore()
}
}

private static void SaveBatch(List<DynamicProperty> batch, IDocumentStore documentStore)
{
using var session = documentStore.OpenSession();
foreach (var dynamicProperty in batch)
{
session.Store(dynamicProperty);
}
session.SaveChanges();
}


}

0 comments on commit 883f4da

Please sign in to comment.