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/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 + { + } +} 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 new file mode 100644 index 0000000..a6d012a --- /dev/null +++ b/SessionCompanion/SessionCompanion.Services/SessionCompanion.Services.csproj @@ -0,0 +1,16 @@ + + + + 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 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 =>