Skip to content

Commit

Permalink
Merge branch 'release/1.0.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian Bumann committed Aug 30, 2021
2 parents 043a72e + f9aead0 commit fb1dc25
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/BBT.StructureTools.Tests/BBT.StructureTools.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@

<ItemGroup>
<PackageReference Include="BBT.StrategyPattern" Version="1.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.9.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.11.0" />
<PackageReference Include="Moq" Version="4.16.1" />
<PackageReference Include="Ninject" Version="3.3.4" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="FluentAssertions" Version="5.10.3">
<PackageReference Include="FluentAssertions" Version="6.1.0">
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="3.3.2">
Expand Down
20 changes: 18 additions & 2 deletions src/BBT.StructureTools.Tests/Convert/TestData/TargetBaseLeaf.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,25 @@ namespace BBT.StructureTools.Tests.Convert.TestData
/// </summary>
public class TargetBaseLeaf
{
private TargetRoot root;

/// <summary>
/// Gets or sets TargetRoot.
/// Gets or sets Root.
/// </summary>
public TargetRoot TargetRoot { get; set; }
public TargetRoot TargetRoot
{
get
{
return this.root;
}
set
{
this.root = value;
if (value != null)
{
value.TargetLeafs.Add(this);
}
}
}
}
}
18 changes: 17 additions & 1 deletion src/BBT.StructureTools.Tests/Convert/TestData/TargetTreeLeaf.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
/// </summary>
public class TargetTreeLeaf
{
private TargetTree targetTree;

/// <summary>
/// Gets the Id.
/// </summary>
Expand All @@ -16,7 +18,21 @@ public class TargetTreeLeaf
/// <summary>
/// Gets or sets TargetTree.
/// </summary>
public TargetTree TargetTree { get; set; }
public TargetTree TargetTree
{
get
{
return this.targetTree;
}
set
{
this.targetTree = value;
if (value != null)
{
value.TargetLeafs.Add(this);
}
}
}

/// <summary>
/// Gets or sets OriginLeaf.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ public OperationConditionalCreateToManyWithReverseRelation(
public void Execute(TSource source, TTarget target, ICollection<IBaseAdditionalProcessing> additionalProcessings)
{
var sourceChildren = this.source.Invoke(source);
var childTargets = new List<TBaseTarget>();
foreach (var sourceChildElement in sourceChildren)
{
var instanceCreationStrategy = this.createInstanceStrategyProvider.GetStrategy(sourceChildElement);
Expand All @@ -53,10 +54,12 @@ public void Execute(TSource source, TTarget target, ICollection<IBaseAdditionalP

// set reverse relation
childTarget.SetPropertyValue(this.reverseRelationOnTarget, target);

// Add to target collection
this.targetParentExpression.Compile().Invoke(target).Add(childTarget);
childTargets.Add(childTarget);
}

target.AddRangeFilterNullValues(
this.targetParentExpression,
childTargets);
}

/// <inheritdoc/>
Expand Down

0 comments on commit fb1dc25

Please sign in to comment.