From e2b55ada118a3007aba56da83af01e2b92046b58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karol=20G=C3=B3rzy=C5=84ski?= Date: Sat, 5 Dec 2020 21:35:31 +0100 Subject: [PATCH 1/4] Added project for services in .net 5.0 --- SessionCompanion/SessionCompanion.Services/Class1.cs | 8 ++++++++ .../SessionCompanion.Services.csproj | 7 +++++++ SessionCompanion/SessionCompanion.sln | 8 +++++++- 3 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 SessionCompanion/SessionCompanion.Services/Class1.cs create mode 100644 SessionCompanion/SessionCompanion.Services/SessionCompanion.Services.csproj diff --git a/SessionCompanion/SessionCompanion.Services/Class1.cs b/SessionCompanion/SessionCompanion.Services/Class1.cs new file mode 100644 index 0000000..276ba2c --- /dev/null +++ b/SessionCompanion/SessionCompanion.Services/Class1.cs @@ -0,0 +1,8 @@ +using System; + +namespace SessionCompanion.Services +{ + public class Class1 + { + } +} diff --git a/SessionCompanion/SessionCompanion.Services/SessionCompanion.Services.csproj b/SessionCompanion/SessionCompanion.Services/SessionCompanion.Services.csproj new file mode 100644 index 0000000..f208d30 --- /dev/null +++ b/SessionCompanion/SessionCompanion.Services/SessionCompanion.Services.csproj @@ -0,0 +1,7 @@ + + + + net5.0 + + + diff --git a/SessionCompanion/SessionCompanion.sln b/SessionCompanion/SessionCompanion.sln index f02778c..c634e22 100644 --- a/SessionCompanion/SessionCompanion.sln +++ b/SessionCompanion/SessionCompanion.sln @@ -7,7 +7,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SessionCompanion", "Session EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SessionCompanion.Database", "SessionCompanion.Database\SessionCompanion.Database.csproj", "{CA05189B-A4AB-4946-80DC-EFA075A10F09}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SessionCompanion.ViewModels", "SessionCompanion.ViewModels\SessionCompanion.ViewModels.csproj", "{7762AA75-7B60-4F28-B80A-B03E39140F89}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SessionCompanion.ViewModels", "SessionCompanion.ViewModels\SessionCompanion.ViewModels.csproj", "{7762AA75-7B60-4F28-B80A-B03E39140F89}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SessionCompanion.Services", "SessionCompanion.Services\SessionCompanion.Services.csproj", "{C0A172ED-0F4C-4E78-8B64-28E2A756F62F}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -27,6 +29,10 @@ Global {7762AA75-7B60-4F28-B80A-B03E39140F89}.Debug|Any CPU.Build.0 = Debug|Any CPU {7762AA75-7B60-4F28-B80A-B03E39140F89}.Release|Any CPU.ActiveCfg = Release|Any CPU {7762AA75-7B60-4F28-B80A-B03E39140F89}.Release|Any CPU.Build.0 = Release|Any CPU + {C0A172ED-0F4C-4E78-8B64-28E2A756F62F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C0A172ED-0F4C-4E78-8B64-28E2A756F62F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C0A172ED-0F4C-4E78-8B64-28E2A756F62F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C0A172ED-0F4C-4E78-8B64-28E2A756F62F}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE -- 2.20.1 From 4aea17277ac0e91561ee929964f42341388d859f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karol=20G=C3=B3rzy=C5=84ski?= Date: Sat, 5 Dec 2020 21:46:27 +0100 Subject: [PATCH 2/4] Added base interface and service --- .../Base/IServiceBase.cs | 19 +++++ .../Base/ServiceBase.cs | 73 +++++++++++++++++++ .../SessionCompanion.Services/Class1.cs | 8 -- 3 files changed, 92 insertions(+), 8 deletions(-) create mode 100644 SessionCompanion/SessionCompanion.Services/Base/IServiceBase.cs create mode 100644 SessionCompanion/SessionCompanion.Services/Base/ServiceBase.cs delete mode 100644 SessionCompanion/SessionCompanion.Services/Class1.cs diff --git a/SessionCompanion/SessionCompanion.Services/Base/IServiceBase.cs b/SessionCompanion/SessionCompanion.Services/Base/IServiceBase.cs new file mode 100644 index 0000000..3c0cb53 --- /dev/null +++ b/SessionCompanion/SessionCompanion.Services/Base/IServiceBase.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text; +using System.Threading.Tasks; + +namespace SessionCompanion.Services.Base +{ + public interface IServiceBase : IDisposable + { + IEnumerable Get(); + Task Get(int id); + Task> Get(Expression> expresssion); + Task Create(TViewModel viewModel); + Task Update(int id, TViewModel viewModel); + Task Delete(int id); + Task SaveAsync(); + } +} diff --git a/SessionCompanion/SessionCompanion.Services/Base/ServiceBase.cs b/SessionCompanion/SessionCompanion.Services/Base/ServiceBase.cs new file mode 100644 index 0000000..e32ab1f --- /dev/null +++ b/SessionCompanion/SessionCompanion.Services/Base/ServiceBase.cs @@ -0,0 +1,73 @@ +using SessionCompanion.Database.Tables; +using System; +using System.Collections.Generic; +using System.Text; +using AutoMapper; +using System.Threading.Tasks; +using SessionCompanion.Database.Repositories.Base; +using System.Linq.Expressions; +using System.Linq; +using Microsoft.EntityFrameworkCore; + +namespace SessionCompanion.Services.Base +{ + public class ServiceBase : IServiceBase where TEntity : BaseEntity + { + protected IMapper Mapper { get; private set; } + protected IRepository Repository { get; private set; } + + + public ServiceBase(IMapper mapper, IRepository repository) + { + Mapper = mapper; + Repository = repository; + } + + public virtual IEnumerable Get() + { + var models = Repository.Get(); + return Mapper.Map>(models); + } + + public virtual async Task Get(int id) + { + var result = await Repository.Get(id); + return Mapper.Map(result); + } + + public virtual async Task> Get(Expression> expression) + { + var result = await Repository.Get(expression).ToListAsync(); + return result; + } + + public virtual async Task Create(TViewModel viewModel) + { + var model = Mapper.Map(viewModel); + await Repository.Create(model); + } + + public virtual async Task Update(int id, TViewModel viewModel) + { + var model = Mapper.Map(viewModel); + model.Id = id; + await Repository.Update(model); + } + + public virtual async Task Delete(int id) + { + var model = await Repository.Get(id); + Repository.Delete(model); + } + + public virtual async Task SaveAsync() + { + await Repository.Save(); + } + + public virtual void Dispose() + { + Repository.Dispose(); + } + } +} diff --git a/SessionCompanion/SessionCompanion.Services/Class1.cs b/SessionCompanion/SessionCompanion.Services/Class1.cs deleted file mode 100644 index 276ba2c..0000000 --- a/SessionCompanion/SessionCompanion.Services/Class1.cs +++ /dev/null @@ -1,8 +0,0 @@ -using System; - -namespace SessionCompanion.Services -{ - public class Class1 - { - } -} -- 2.20.1 From f957654596c4f73cffe4a9c9546c509d61f5ab33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karol=20G=C3=B3rzy=C5=84ski?= Date: Sat, 5 Dec 2020 21:47:12 +0100 Subject: [PATCH 3/4] Add interfaces --- .../Intefraces/IAlignmentService.cs | 13 +++++++++++++ .../Intefraces/IBackgroundService.cs | 13 +++++++++++++ .../Intefraces/IBiographyService.cs | 14 ++++++++++++++ .../Intefraces/ICharacterService.cs | 14 ++++++++++++++ .../Intefraces/ICharismaService.cs | 13 +++++++++++++ .../Intefraces/IClassService.cs | 14 ++++++++++++++ .../Intefraces/IConstitutionService.cs | 13 +++++++++++++ .../Intefraces/IDexterityService.cs | 13 +++++++++++++ .../Intefraces/IIntelligenceService.cs | 13 +++++++++++++ .../Intefraces/IRaceService.cs | 13 +++++++++++++ .../Intefraces/IStatisticsService.cs | 14 ++++++++++++++ .../Intefraces/IStrengthService.cs | 13 +++++++++++++ .../Intefraces/IUserService.cs | 14 ++++++++++++++ .../Intefraces/IWisdomService.cs | 13 +++++++++++++ 14 files changed, 187 insertions(+) create mode 100644 SessionCompanion/SessionCompanion.Services/Intefraces/IAlignmentService.cs create mode 100644 SessionCompanion/SessionCompanion.Services/Intefraces/IBackgroundService.cs create mode 100644 SessionCompanion/SessionCompanion.Services/Intefraces/IBiographyService.cs create mode 100644 SessionCompanion/SessionCompanion.Services/Intefraces/ICharacterService.cs create mode 100644 SessionCompanion/SessionCompanion.Services/Intefraces/ICharismaService.cs create mode 100644 SessionCompanion/SessionCompanion.Services/Intefraces/IClassService.cs create mode 100644 SessionCompanion/SessionCompanion.Services/Intefraces/IConstitutionService.cs create mode 100644 SessionCompanion/SessionCompanion.Services/Intefraces/IDexterityService.cs create mode 100644 SessionCompanion/SessionCompanion.Services/Intefraces/IIntelligenceService.cs create mode 100644 SessionCompanion/SessionCompanion.Services/Intefraces/IRaceService.cs create mode 100644 SessionCompanion/SessionCompanion.Services/Intefraces/IStatisticsService.cs create mode 100644 SessionCompanion/SessionCompanion.Services/Intefraces/IStrengthService.cs create mode 100644 SessionCompanion/SessionCompanion.Services/Intefraces/IUserService.cs create mode 100644 SessionCompanion/SessionCompanion.Services/Intefraces/IWisdomService.cs diff --git a/SessionCompanion/SessionCompanion.Services/Intefraces/IAlignmentService.cs b/SessionCompanion/SessionCompanion.Services/Intefraces/IAlignmentService.cs new file mode 100644 index 0000000..40c68bd --- /dev/null +++ b/SessionCompanion/SessionCompanion.Services/Intefraces/IAlignmentService.cs @@ -0,0 +1,13 @@ +using SessionCompanion.Database.Tables; +using SessionCompanion.Services.Base; +using SessionCompanion.ViewModels.AlignmentViewModels; +using System; +using System.Collections.Generic; +using System.Text; + +namespace SessionCompanion.Services.Interfaces +{ + public interface IAlignmentService : IServiceBase + { + } +} diff --git a/SessionCompanion/SessionCompanion.Services/Intefraces/IBackgroundService.cs b/SessionCompanion/SessionCompanion.Services/Intefraces/IBackgroundService.cs new file mode 100644 index 0000000..3d74755 --- /dev/null +++ b/SessionCompanion/SessionCompanion.Services/Intefraces/IBackgroundService.cs @@ -0,0 +1,13 @@ +using SessionCompanion.Database.Tables; +using SessionCompanion.Services.Base; +using SessionCompanion.ViewModels.BackgroundViewModels; +using System; +using System.Collections.Generic; +using System.Text; + +namespace SessionCompanion.Services.Interfaces +{ + public interface IBackgroundService : IServiceBase + { + } +} diff --git a/SessionCompanion/SessionCompanion.Services/Intefraces/IBiographyService.cs b/SessionCompanion/SessionCompanion.Services/Intefraces/IBiographyService.cs new file mode 100644 index 0000000..95e73ae --- /dev/null +++ b/SessionCompanion/SessionCompanion.Services/Intefraces/IBiographyService.cs @@ -0,0 +1,14 @@ +using SessionCompanion.Database.Tables; +using SessionCompanion.Services.Base; +using SessionCompanion.ViewModels.BiographyViewModels; +using System; +using System.Collections.Generic; +using System.Text; +using System.Threading.Tasks; + +namespace SessionCompanion.Services.Interfaces +{ + public interface IBiographyService : IServiceBase + { + } +} diff --git a/SessionCompanion/SessionCompanion.Services/Intefraces/ICharacterService.cs b/SessionCompanion/SessionCompanion.Services/Intefraces/ICharacterService.cs new file mode 100644 index 0000000..06bdf47 --- /dev/null +++ b/SessionCompanion/SessionCompanion.Services/Intefraces/ICharacterService.cs @@ -0,0 +1,14 @@ +using SessionCompanion.Database.Tables; +using SessionCompanion.Services.Base; +using SessionCompanion.ViewModels.CharacterViewModels; +using System; +using System.Collections.Generic; +using System.Text; +using System.Threading.Tasks; + +namespace SessionCompanion.Services.Interfaces +{ + public interface ICharacterService : IServiceBase + { + } +} diff --git a/SessionCompanion/SessionCompanion.Services/Intefraces/ICharismaService.cs b/SessionCompanion/SessionCompanion.Services/Intefraces/ICharismaService.cs new file mode 100644 index 0000000..b739114 --- /dev/null +++ b/SessionCompanion/SessionCompanion.Services/Intefraces/ICharismaService.cs @@ -0,0 +1,13 @@ +using SessionCompanion.Database.Tables; +using SessionCompanion.Services.Base; +using SessionCompanion.ViewModels.CharismaViewModels; +using System; +using System.Collections.Generic; +using System.Text; + +namespace SessionCompanion.Services.Interfaces +{ + public interface ICharismaService : IServiceBase + { + } +} diff --git a/SessionCompanion/SessionCompanion.Services/Intefraces/IClassService.cs b/SessionCompanion/SessionCompanion.Services/Intefraces/IClassService.cs new file mode 100644 index 0000000..c36f83d --- /dev/null +++ b/SessionCompanion/SessionCompanion.Services/Intefraces/IClassService.cs @@ -0,0 +1,14 @@ +using SessionCompanion.Database.Tables; +using SessionCompanion.Services.Base; +using SessionCompanion.ViewModels.ClassViewModels; +using System; +using System.Collections.Generic; +using System.Text; +using System.Threading.Tasks; + +namespace SessionCompanion.Services.Interfaces +{ + public interface IClassService : IServiceBase + { + } +} diff --git a/SessionCompanion/SessionCompanion.Services/Intefraces/IConstitutionService.cs b/SessionCompanion/SessionCompanion.Services/Intefraces/IConstitutionService.cs new file mode 100644 index 0000000..3f23511 --- /dev/null +++ b/SessionCompanion/SessionCompanion.Services/Intefraces/IConstitutionService.cs @@ -0,0 +1,13 @@ +using SessionCompanion.Database.Tables; +using SessionCompanion.Services.Base; +using SessionCompanion.ViewModels.ConstitutionViewModels; +using System; +using System.Collections.Generic; +using System.Text; + +namespace SessionCompanion.Services.Interfaces +{ + public interface IConstitutionService : IServiceBase + { + } +} diff --git a/SessionCompanion/SessionCompanion.Services/Intefraces/IDexterityService.cs b/SessionCompanion/SessionCompanion.Services/Intefraces/IDexterityService.cs new file mode 100644 index 0000000..222a67c --- /dev/null +++ b/SessionCompanion/SessionCompanion.Services/Intefraces/IDexterityService.cs @@ -0,0 +1,13 @@ +using SessionCompanion.Database.Tables; +using SessionCompanion.Services.Base; +using SessionCompanion.ViewModels.DexterityViewModels; +using System; +using System.Collections.Generic; +using System.Text; + +namespace SessionCompanion.Services.Interfaces +{ + public interface IDexterityService : IServiceBase + { + } +} diff --git a/SessionCompanion/SessionCompanion.Services/Intefraces/IIntelligenceService.cs b/SessionCompanion/SessionCompanion.Services/Intefraces/IIntelligenceService.cs new file mode 100644 index 0000000..e9d639a --- /dev/null +++ b/SessionCompanion/SessionCompanion.Services/Intefraces/IIntelligenceService.cs @@ -0,0 +1,13 @@ +using SessionCompanion.Database.Tables; +using SessionCompanion.Services.Base; +using SessionCompanion.ViewModels.IntelligenceViewModels; +using System; +using System.Collections.Generic; +using System.Text; + +namespace SessionCompanion.Services.Interfaces +{ + public interface IIntelligenceService : IServiceBase + { + } +} diff --git a/SessionCompanion/SessionCompanion.Services/Intefraces/IRaceService.cs b/SessionCompanion/SessionCompanion.Services/Intefraces/IRaceService.cs new file mode 100644 index 0000000..3ac7f1e --- /dev/null +++ b/SessionCompanion/SessionCompanion.Services/Intefraces/IRaceService.cs @@ -0,0 +1,13 @@ +using SessionCompanion.Database.Tables; +using SessionCompanion.Services.Base; +using SessionCompanion.ViewModels.RaceViewModels; +using System; +using System.Collections.Generic; +using System.Text; + +namespace SessionCompanion.Services.Interfaces +{ + public interface IRaceService : IServiceBase + { + } +} diff --git a/SessionCompanion/SessionCompanion.Services/Intefraces/IStatisticsService.cs b/SessionCompanion/SessionCompanion.Services/Intefraces/IStatisticsService.cs new file mode 100644 index 0000000..f624e0c --- /dev/null +++ b/SessionCompanion/SessionCompanion.Services/Intefraces/IStatisticsService.cs @@ -0,0 +1,14 @@ +using SessionCompanion.Database.Tables; +using SessionCompanion.Services.Base; +using SessionCompanion.ViewModels.StatisticsViewModels; +using System; +using System.Collections.Generic; +using System.Text; +using System.Threading.Tasks; + +namespace SessionCompanion.Services.Interfaces +{ + public interface IStatisticsService : IServiceBase + { + } +} diff --git a/SessionCompanion/SessionCompanion.Services/Intefraces/IStrengthService.cs b/SessionCompanion/SessionCompanion.Services/Intefraces/IStrengthService.cs new file mode 100644 index 0000000..d480d0a --- /dev/null +++ b/SessionCompanion/SessionCompanion.Services/Intefraces/IStrengthService.cs @@ -0,0 +1,13 @@ +using SessionCompanion.Database.Tables; +using SessionCompanion.Services.Base; +using SessionCompanion.ViewModels.StrengthViewModels; +using System; +using System.Collections.Generic; +using System.Text; + +namespace SessionCompanion.Services.Interfaces +{ + public interface IStrengthService : IServiceBase + { + } +} diff --git a/SessionCompanion/SessionCompanion.Services/Intefraces/IUserService.cs b/SessionCompanion/SessionCompanion.Services/Intefraces/IUserService.cs new file mode 100644 index 0000000..a7028c7 --- /dev/null +++ b/SessionCompanion/SessionCompanion.Services/Intefraces/IUserService.cs @@ -0,0 +1,14 @@ +using SessionCompanion.Database.Tables; +using SessionCompanion.Services.Base; +using SessionCompanion.ViewModels.UserViewModels; +using System; +using System.Collections.Generic; +using System.Text; +using System.Threading.Tasks; + +namespace SessionCompanion.Services.Interfaces +{ + public interface IUserService : IServiceBase + { + } +} diff --git a/SessionCompanion/SessionCompanion.Services/Intefraces/IWisdomService.cs b/SessionCompanion/SessionCompanion.Services/Intefraces/IWisdomService.cs new file mode 100644 index 0000000..7b556cc --- /dev/null +++ b/SessionCompanion/SessionCompanion.Services/Intefraces/IWisdomService.cs @@ -0,0 +1,13 @@ +using SessionCompanion.Database.Tables; +using SessionCompanion.Services.Base; +using SessionCompanion.ViewModels.WisdomViewModels; +using System; +using System.Collections.Generic; +using System.Text; + +namespace SessionCompanion.Services.Interfaces +{ + public interface IWisdomService : IServiceBase + { + } +} -- 2.20.1 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 4/4] 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 => -- 2.20.1