1- namespace FluentEmail . Graph
2- {
3- using FluentEmail . Core . Interfaces ;
4- using Microsoft . Extensions . DependencyInjection ;
5- using Microsoft . Extensions . DependencyInjection . Extensions ;
6- using Microsoft . Graph ;
1+ namespace FluentEmail . Graph ;
2+
3+ using FluentEmail . Core . Interfaces ;
4+ using Microsoft . Extensions . DependencyInjection ;
5+ using Microsoft . Extensions . DependencyInjection . Extensions ;
6+ using Microsoft . Graph ;
77
8- /// <summary>
9- /// Contains extension methods to register the <see cref="GraphSender"/> with the <c>FluentEmailServicesBuilder</c> from <c>FluentEmail.Core</c>.
10- /// </summary>
11- public static class FluentEmailServicesBuilderExtensions
8+ /// <summary>
9+ /// Contains extension methods to register the <see cref="GraphSender"/> with the <c>FluentEmailServicesBuilder</c> from <c>FluentEmail.Core</c>.
10+ /// </summary>
11+ public static class FluentEmailServicesBuilderExtensions
12+ {
13+ public static FluentEmailServicesBuilder AddGraphSender (
14+ this FluentEmailServicesBuilder builder ,
15+ GraphSenderOptions options )
1216 {
13- public static FluentEmailServicesBuilder AddGraphSender (
14- this FluentEmailServicesBuilder builder ,
15- GraphSenderOptions options )
16- {
17- builder . Services . TryAdd ( ServiceDescriptor . Scoped < ISender > ( _ => new GraphSender ( options ) ) ) ;
18- return builder ;
19- }
17+ builder . Services . TryAdd ( ServiceDescriptor . Scoped < ISender > ( _ => new GraphSender ( options ) ) ) ;
18+ return builder ;
19+ }
2020
21- public static FluentEmailServicesBuilder AddGraphSender (
22- this FluentEmailServicesBuilder builder ,
23- string graphEmailClientId ,
24- string graphEmailTenantId ,
25- string graphEmailSecret )
21+ public static FluentEmailServicesBuilder AddGraphSender (
22+ this FluentEmailServicesBuilder builder ,
23+ string graphEmailClientId ,
24+ string graphEmailTenantId ,
25+ string graphEmailSecret )
26+ {
27+ var options = new GraphSenderOptions
2628 {
27- var options = new GraphSenderOptions
28- {
29- ClientId = graphEmailClientId ,
30- TenantId = graphEmailTenantId ,
31- Secret = graphEmailSecret ,
32- } ;
33- return builder . AddGraphSender ( options ) ;
34- }
29+ ClientId = graphEmailClientId ,
30+ TenantId = graphEmailTenantId ,
31+ Secret = graphEmailSecret ,
32+ } ;
33+ return builder . AddGraphSender ( options ) ;
34+ }
3535
36- public static FluentEmailServicesBuilder AddGraphSender (
37- this FluentEmailServicesBuilder builder ,
38- GraphServiceClient graphClient )
39- {
40- builder . Services . TryAdd ( ServiceDescriptor . Scoped < ISender > ( _ => new GraphSender ( graphClient ) ) ) ;
41- return builder ;
42- }
36+ public static FluentEmailServicesBuilder AddGraphSender (
37+ this FluentEmailServicesBuilder builder ,
38+ GraphServiceClient graphClient )
39+ {
40+ builder . Services . TryAdd ( ServiceDescriptor . Scoped < ISender > ( _ => new GraphSender ( graphClient ) ) ) ;
41+ return builder ;
4342 }
44- }
43+ }
0 commit comments