DrSensor / DrSensor/BatchDI

Add PartialInject for auto call all member methods in class

Open
#11 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
6
Forks
1
PR merge metrics
No merged PRs in 30d

Description

Usage (this for my personal usage to separate GraphQL schema into multiple file)

```c#
// src/Controllers/AnnotationQuery.cs
partial class Query
{
void AnnotationQuery(AnnotationService service)
{
...
}
}

// src/Schema.cs
using BatchDI.PartialDI;
partial class Query : ObjectGraph, PartialDI
{
void Query(BrokerService brokerService, AnnotationService annotationService)
{
PartialInject(); // by defaults filters: $"*{this.GetType().Name}"
PartialInject(filters: new ["*Query"]);
PartialInject(blacklist: new ["Helper1Query", "Helper2Query"]);

// by argument type
PartialInjectService(); // auto call AnnotationQuery(annotationService)
PartialInjectService(annotationService);
PartialInjectService();
}
}
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.