Website Summary Files Commits Branches @commit @diff @stats
path: root / src / DevHive.Web / Configurations / Extensions / ConfigureDependencyInjection.cs
diff options
context:
space:
mode:
Commitb38d6693476917972345397298b534af2b8b8f78 (patch)
Author
 transtrike <transtrike@gmail.com>
2021-01-29 20:39:07 +0200
Committer
 transtrike <transtrike@gmail.com>
2021-01-29 20:39:07 +0200
Files5e62376cf693a7233cec4ab341f658be5d9c4ec2 /src/DevHive.Web/Configurations/Extensions/ConfigureDependencyInjection.cs
DevHive-b38d6693476917972345397298b534af2b8b8f78.tar
DevHive-b38d6693476917972345397298b534af2b8b8f78.tar.gz
DevHive-b38d6693476917972345397298b534af2b8b8f78.zip
Parent2417df3ff2939b67695b80905f301ef53c905260 (diff)
File Upload implemented; Post Layers adapted to File Uploading
1 files changed, 7 insertions, 1 deletions
-rw-r--r--src/DevHive.Web/Configurations/Extensions/ConfigureDependencyInjection.cs8
diff --git a/src/DevHive.Web/Configurations/Extensions/ConfigureDependencyInjection.cs b/src/DevHive.Web/Configurations/Extensions/ConfigureDependencyInjection.cs
index d7c859e..fe2c788 100644
--- a/src/DevHive.Web/Configurations/Extensions/ConfigureDependencyInjection.cs
+++ b/src/DevHive.Web/Configurations/Extensions/ConfigureDependencyInjection.cs
@@ -3,13 +3,14 @@ using DevHive.Data.Models;
using DevHive.Data.Repositories;
using DevHive.Services.Interfaces;
using DevHive.Services.Services;
+using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
namespace DevHive.Web.Configurations.Extensions
{
public static class ConfigureDependencyInjection
{
- public static void DependencyInjectionConfiguration(this IServiceCollection services)
+ public static void DependencyInjectionConfiguration(this IServiceCollection services, IConfiguration configuration)
{
services.AddTransient<ILanguageRepository, LanguageRepository>();
services.AddTransient<IRoleRepository, RoleRepository>();
@@ -25,6 +26,11 @@ namespace DevHive.Web.Configurations.Extensions
services.AddTransient<IUserService, UserService>();
services.AddTransient<IPostService, PostService>();
services.AddTransient<IFeedService, FeedService>();
+ services.AddTransient<ICloudService, CloudinaryService>(options =>
+ new CloudinaryService(
+ cloudName: configuration.GetSection("Cloud").GetSection("cloudName").Value,
+ apiKey: configuration.GetSection("Cloud").GetSection("apiKey").Value,
+ apiSecret: configuration.GetSection("Cloud").GetSection("apiSecret").Value));
}
}
}