From 2db796f3dc19c20a0f8eb630aaf5f7597ebb3032 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karol=20G=C3=B3rzy=C5=84ski?= Date: Sat, 5 Dec 2020 21:58:45 +0100 Subject: [PATCH] Add services and configruations for them --- .../Services/AlignmentService.cs | 18 +++++++++++ .../Services/BackgroundServices.cs | 18 +++++++++++ .../Services/BiographyService.cs | 20 ++++++++++++ .../Services/CharacterService.cs | 25 +++++++++++++++ .../Services/CharismaService.cs | 18 +++++++++++ .../Services/ClassService.cs | 20 ++++++++++++ .../Services/ConstitutionService.cs | 18 +++++++++++ .../Services/DexterityService.cs | 18 +++++++++++ .../Services/IntelligenceService.cs | 18 +++++++++++ .../Services/RaceService.cs | 18 +++++++++++ .../Services/StatisticsService.cs | 21 ++++++++++++ .../Services/StrengthService.cs | 18 +++++++++++ .../Services/UserService.cs | 21 ++++++++++++ .../Services/WisdomService.cs | 18 +++++++++++ .../SessionCompanion.Services.csproj | 9 ++++++ .../Configurations/ServiceConfiguration.cs | 32 +++++++++++++++++++ .../SessionCompanion/SessionCompanion.csproj | 1 + SessionCompanion/SessionCompanion/Startup.cs | 1 + 18 files changed, 312 insertions(+) create mode 100644 SessionCompanion/SessionCompanion.Services/Services/AlignmentService.cs create mode 100644 SessionCompanion/SessionCompanion.Services/Services/BackgroundServices.cs create mode 100644 SessionCompanion/SessionCompanion.Services/Services/BiographyService.cs create mode 100644 SessionCompanion/SessionCompanion.Services/Services/CharacterService.cs create mode 100644 SessionCompanion/SessionCompanion.Services/Services/CharismaService.cs create mode 100644 SessionCompanion/SessionCompanion.Services/Services/ClassService.cs create mode 100644 SessionCompanion/SessionCompanion.Services/Services/ConstitutionService.cs create mode 100644 SessionCompanion/SessionCompanion.Services/Services/DexterityService.cs create mode 100644 SessionCompanion/SessionCompanion.Services/Services/IntelligenceService.cs create mode 100644 SessionCompanion/SessionCompanion.Services/Services/RaceService.cs create mode 100644 SessionCompanion/SessionCompanion.Services/Services/StatisticsService.cs create mode 100644 SessionCompanion/SessionCompanion.Services/Services/StrengthService.cs create mode 100644 SessionCompanion/SessionCompanion.Services/Services/UserService.cs create mode 100644 SessionCompanion/SessionCompanion.Services/Services/WisdomService.cs create mode 100644 SessionCompanion/SessionCompanion/Configurations/ServiceConfiguration.cs diff --git a/SessionCompanion/SessionCompanion.Services/Services/AlignmentService.cs b/SessionCompanion/SessionCompanion.Services/Services/AlignmentService.cs new file mode 100644 index 0000000..a96c0f6 --- /dev/null +++ b/SessionCompanion/SessionCompanion.Services/Services/AlignmentService.cs @@ -0,0 +1,18 @@ +using SessionCompanion.Database.Tables; +using SessionCompanion.Services.Base; +using SessionCompanion.Services.Interfaces; +using SessionCompanion.ViewModels.AlignmentViewModels; +using AutoMapper; +using System; +using System.Collections.Generic; +using System.Text; +using SessionCompanion.Database.Repositories.Base; + +namespace SessionCompanion.Services.Services +{ + public class AlignmentService : ServiceBase, IAlignmentService + { + public AlignmentService(IMapper mapper, IRepository repository) : base(mapper, repository) + { } + } +} diff --git a/SessionCompanion/SessionCompanion.Services/Services/BackgroundServices.cs b/SessionCompanion/SessionCompanion.Services/Services/BackgroundServices.cs new file mode 100644 index 0000000..995fc8a --- /dev/null +++ b/SessionCompanion/SessionCompanion.Services/Services/BackgroundServices.cs @@ -0,0 +1,18 @@ +using AutoMapper; +using SessionCompanion.Database.Repositories.Base; +using SessionCompanion.Database.Tables; +using SessionCompanion.Services.Base; +using SessionCompanion.Services.Interfaces; +using SessionCompanion.ViewModels.BackgroundViewModels; +using System; +using System.Collections.Generic; +using System.Text; + +namespace SessionCompanion.Services.Services +{ + public class BackgroundServices : ServiceBase, IBackgroundService + { + public BackgroundServices(IMapper mapper, IRepository repository) : base(mapper, repository) + { } + } +} diff --git a/SessionCompanion/SessionCompanion.Services/Services/BiographyService.cs b/SessionCompanion/SessionCompanion.Services/Services/BiographyService.cs new file mode 100644 index 0000000..51e1759 --- /dev/null +++ b/SessionCompanion/SessionCompanion.Services/Services/BiographyService.cs @@ -0,0 +1,20 @@ +using AutoMapper; +using SessionCompanion.Database.Repositories.Base; +using SessionCompanion.Database.Tables; +using SessionCompanion.Services.Base; +using SessionCompanion.Services.Interfaces; +using SessionCompanion.ViewModels.BiographyViewModels; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Microsoft.EntityFrameworkCore; +namespace SessionCompanion.Services.Services +{ + public class BiographyService : ServiceBase, IBiographyService + { + public BiographyService(IMapper mapper, IRepository repository) : base(mapper, repository) + { } + } +} diff --git a/SessionCompanion/SessionCompanion.Services/Services/CharacterService.cs b/SessionCompanion/SessionCompanion.Services/Services/CharacterService.cs new file mode 100644 index 0000000..939ea90 --- /dev/null +++ b/SessionCompanion/SessionCompanion.Services/Services/CharacterService.cs @@ -0,0 +1,25 @@ +using AutoMapper; +using SessionCompanion.Database.Repositories.Base; +using SessionCompanion.Database.Tables; +using SessionCompanion.Services.Base; +using SessionCompanion.Services.Interfaces; +using SessionCompanion.ViewModels.CharacterViewModels; +using System; +using System.Collections.Generic; +using System.Text; +using System.Threading.Tasks; +using System.Linq; +using Microsoft.EntityFrameworkCore.Internal; +using Microsoft.EntityFrameworkCore; +using AutoMapper.QueryableExtensions; +using System.IO; +using Newtonsoft.Json.Linq; + +namespace SessionCompanion.Services.Services +{ + public class CharacterService : ServiceBase, ICharacterService + { + public CharacterService(IMapper mapper, IRepository repository) : base(mapper, repository) + { } + } +} diff --git a/SessionCompanion/SessionCompanion.Services/Services/CharismaService.cs b/SessionCompanion/SessionCompanion.Services/Services/CharismaService.cs new file mode 100644 index 0000000..b8c3be0 --- /dev/null +++ b/SessionCompanion/SessionCompanion.Services/Services/CharismaService.cs @@ -0,0 +1,18 @@ +using AutoMapper; +using SessionCompanion.Database.Repositories.Base; +using SessionCompanion.Database.Tables; +using SessionCompanion.Services.Base; +using SessionCompanion.Services.Interfaces; +using SessionCompanion.ViewModels.CharismaViewModels; +using System; +using System.Collections.Generic; +using System.Text; + +namespace SessionCompanion.Services.Services +{ + public class CharismaService : ServiceBase, ICharismaService + { + public CharismaService(IMapper mapper, IRepository repository) : base(mapper, repository) + { } + } +} diff --git a/SessionCompanion/SessionCompanion.Services/Services/ClassService.cs b/SessionCompanion/SessionCompanion.Services/Services/ClassService.cs new file mode 100644 index 0000000..abc7b36 --- /dev/null +++ b/SessionCompanion/SessionCompanion.Services/Services/ClassService.cs @@ -0,0 +1,20 @@ +using AutoMapper; +using SessionCompanion.Database.Repositories.Base; +using SessionCompanion.Database.Tables; +using SessionCompanion.Services.Base; +using SessionCompanion.Services.Interfaces; +using SessionCompanion.ViewModels.ClassViewModels; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace SessionCompanion.Services.Services +{ + public class ClassService : ServiceBase, IClassService + { + public ClassService(IMapper mapper, IRepository repository) : base(mapper, repository) + { } + } +} diff --git a/SessionCompanion/SessionCompanion.Services/Services/ConstitutionService.cs b/SessionCompanion/SessionCompanion.Services/Services/ConstitutionService.cs new file mode 100644 index 0000000..a87bd19 --- /dev/null +++ b/SessionCompanion/SessionCompanion.Services/Services/ConstitutionService.cs @@ -0,0 +1,18 @@ +using AutoMapper; +using SessionCompanion.Database.Repositories.Base; +using SessionCompanion.Database.Tables; +using SessionCompanion.Services.Base; +using SessionCompanion.Services.Interfaces; +using SessionCompanion.ViewModels.ConstitutionViewModels; +using System; +using System.Collections.Generic; +using System.Text; + +namespace SessionCompanion.Services.Services +{ + public class ConstitutionService : ServiceBase, IConstitutionService + { + public ConstitutionService(IMapper mapper, IRepository repository) : base(mapper, repository) + { } + } +} diff --git a/SessionCompanion/SessionCompanion.Services/Services/DexterityService.cs b/SessionCompanion/SessionCompanion.Services/Services/DexterityService.cs new file mode 100644 index 0000000..7396e06 --- /dev/null +++ b/SessionCompanion/SessionCompanion.Services/Services/DexterityService.cs @@ -0,0 +1,18 @@ +using AutoMapper; +using SessionCompanion.Database.Repositories.Base; +using SessionCompanion.Database.Tables; +using SessionCompanion.Services.Base; +using SessionCompanion.Services.Interfaces; +using SessionCompanion.ViewModels.DexterityViewModels; +using System; +using System.Collections.Generic; +using System.Text; + +namespace SessionCompanion.Services.Services +{ + public class DexterityService : ServiceBase, IDexterityService + { + public DexterityService(IMapper mapper, IRepository repository) : base(mapper, repository) + { } + } +} diff --git a/SessionCompanion/SessionCompanion.Services/Services/IntelligenceService.cs b/SessionCompanion/SessionCompanion.Services/Services/IntelligenceService.cs new file mode 100644 index 0000000..149ed61 --- /dev/null +++ b/SessionCompanion/SessionCompanion.Services/Services/IntelligenceService.cs @@ -0,0 +1,18 @@ +using AutoMapper; +using SessionCompanion.Database.Repositories.Base; +using SessionCompanion.Database.Tables; +using SessionCompanion.Services.Base; +using SessionCompanion.Services.Interfaces; +using SessionCompanion.ViewModels.IntelligenceViewModels; +using System; +using System.Collections.Generic; +using System.Text; + +namespace SessionCompanion.Services.Services +{ + public class IntelligenceService : ServiceBase, IIntelligenceService + { + public IntelligenceService(IMapper mapper, IRepository repository) : base(mapper, repository) + { } + } +} diff --git a/SessionCompanion/SessionCompanion.Services/Services/RaceService.cs b/SessionCompanion/SessionCompanion.Services/Services/RaceService.cs new file mode 100644 index 0000000..3b40869 --- /dev/null +++ b/SessionCompanion/SessionCompanion.Services/Services/RaceService.cs @@ -0,0 +1,18 @@ +using AutoMapper; +using SessionCompanion.Database.Repositories.Base; +using SessionCompanion.Database.Tables; +using SessionCompanion.Services.Base; +using SessionCompanion.Services.Interfaces; +using SessionCompanion.ViewModels.RaceViewModels; +using System; +using System.Collections.Generic; +using System.Text; + +namespace SessionCompanion.Services.Services +{ + public class RaceService : ServiceBase, IRaceService + { + public RaceService(IMapper mapper, IRepository repository) : base(mapper, repository) + { } + } +} diff --git a/SessionCompanion/SessionCompanion.Services/Services/StatisticsService.cs b/SessionCompanion/SessionCompanion.Services/Services/StatisticsService.cs new file mode 100644 index 0000000..42935e5 --- /dev/null +++ b/SessionCompanion/SessionCompanion.Services/Services/StatisticsService.cs @@ -0,0 +1,21 @@ +using AutoMapper; +using Microsoft.EntityFrameworkCore; +using SessionCompanion.Database.Repositories.Base; +using SessionCompanion.Database.Tables; +using SessionCompanion.Services.Base; +using SessionCompanion.Services.Interfaces; +using SessionCompanion.ViewModels.StatisticsViewModels; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace SessionCompanion.Services.Services +{ + public class StatisticsService : ServiceBase, IStatisticsService + { + public StatisticsService(IMapper mapper, IRepository repository) : base(mapper, repository) + { } + } +} diff --git a/SessionCompanion/SessionCompanion.Services/Services/StrengthService.cs b/SessionCompanion/SessionCompanion.Services/Services/StrengthService.cs new file mode 100644 index 0000000..859fbc6 --- /dev/null +++ b/SessionCompanion/SessionCompanion.Services/Services/StrengthService.cs @@ -0,0 +1,18 @@ +using AutoMapper; +using SessionCompanion.Database.Repositories.Base; +using SessionCompanion.Database.Tables; +using SessionCompanion.Services.Base; +using SessionCompanion.Services.Interfaces; +using SessionCompanion.ViewModels.StrengthViewModels; +using System; +using System.Collections.Generic; +using System.Text; + +namespace SessionCompanion.Services.Services +{ + public class StrengthService : ServiceBase, IStrengthService + { + public StrengthService(IMapper mapper, IRepository repository) : base(mapper, repository) + { } + } +} diff --git a/SessionCompanion/SessionCompanion.Services/Services/UserService.cs b/SessionCompanion/SessionCompanion.Services/Services/UserService.cs new file mode 100644 index 0000000..f0c8a68 --- /dev/null +++ b/SessionCompanion/SessionCompanion.Services/Services/UserService.cs @@ -0,0 +1,21 @@ +using AutoMapper; +using SessionCompanion.Database.Repositories.Base; +using SessionCompanion.Database.Tables; +using SessionCompanion.Services.Base; +using SessionCompanion.Services.Interfaces; +using SessionCompanion.ViewModels.UserViewModels; +using System; +using System.Collections.Generic; +using System.Text; +using System.Threading.Tasks; +using System.Linq; +using Microsoft.EntityFrameworkCore; + +namespace SessionCompanion.Services.Services +{ + public class UserService : ServiceBase, IUserService + { + public UserService(IMapper mapper, IRepository repository) : base(mapper, repository) + { } + } +} diff --git a/SessionCompanion/SessionCompanion.Services/Services/WisdomService.cs b/SessionCompanion/SessionCompanion.Services/Services/WisdomService.cs new file mode 100644 index 0000000..acc4adc --- /dev/null +++ b/SessionCompanion/SessionCompanion.Services/Services/WisdomService.cs @@ -0,0 +1,18 @@ +using AutoMapper; +using SessionCompanion.Database.Repositories.Base; +using SessionCompanion.Database.Tables; +using SessionCompanion.Services.Base; +using SessionCompanion.Services.Interfaces; +using SessionCompanion.ViewModels.WisdomViewModels; +using System; +using System.Collections.Generic; +using System.Text; + +namespace SessionCompanion.Services.Services +{ + public class WisdomService : ServiceBase, IWisdomService + { + public WisdomService(IMapper mapper, IRepository repository) : base(mapper, repository) + { } + } +} diff --git a/SessionCompanion/SessionCompanion.Services/SessionCompanion.Services.csproj b/SessionCompanion/SessionCompanion.Services/SessionCompanion.Services.csproj index f208d30..a6d012a 100644 --- a/SessionCompanion/SessionCompanion.Services/SessionCompanion.Services.csproj +++ b/SessionCompanion/SessionCompanion.Services/SessionCompanion.Services.csproj @@ -4,4 +4,13 @@ net5.0 + + + + + + + + + diff --git a/SessionCompanion/SessionCompanion/Configurations/ServiceConfiguration.cs b/SessionCompanion/SessionCompanion/Configurations/ServiceConfiguration.cs new file mode 100644 index 0000000..0d29b5d --- /dev/null +++ b/SessionCompanion/SessionCompanion/Configurations/ServiceConfiguration.cs @@ -0,0 +1,32 @@ +using Microsoft.Extensions.DependencyInjection; +using SessionCompanion.Services.Interfaces; +using SessionCompanion.Services.Services; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace SessionCompanion.Configurations +{ + public static class ServiceConfiguration + { + public static IServiceCollection AddServices(this IServiceCollection services) + { + services.AddScoped(); + services.AddScoped(); + services.AddScoped(); + services.AddScoped(); + services.AddScoped(); + services.AddScoped(); + services.AddScoped(); + services.AddScoped(); + services.AddScoped(); + services.AddScoped(); + services.AddScoped(); + services.AddScoped(); + services.AddScoped(); + services.AddScoped(); + return services; + } + } +} diff --git a/SessionCompanion/SessionCompanion/SessionCompanion.csproj b/SessionCompanion/SessionCompanion/SessionCompanion.csproj index e9537a5..864c2c2 100644 --- a/SessionCompanion/SessionCompanion/SessionCompanion.csproj +++ b/SessionCompanion/SessionCompanion/SessionCompanion.csproj @@ -34,6 +34,7 @@ + diff --git a/SessionCompanion/SessionCompanion/Startup.cs b/SessionCompanion/SessionCompanion/Startup.cs index da72a46..3a447da 100644 --- a/SessionCompanion/SessionCompanion/Startup.cs +++ b/SessionCompanion/SessionCompanion/Startup.cs @@ -31,6 +31,7 @@ namespace SessionCompanion options.UseSqlServer( Configuration.GetConnectionString("DefaultConnection"))); services.AddRepositories(); + services.AddServices(); services.AddSignalR(); // In production, the Angular files will be served from this directory services.AddSpaStaticFiles(configuration =>