diff --git a/InternetGameBlog/InternetGameBlog.Services.Data/Interfaces/IUserService.cs b/InternetGameBlog/InternetGameBlog.Services.Data/Interfaces/IUserService.cs new file mode 100644 index 0000000..a2ca67f --- /dev/null +++ b/InternetGameBlog/InternetGameBlog.Services.Data/Interfaces/IUserService.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace InternetGameBlog.Services.Data.Interfaces +{ + public interface IUserService + { + Task IsUserExistsByEmailAsync(string email); + + } +} diff --git a/InternetGameBlog/InternetGameBlog.Services.Data/InternetGameBlog.Services.Data.csproj b/InternetGameBlog/InternetGameBlog.Services.Data/InternetGameBlog.Services.Data.csproj new file mode 100644 index 0000000..2a2d57b --- /dev/null +++ b/InternetGameBlog/InternetGameBlog.Services.Data/InternetGameBlog.Services.Data.csproj @@ -0,0 +1,16 @@ + + + + net6.0 + enable + enable + + + + + + + + + + diff --git a/InternetGameBlog/InternetGameBlog.Services.Data/UserService.cs b/InternetGameBlog/InternetGameBlog.Services.Data/UserService.cs new file mode 100644 index 0000000..4e3ca4d --- /dev/null +++ b/InternetGameBlog/InternetGameBlog.Services.Data/UserService.cs @@ -0,0 +1,20 @@ +using InternetGameBlog.Data; +using InternetGameBlog.Services.Data.Interfaces; +using Microsoft.EntityFrameworkCore; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace InternetGameBlog.Services.Data +{ + public class UserService : IUserService + { + private GameBlogDbContext dbContext; + public Task IsUserExistsByEmailAsync(string email) + { + return dbContext.Users.AnyAsync(u => u.Email == email); + } + } +} diff --git a/InternetGameBlog/InternetGameBlog.Web/Extensions/InternetgameBlogServiceCollectionExtension.cs b/InternetGameBlog/InternetGameBlog.Web/Extensions/InternetgameBlogServiceCollectionExtension.cs new file mode 100644 index 0000000..ebc23a6 --- /dev/null +++ b/InternetGameBlog/InternetGameBlog.Web/Extensions/InternetgameBlogServiceCollectionExtension.cs @@ -0,0 +1,12 @@ +using InternetGameBlog.Services.Data.Interfaces; + +namespace InternetGameBlog.Web.Extensions +{ + public static class InternetgameBlogServiceCollectionExtension + { + public static IServiceCollection ConfigureService(this.IServiceCollection services) + { + services.AddScoped + } + } +} diff --git a/InternetGameBlog/InternetGameBlog.sln b/InternetGameBlog/InternetGameBlog.sln index 45cb422..29786ea 100644 --- a/InternetGameBlog/InternetGameBlog.sln +++ b/InternetGameBlog/InternetGameBlog.sln @@ -3,19 +3,23 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 VisualStudioVersion = 17.6.33801.468 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "InternetGameBlog.Web", "InternetGameBlog.Web\InternetGameBlog.Web.csproj", "{04423A21-E928-4A07-A719-022F54E0F5B7}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "InternetGameBlog.Web", "InternetGameBlog.Web\InternetGameBlog.Web.csproj", "{04423A21-E928-4A07-A719-022F54E0F5B7}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Data", "Data", "{DEEF0EA9-5B76-461A-8EA9-D871D3CC6A9C}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Web", "Web", "{E2375936-124C-407B-B097-EA3C0DDD341A}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "InternetGameBlog.Data", "InternetGameBlog.Data\InternetGameBlog.Data.csproj", "{442F662A-9447-4FC6-AD9C-7A91FAB01B6F}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "InternetGameBlog.Data", "InternetGameBlog.Data\InternetGameBlog.Data.csproj", "{442F662A-9447-4FC6-AD9C-7A91FAB01B6F}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "InternetGameBlog.Data.Models", "InternetGameBlog.Data.Models\InternetGameBlog.Data.Models.csproj", "{D2ED22F9-C1FB-4351-A628-B372909CA61E}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "InternetGameBlog.Data.Models", "InternetGameBlog.Data.Models\InternetGameBlog.Data.Models.csproj", "{D2ED22F9-C1FB-4351-A628-B372909CA61E}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "InternetGameBlog.Web.ViewModels", "InternetGameBlog.Web.ViewModels\InternetGameBlog.Web.ViewModels.csproj", "{00795C00-FE46-484E-96EC-7EF146694AEF}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "InternetGameBlog.Web.ViewModels", "InternetGameBlog.Web.ViewModels\InternetGameBlog.Web.ViewModels.csproj", "{00795C00-FE46-484E-96EC-7EF146694AEF}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "InternetGameBlog.Common", "InternetGameBlog.Common\InternetGameBlog.Common.csproj", "{7137255D-2861-4C61-A72D-7C8E8B90ACB6}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "InternetGameBlog.Common", "InternetGameBlog.Common\InternetGameBlog.Common.csproj", "{7137255D-2861-4C61-A72D-7C8E8B90ACB6}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Services", "Services", "{EA63C136-2F9A-420C-899E-F7A98198496E}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "InternetGameBlog.Services.Data", "InternetGameBlog.Services.Data\InternetGameBlog.Services.Data.csproj", "{0FA9E93D-30B6-446C-A9FD-DB9273F1C2E2}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -43,6 +47,10 @@ Global {7137255D-2861-4C61-A72D-7C8E8B90ACB6}.Debug|Any CPU.Build.0 = Debug|Any CPU {7137255D-2861-4C61-A72D-7C8E8B90ACB6}.Release|Any CPU.ActiveCfg = Release|Any CPU {7137255D-2861-4C61-A72D-7C8E8B90ACB6}.Release|Any CPU.Build.0 = Release|Any CPU + {0FA9E93D-30B6-446C-A9FD-DB9273F1C2E2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0FA9E93D-30B6-446C-A9FD-DB9273F1C2E2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0FA9E93D-30B6-446C-A9FD-DB9273F1C2E2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0FA9E93D-30B6-446C-A9FD-DB9273F1C2E2}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -52,6 +60,7 @@ Global {442F662A-9447-4FC6-AD9C-7A91FAB01B6F} = {DEEF0EA9-5B76-461A-8EA9-D871D3CC6A9C} {D2ED22F9-C1FB-4351-A628-B372909CA61E} = {DEEF0EA9-5B76-461A-8EA9-D871D3CC6A9C} {00795C00-FE46-484E-96EC-7EF146694AEF} = {E2375936-124C-407B-B097-EA3C0DDD341A} + {0FA9E93D-30B6-446C-A9FD-DB9273F1C2E2} = {EA63C136-2F9A-420C-899E-F7A98198496E} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {64A10D40-2016-4781-A830-1DED4A8588F5}