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

Adding linking sample to demonstrate linking feature for apps targeti… #4

Open
wants to merge 3 commits into
base: master
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
20 changes: 20 additions & 0 deletions LinkingSample/Authenticate/Authenticate.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
using System;
using DatabaseAccess;

namespace Authenticator
{
public class Authenticate
{
public static bool AuthenticateLogin(string username, string password)
{
Tuple<string, string> creds = new Tuple<string, string>(username, password);

Query query = new Query();

if (query.UserExists(creds))
return true;
else
return false;
}
}
}
14 changes: 14 additions & 0 deletions LinkingSample/Authenticate/Authenticate.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">

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

<ItemGroup>
<ProjectReference Include="..\DatabaseAccess\DatabaseAccess.csproj" />
</ItemGroup>

</Project>
10 changes: 10 additions & 0 deletions LinkingSample/DatabaseAccess/DatabaseAccess.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">

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

</Project>
28 changes: 28 additions & 0 deletions LinkingSample/DatabaseAccess/Query.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
using System;

namespace DatabaseAccess
{
internal class UserList
{
private static Dictionary<string, string> _users = new Dictionary<string, string> { { "admin", "admin123" } };

public static bool CheckUserInList(Tuple<string, string> user)
{
if (_users.ContainsKey(user.Item1) && _users[user.Item1].Equals(user.Item2))
return true;
else
return false;
}
}

public class Query
{
public bool UserExists(Tuple<string, string> creds)
{
if (UserList.CheckUserInList(creds))
return true;
else
return false;
}
}
}
37 changes: 37 additions & 0 deletions LinkingSample/LinkingSample.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.4.33205.214
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LinkingSample", "LinkingSample\LinkingSample.csproj", "{9ABCF99B-E65B-45F6-9103-80E8EC5EE11B}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Authenticate", "Authenticate\Authenticate.csproj", "{0328293B-5DB7-43B1-BB54-D81395905E24}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DatabaseAccess", "DatabaseAccess\DatabaseAccess.csproj", "{F84AB964-A526-4CEC-8987-FCE666D6BEFF}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{9ABCF99B-E65B-45F6-9103-80E8EC5EE11B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9ABCF99B-E65B-45F6-9103-80E8EC5EE11B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9ABCF99B-E65B-45F6-9103-80E8EC5EE11B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9ABCF99B-E65B-45F6-9103-80E8EC5EE11B}.Release|Any CPU.Build.0 = Release|Any CPU
{0328293B-5DB7-43B1-BB54-D81395905E24}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0328293B-5DB7-43B1-BB54-D81395905E24}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0328293B-5DB7-43B1-BB54-D81395905E24}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0328293B-5DB7-43B1-BB54-D81395905E24}.Release|Any CPU.Build.0 = Release|Any CPU
{F84AB964-A526-4CEC-8987-FCE666D6BEFF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F84AB964-A526-4CEC-8987-FCE666D6BEFF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F84AB964-A526-4CEC-8987-FCE666D6BEFF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F84AB964-A526-4CEC-8987-FCE666D6BEFF}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {4F7972A6-0BF3-4FB9-A119-FF77933BAF2E}
EndGlobalSection
EndGlobal
Loading