1
1
using System . Reflection ;
2
2
using FluentValidation ;
3
- using MediatR ;
4
- using Microsoft . EntityFrameworkCore ;
3
+ using Hangfire ;
4
+ using Hangfire . PostgreSql ;
5
5
using Microsoft . Extensions . Configuration ;
6
6
using Microsoft . Extensions . DependencyInjection ;
7
- using Microsoft . Extensions . Logging ;
8
- using skit . Core . Addresses . Repositories ;
9
- using skit . Core . Common . Services ;
10
- using skit . Core . Companies . Repositories ;
11
- using skit . Core . Identity . Services ;
12
7
using skit . Infrastructure . Common ;
13
- using skit . Infrastructure . Common . Services ;
14
8
using skit . Infrastructure . DAL ;
15
- using skit . Infrastructure . DAL . Companies ;
16
- using skit . Infrastructure . DAL . Companies . Repositories ;
17
- using skit . Infrastructure . DAL . EF . Context ;
18
- using skit . Infrastructure . DAL . Identity . Services ;
19
9
using skit . Infrastructure . Integrations ;
20
- using skit . Infrastructure . Integrations . Emails . Configuration ;
21
10
22
11
namespace skit . Infrastructure ;
23
12
@@ -27,6 +16,12 @@ public static IServiceCollection AddInfrastructure(this IServiceCollection servi
27
16
{
28
17
services . AddMediatR ( cfg=> cfg . RegisterServicesFromAssemblies ( Assembly . GetExecutingAssembly ( ) ) ) ;
29
18
services . AddValidatorsFromAssembly ( Assembly . GetExecutingAssembly ( ) ) ;
19
+ services . AddHangfire ( config => config
20
+ . SetDataCompatibilityLevel ( CompatibilityLevel . Version_180 )
21
+ . UseSimpleAssemblyNameTypeSerializer ( )
22
+ . UseRecommendedSerializerSettings ( )
23
+ . UsePostgreSqlStorage ( configuration . GetConnectionString ( "DatabaseConnection" ) ) ) ;
24
+ services . AddHangfireServer ( ) ;
30
25
31
26
services . AddCommonInfrastructure ( ) ;
32
27
services . AddDal ( configuration ) ;
0 commit comments