aboutsummaryrefslogtreecommitdiff
path: root/src/Web/DevHive.Web/Configurations/Extensions/ConfigureAutoMapper.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Web/DevHive.Web/Configurations/Extensions/ConfigureAutoMapper.cs')
-rw-r--r--src/Web/DevHive.Web/Configurations/Extensions/ConfigureAutoMapper.cs24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/Web/DevHive.Web/Configurations/Extensions/ConfigureAutoMapper.cs b/src/Web/DevHive.Web/Configurations/Extensions/ConfigureAutoMapper.cs
new file mode 100644
index 0000000..8b7d657
--- /dev/null
+++ b/src/Web/DevHive.Web/Configurations/Extensions/ConfigureAutoMapper.cs
@@ -0,0 +1,24 @@
+using System;
+using AutoMapper;
+//using AutoMapper.Configuration;
+using Microsoft.AspNetCore.Builder;
+using Microsoft.Extensions.DependencyInjection;
+
+namespace DevHive.Web.Configurations.Extensions
+{
+ public static class ConfigureAutoMapper
+ {
+ public static void AutoMapperConfiguration(this IServiceCollection services)
+ {
+ services.AddAutoMapper(AppDomain.CurrentDomain.GetAssemblies());
+ }
+
+ public static void UseAutoMapperConfiguration(this IApplicationBuilder app)
+ {
+ var config = new MapperConfiguration(cfg =>
+ {
+ cfg.AllowNullCollections = true;
+ });
+ }
+ }
+} \ No newline at end of file