Skip to content

Commit

Permalink
Fixed generator issue that affected group and cache DataLoader (#7384)
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelstaib authored Aug 20, 2024
1 parent eb153c2 commit 9ff9a52
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,9 @@ public void WriteBeginDataLoaderClass(
name);
_writer.IncreaseIndent();
_writer.WriteIndentedLine(
": global::GreenDonut.DataLoaderBase<{0}, {1}>",
kind is DataLoaderKind.Group
? ": global::GreenDonut.DataLoaderBase<{0}, {1}[]>"
: ": global::GreenDonut.DataLoaderBase<{0}, {1}>",
key.ToFullyQualified(),
value.ToFullyQualified());
_writer.WriteIndentedLine(", {0}", interfaceName);
Expand Down Expand Up @@ -137,7 +139,7 @@ public void WriteDataLoaderConstructor(
{
_writer.WriteIndentedLine("global::System.IServiceProvider services,");
_writer.WriteIndentedLine("global::GreenDonut.DataLoaderOptions options)");
_writer.WriteIndentedLine(": base(options)");
_writer.WriteIndentedLine(": base(AutoBatchScheduler.Default, options)");
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ namespace TestNamespace
public EntityByIdDataLoader(
global::System.IServiceProvider services,
global::GreenDonut.DataLoaderOptions options)
: base(options)
: base(AutoBatchScheduler.Default, options)
{
_services = services ??
throw new global::System.ArgumentNullException(nameof(services));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ namespace TestNamespace
}

public sealed class EntitiesByIdDataLoader
: global::GreenDonut.DataLoaderBase<int, Entity>
: global::GreenDonut.DataLoaderBase<int, Entity[]>
, IEntitiesByIdDataLoader
{
private readonly global::System.IServiceProvider _services;
Expand Down

0 comments on commit 9ff9a52

Please sign in to comment.