-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #185 from Avanade/feature/updateTargetFramework
Feature/update target framework
- Loading branch information
Showing
12 changed files
with
58 additions
and
30 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
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
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
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
39 changes: 39 additions & 0 deletions
39
src/Liquid.Adapter.Dataverse/Extensions/DependencyInjection/IServiceCollectionExtensions.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 |
---|---|---|
@@ -0,0 +1,39 @@ | ||
using Microsoft.Extensions.Configuration; | ||
using Microsoft.Extensions.DependencyInjection; | ||
using Microsoft.Xrm.Sdk; | ||
using System.Diagnostics.CodeAnalysis; | ||
|
||
namespace Liquid.Adapter.Dataverse.Extensions.DependencyInjection | ||
{ | ||
/// <summary> | ||
/// Extension methods of <see cref="IServiceCollection"/> | ||
/// </summary> | ||
[ExcludeFromCodeCoverage] | ||
public static class IServiceCollectionExtensions | ||
{ | ||
/// <summary> | ||
/// Registers <see cref="DataverseAdapter"/> service, it's dependency | ||
/// <see cref="DataverseClientFactory"/>, and also set configuration | ||
/// option <see cref="DataverseSettings"/>. | ||
/// Also register <see cref="DataverseEntityMapper"/> service. | ||
/// </summary> | ||
/// <param name="services"></param> | ||
/// <param name="dataverseSection">configuration section of dataverse settings.</param> | ||
public static IServiceCollection AddLiquidDataverseAdapter(this IServiceCollection services, string dataverseSection) | ||
{ | ||
services.AddOptions<DataverseSettings>() | ||
.Configure<IConfiguration>((settings, configuration) => | ||
{ | ||
configuration.GetSection(dataverseSection).Bind(settings); | ||
}); | ||
|
||
services.AddTransient<IDataverseClientFactory, DataverseClientFactory>(); | ||
|
||
services.AddSingleton<ILiquidDataverseAdapter, DataverseAdapter>(); | ||
|
||
services.AddSingleton<ILiquidMapper<string, Entity>, DataverseEntityMapper>(); | ||
|
||
return services; | ||
} | ||
} | ||
} |
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
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
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
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
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
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
1 change: 0 additions & 1 deletion
1
test/Liquid.Adapter.Dataverse.Tests/DataverseClientFactoryTests.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