Skip to content

Commit

Permalink
🔀 chore: upgrade Microsoft.Graph to v5 (#178)
Browse files Browse the repository at this point in the history
* chore: update dependencies

* version
  • Loading branch information
DavidDeSloovere authored Apr 7, 2023
1 parent a2a2761 commit d9e2ac9
Show file tree
Hide file tree
Showing 6 changed files with 243 additions and 229 deletions.
18 changes: 10 additions & 8 deletions src/FluentEmail.Graph/FluentEmail.Graph.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,11 @@
<Version>0.0.1</Version>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<MinVerVerbosity>detailed</MinVerVerbosity>
<MinVerMinimumMajorMinor>2.3</MinVerMinimumMajorMinor>
<PackageReleaseNotes>v2.2 Added support for Headers
v2.1 Added support for Inline images</PackageReleaseNotes>
<MinVerMinimumMajorMinor>2.4</MinVerMinimumMajorMinor>
<PackageReleaseNotes>v2.4 Updated Microsoft.Graph to v5
v2.2 Added support for Headers
v2.1 Added support for Inline images
</PackageReleaseNotes>
</PropertyGroup>

<ItemGroup>
Expand All @@ -38,16 +40,16 @@ v2.1 Added support for Inline images</PackageReleaseNotes>
</ItemGroup>

<ItemGroup>
<PackageReference Include="Azure.Identity" Version="1.6.1" />
<PackageReference Include="Azure.Identity" Version="1.8.2"/>
<PackageReference Include="DotNet.ReproducibleBuilds" Version="1.1.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="FluentEmail.Core" Version="3.0.2" />
<PackageReference Include="FluentEmail.Core" Version="3.0.2"/>
<PackageReference Include="JetBrains.Annotations" Version="2022.3.1">
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.Graph" Version="4.39.0" />
<PackageReference Include="Microsoft.Graph" Version="5.3.0"/>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
Expand Down
75 changes: 37 additions & 38 deletions src/FluentEmail.Graph/FluentEmailServicesBuilderExtensions.cs
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;
}
}
}
Loading

0 comments on commit d9e2ac9

Please sign in to comment.