Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Services #11

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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<bool> IsUserExistsByEmailAsync(string email);

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\InternetGameBlog.Common\InternetGameBlog.Common.csproj" />
<ProjectReference Include="..\InternetGameBlog.Data.Models\InternetGameBlog.Data.Models.csproj" />
<ProjectReference Include="..\InternetGameBlog.Data\InternetGameBlog.Data.csproj" />
<ProjectReference Include="..\InternetGameBlog.Web.ViewModels\InternetGameBlog.Web.ViewModels.csproj" />
</ItemGroup>

</Project>
20 changes: 20 additions & 0 deletions InternetGameBlog/InternetGameBlog.Services.Data/UserService.cs
Original file line number Diff line number Diff line change
@@ -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<bool> IsUserExistsByEmailAsync(string email)
{
return dbContext.Users.AnyAsync(u => u.Email == email);
}
}
}
Original file line number Diff line number Diff line change
@@ -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<IUserService>
}
}
}
19 changes: 14 additions & 5 deletions InternetGameBlog/InternetGameBlog.sln
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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}
Expand Down