Skip to content

Commit 2908135

Browse files
committed
Initial commit
0 parents  commit 2908135

File tree

60 files changed

+3725
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+3725
-0
lines changed

.gitignore

+226
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,226 @@
1+
# The following command works for downloading when using Git for Windows:
2+
# curl -LOf http://gist.githubusercontent.com/kmorcinek/2710267/raw/.gitignore
3+
#
4+
# Download this file using PowerShell v3 under Windows with the following comand:
5+
# Invoke-WebRequest https://gist.githubusercontent.com/kmorcinek/2710267/raw/ -OutFile .gitignore
6+
#
7+
# or wget:
8+
# wget --no-check-certificate http://gist.githubusercontent.com/kmorcinek/2710267/raw/.gitignore
9+
10+
# User-specific files
11+
*.suo
12+
*.user
13+
*.sln.docstates
14+
15+
# Build results
16+
[Dd]ebug/
17+
[Rr]elease/
18+
x64/
19+
[Bb]in/
20+
[Oo]bj/
21+
# build folder is nowadays used for build scripts and should not be ignored
22+
#build/
23+
24+
# NuGet Packages
25+
*.nupkg
26+
# The packages folder can be ignored because of Package Restore
27+
**/packages/*
28+
# except build/, which is used as an MSBuild target.
29+
!**/packages/build/
30+
# Uncomment if necessary however generally it will be regenerated when needed
31+
#!**/packages/repositories.config
32+
33+
# MSTest test Results
34+
[Tt]est[Rr]esult*/
35+
[Bb]uild[Ll]og.*
36+
37+
*_i.c
38+
*_p.c
39+
*.ilk
40+
*.meta
41+
*.obj
42+
*.pch
43+
*.pdb
44+
*.pgc
45+
*.pgd
46+
*.rsp
47+
*.sbr
48+
*.tlb
49+
*.tli
50+
*.tlh
51+
*.tmp
52+
*.tmp_proj
53+
*.log
54+
*.vspscc
55+
*.vssscc
56+
.builds
57+
*.pidb
58+
*.scc
59+
60+
# Visual C++ cache files
61+
ipch/
62+
*.aps
63+
*.ncb
64+
*.opensdf
65+
*.sdf
66+
*.cachefile
67+
68+
# Visual Studio profiler
69+
*.psess
70+
*.vsp
71+
*.vspx
72+
73+
# Guidance Automation Toolkit
74+
*.gpState
75+
76+
# ReSharper is a .NET coding add-in
77+
_ReSharper*/
78+
*.[Rr]e[Ss]harper
79+
80+
# TeamCity is a build add-in
81+
_TeamCity*
82+
83+
# DotCover is a Code Coverage Tool
84+
*.dotCover
85+
86+
# NCrunch
87+
*.ncrunch*
88+
.*crunch*.local.xml
89+
90+
# Installshield output folder
91+
[Ee]xpress/
92+
93+
# DocProject is a documentation generator add-in
94+
DocProject/buildhelp/
95+
DocProject/Help/*.HxT
96+
DocProject/Help/*.HxC
97+
DocProject/Help/*.hhc
98+
DocProject/Help/*.hhk
99+
DocProject/Help/*.hhp
100+
DocProject/Help/Html2
101+
DocProject/Help/html
102+
103+
# Click-Once directory
104+
publish/
105+
106+
# Publish Web Output
107+
*.Publish.xml
108+
109+
# Windows Azure Build Output
110+
csx
111+
*.build.csdef
112+
113+
# Windows Store app package directory
114+
AppPackages/
115+
116+
# Others
117+
*.Cache
118+
ClientBin/
119+
[Ss]tyle[Cc]op.*
120+
~$*
121+
*~
122+
*.dbmdl
123+
*.[Pp]ublish.xml
124+
*.pfx
125+
*.publishsettings
126+
modulesbin/
127+
tempbin/
128+
129+
# EPiServer Site file (VPP)
130+
AppData/
131+
132+
# RIA/Silverlight projects
133+
Generated_Code/
134+
135+
# Backup & report files from converting an old project file to a newer
136+
# Visual Studio version. Backup files are not needed, because we have git ;-)
137+
_UpgradeReport_Files/
138+
Backup*/
139+
UpgradeLog*.XML
140+
UpgradeLog*.htm
141+
142+
# vim
143+
*.txt~
144+
*.swp
145+
*.swo
146+
147+
# Temp files when opening LibreOffice on ubuntu
148+
.~lock.*
149+
150+
# svn
151+
.svn
152+
153+
# CVS - Source Control
154+
**/CVS/
155+
156+
# Remainings from resolving conflicts in Source Control
157+
*.orig
158+
159+
# SQL Server files
160+
**/App_Data/*.mdf
161+
**/App_Data/*.ldf
162+
**/App_Data/*.sdf
163+
164+
165+
#LightSwitch generated files
166+
GeneratedArtifacts/
167+
_Pvt_Extensions/
168+
ModelManifest.xml
169+
170+
# =========================
171+
# Windows detritus
172+
# =========================
173+
174+
# Windows image file caches
175+
Thumbs.db
176+
ehthumbs.db
177+
178+
# Folder config file
179+
Desktop.ini
180+
181+
# Recycle Bin used on file shares
182+
$RECYCLE.BIN/
183+
184+
# OS generated files #
185+
Icon?
186+
187+
# Mac desktop service store files
188+
.DS_Store
189+
190+
# SASS Compiler cache
191+
.sass-cache
192+
193+
# Visual Studio 2014 CTP
194+
**/*.sln.ide
195+
196+
# Visual Studio temp something
197+
.vs/
198+
199+
# dotnet stuff
200+
project.lock.json
201+
202+
# VS 2015+
203+
*.vc.vc.opendb
204+
*.vc.db
205+
206+
# Rider
207+
.idea/
208+
209+
# Visual Studio Code
210+
.vscode/
211+
212+
# Output folder used by Webpack or other FE stuff
213+
**/node_modules/*
214+
**/wwwroot/*
215+
216+
# SpecFlow specific
217+
*.feature.cs
218+
*.feature.xlsx.*
219+
*.Specs_*.html
220+
221+
# UWP Projects
222+
AppPackages/
223+
224+
#####
225+
# End of core ignore list, below put you custom 'per project' settings (patterns or path)
226+
#####

GitHub.Data/Contexts/AppDbContext.cs

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
using GitHub.Domain.Entities;
2+
using Microsoft.EntityFrameworkCore;
3+
4+
namespace GitHub.Data.Contexts;
5+
public class AppDbContext : DbContext
6+
{
7+
protected override void OnConfiguring(DbContextOptionsBuilder optionBuilder)
8+
{
9+
string path = "Server = (localdb)\\MSSQLLocalDB;" +
10+
"Database = GitHub;" +
11+
"Trusted_Connection = True";
12+
optionBuilder.UseSqlServer(path);
13+
}
14+
public DbSet<User> Users { get; set; }
15+
public DbSet<Organization> Organizations { get; set; }
16+
public DbSet<Project> Projects { get; set; }
17+
public DbSet<ProjectStar> ProjectStars { get; set;}
18+
public DbSet<UserFollowers> UserFollowers { get; set; }
19+
public DbSet<ProjectContribution> ProjectContributions { get; set; }
20+
public DbSet<OrganizationUser> OrganizationUsers { get; set;}
21+
public DbSet<OrganizationProject> OrganizationProjects { get; set;}
22+
}

GitHub.Data/GitHub.Data.csproj

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<TargetFramework>net6.0</TargetFramework>
5+
<ImplicitUsings>enable</ImplicitUsings>
6+
<Nullable>enable</Nullable>
7+
</PropertyGroup>
8+
9+
<ItemGroup>
10+
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="6.0.14" />
11+
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="6.0.14">
12+
<PrivateAssets>all</PrivateAssets>
13+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
14+
</PackageReference>
15+
</ItemGroup>
16+
17+
<ItemGroup>
18+
<ProjectReference Include="..\GitHub.Domain\GitHub.Domain.csproj" />
19+
</ItemGroup>
20+
21+
</Project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
using GitHub.Domain.Entities;
2+
3+
namespace GitHub.Data.IRepositories;
4+
public interface IOrganizationProjectRepository
5+
{
6+
public ValueTask<OrganizationProject> InsertAsync(OrganizationProject organizationProject);
7+
public ValueTask<OrganizationProject> UpdateAsync(OrganizationProject organizationProject);
8+
public ValueTask<bool> DeleteAsync(long id);
9+
public ValueTask<OrganizationProject> SelectAsync(long id);
10+
public ValueTask<IQueryable<OrganizationProject>> SelectAllAsync();
11+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
using GitHub.Domain.Entities;
2+
3+
namespace GitHub.Data.IRepositories;
4+
public interface IOrganizationRepository
5+
{
6+
public ValueTask<Organization> InsertAsync(Organization organization);
7+
public ValueTask<Organization> UpdateAsync(Organization organization);
8+
public ValueTask<bool> DeleteAsync(long id);
9+
public ValueTask<Organization> SelectAsync(long id);
10+
public ValueTask<IQueryable<Organization>> SelectAllAsync();
11+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
using GitHub.Domain.Entities;
2+
3+
namespace GitHub.Data.IRepositories;
4+
public interface IOrganizationUserRepository
5+
{
6+
public ValueTask<OrganizationUser> InsertAsync(OrganizationUser organizationUser);
7+
public ValueTask<OrganizationUser> UpdateAsync(OrganizationUser organizationUser);
8+
public ValueTask<bool> DeleteAsync(long id);
9+
public ValueTask<OrganizationUser> SelectAsync(long id);
10+
public ValueTask<IQueryable<OrganizationUser>> SelectAllAsync();
11+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
using GitHub.Domain.Entities;
2+
3+
namespace GitHub.Data.IRepositories;
4+
public interface IProjectContributionRepository
5+
{
6+
public ValueTask<ProjectContribution> InsertAsync(ProjectContribution project);
7+
public ValueTask<ProjectContribution> UpdateAsync(ProjectContribution project);
8+
public ValueTask<bool> DeleteAsync(long id);
9+
public ValueTask<ProjectContribution> SelectAsync(long id);
10+
public ValueTask<IQueryable<ProjectContribution>> SelectAllAsync();
11+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
using GitHub.Domain.Entities;
2+
3+
namespace GitHub.Data.IRepositories;
4+
public interface IProjectRepository
5+
{
6+
public ValueTask<Project> InsertAsync(Project project);
7+
public ValueTask<Project> UpdateAsync(Project project);
8+
public ValueTask<bool> DeleteAsync(long id);
9+
public ValueTask<Project> SelectAsync(long id);
10+
public ValueTask<IQueryable<Project>> SelectAllAsync();
11+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
using GitHub.Domain.Entities;
2+
3+
namespace GitHub.Data.IRepositories;
4+
public interface IProjectStarRepository
5+
{
6+
public ValueTask<ProjectStar> InsertAsync(ProjectStar project);
7+
public ValueTask<ProjectStar> UpdateAsync(ProjectStar project);
8+
public ValueTask<bool> DeleteAsync(long id);
9+
public ValueTask<ProjectStar> SelectAsync(long id);
10+
public ValueTask<IQueryable<ProjectStar>> SelectAllAsync();
11+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
using GitHub.Domain.Entities;
2+
3+
namespace GitHub.Data.IRepositories;
4+
public interface IUserFollowersRepository
5+
{
6+
public ValueTask<UserFollowers> InsertAsync(UserFollowers userFollowers);
7+
public ValueTask<UserFollowers> UpdateAsync(UserFollowers userFollowers);
8+
public ValueTask<bool> DeleteAsync(long id);
9+
public ValueTask<UserFollowers> SelectAsync(long id);
10+
public ValueTask<IQueryable<UserFollowers>> SelectAllAsync();
11+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
using GitHub.Domain.Entities;
2+
3+
namespace GitHub.Data.IRepositories;
4+
public interface IUserRepository
5+
{
6+
public ValueTask<User> InsertAsync(User user);
7+
public ValueTask<User> UpdateAsync(User user);
8+
public ValueTask<bool> DeleteAsync(long id);
9+
public ValueTask<User> SelectAsync(long id);
10+
public ValueTask<IQueryable<User>> SelectAllAsync();
11+
12+
}

0 commit comments

Comments
 (0)