-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🔀 chore: upgrade Microsoft.Graph to v5 (#178)
* chore: update dependencies * version
- Loading branch information
1 parent
a2a2761
commit d9e2ac9
Showing
6 changed files
with
243 additions
and
229 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
75 changes: 37 additions & 38 deletions
75
src/FluentEmail.Graph/FluentEmailServicesBuilderExtensions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,43 @@ | ||
namespace FluentEmail.Graph | ||
{ | ||
using FluentEmail.Core.Interfaces; | ||
using Microsoft.Extensions.DependencyInjection; | ||
using Microsoft.Extensions.DependencyInjection.Extensions; | ||
using Microsoft.Graph; | ||
namespace FluentEmail.Graph; | ||
|
||
using FluentEmail.Core.Interfaces; | ||
using Microsoft.Extensions.DependencyInjection; | ||
using Microsoft.Extensions.DependencyInjection.Extensions; | ||
using Microsoft.Graph; | ||
|
||
/// <summary> | ||
/// Contains extension methods to register the <see cref="GraphSender"/> with the <c>FluentEmailServicesBuilder</c> from <c>FluentEmail.Core</c>. | ||
/// </summary> | ||
public static class FluentEmailServicesBuilderExtensions | ||
/// <summary> | ||
/// Contains extension methods to register the <see cref="GraphSender"/> with the <c>FluentEmailServicesBuilder</c> from <c>FluentEmail.Core</c>. | ||
/// </summary> | ||
public static class FluentEmailServicesBuilderExtensions | ||
{ | ||
public static FluentEmailServicesBuilder AddGraphSender( | ||
this FluentEmailServicesBuilder builder, | ||
GraphSenderOptions options) | ||
{ | ||
public static FluentEmailServicesBuilder AddGraphSender( | ||
this FluentEmailServicesBuilder builder, | ||
GraphSenderOptions options) | ||
{ | ||
builder.Services.TryAdd(ServiceDescriptor.Scoped<ISender>(_ => new GraphSender(options))); | ||
return builder; | ||
} | ||
builder.Services.TryAdd(ServiceDescriptor.Scoped<ISender>(_ => new GraphSender(options))); | ||
return builder; | ||
} | ||
|
||
public static FluentEmailServicesBuilder AddGraphSender( | ||
this FluentEmailServicesBuilder builder, | ||
string graphEmailClientId, | ||
string graphEmailTenantId, | ||
string graphEmailSecret) | ||
public static FluentEmailServicesBuilder AddGraphSender( | ||
this FluentEmailServicesBuilder builder, | ||
string graphEmailClientId, | ||
string graphEmailTenantId, | ||
string graphEmailSecret) | ||
{ | ||
var options = new GraphSenderOptions | ||
{ | ||
var options = new GraphSenderOptions | ||
{ | ||
ClientId = graphEmailClientId, | ||
TenantId = graphEmailTenantId, | ||
Secret = graphEmailSecret, | ||
}; | ||
return builder.AddGraphSender(options); | ||
} | ||
ClientId = graphEmailClientId, | ||
TenantId = graphEmailTenantId, | ||
Secret = graphEmailSecret, | ||
}; | ||
return builder.AddGraphSender(options); | ||
} | ||
|
||
public static FluentEmailServicesBuilder AddGraphSender( | ||
this FluentEmailServicesBuilder builder, | ||
GraphServiceClient graphClient) | ||
{ | ||
builder.Services.TryAdd(ServiceDescriptor.Scoped<ISender>(_ => new GraphSender(graphClient))); | ||
return builder; | ||
} | ||
public static FluentEmailServicesBuilder AddGraphSender( | ||
this FluentEmailServicesBuilder builder, | ||
GraphServiceClient graphClient) | ||
{ | ||
builder.Services.TryAdd(ServiceDescriptor.Scoped<ISender>(_ => new GraphSender(graphClient))); | ||
return builder; | ||
} | ||
} | ||
} |
Oops, something went wrong.