From 8a091496f3d21ccc99c650a7a6b40d7ae29310d0 Mon Sep 17 00:00:00 2001 From: batgo6o Date: Mon, 15 Mar 2021 13:43:21 +0200 Subject: [PATCH] Added CredentialChecker --- .../UserManagment/CredentialChecker.cs | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 LuminousSales/Business/Business/UserManagment/CredentialChecker.cs diff --git a/LuminousSales/Business/Business/UserManagment/CredentialChecker.cs b/LuminousSales/Business/Business/UserManagment/CredentialChecker.cs new file mode 100644 index 0000000..969f785 --- /dev/null +++ b/LuminousSales/Business/Business/UserManagment/CredentialChecker.cs @@ -0,0 +1,36 @@ +using Models; +using Models.Models; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace Business.Business.UserManagment +{ + public class CredentialChecker + { + private LuminousContext context; + public bool CheckIfUserIsCreated() + { + using (context = new LuminousContext()) + { + if (context.User.ToList().Any()) + { + return true; + } + return false; + } + } + public bool CheckPassword(string Password) + { + using (context = new LuminousContext()) + { + if (context.User.ToList().Exists(user => user.Password == Password)) + { + return true; + } + return false; + } + } + } +}