Skip to content

Commit 2acb47c

Browse files
committed
init commit
0 parents  commit 2acb47c

File tree

206 files changed

+27748
-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.

206 files changed

+27748
-0
lines changed

.gitignore

+239
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,239 @@
1+
## Ignore Visual Studio temporary files, build results, and
2+
## files generated by popular Visual Studio add-ons.
3+
4+
# User-specific files
5+
*.suo
6+
*.user
7+
*.userosscache
8+
*.sln.docstates
9+
10+
# User-specific files (MonoDevelop/Xamarin Studio)
11+
*.userprefs
12+
13+
# Build results
14+
[Dd]ebug/
15+
[Dd]ebugPublic/
16+
[Rr]elease/
17+
[Rr]eleases/
18+
x64/
19+
x86/
20+
build/
21+
bld/
22+
[Bb]in/
23+
[Oo]bj/
24+
25+
# Visual Studio 2015 cache/options directory
26+
.vs/
27+
# Visual Studio Code
28+
.vscode/
29+
# Uncomment if you have tasks that create the project's static files in wwwroot
30+
#wwwroot/
31+
32+
# MSTest test Results
33+
[Tt]est[Rr]esult*/
34+
[Bb]uild[Ll]og.*
35+
36+
# NUNIT
37+
*.VisualState.xml
38+
TestResult.xml
39+
40+
# Build Results of an ATL Project
41+
[Dd]ebugPS/
42+
[Rr]eleasePS/
43+
dlldata.c
44+
45+
# DNX
46+
project.lock.json
47+
artifacts/
48+
49+
*_i.c
50+
*_p.c
51+
*_i.h
52+
*.ilk
53+
*.meta
54+
*.obj
55+
*.pch
56+
*.pdb
57+
*.pgc
58+
*.pgd
59+
*.rsp
60+
*.sbr
61+
*.tlb
62+
*.tli
63+
*.tlh
64+
*.tmp
65+
*.tmp_proj
66+
*.log
67+
*.vspscc
68+
*.vssscc
69+
.builds
70+
*.pidb
71+
*.svclog
72+
*.scc
73+
74+
# Chutzpah Test files
75+
_Chutzpah*
76+
77+
# Visual C++ cache files
78+
ipch/
79+
*.aps
80+
*.ncb
81+
*.opendb
82+
*.opensdf
83+
*.sdf
84+
*.cachefile
85+
86+
# Visual Studio profiler
87+
*.psess
88+
*.vsp
89+
*.vspx
90+
*.sap
91+
92+
# TFS 2012 Local Workspace
93+
$tf/
94+
95+
# Guidance Automation Toolkit
96+
*.gpState
97+
98+
# ReSharper is a .NET coding add-in
99+
_ReSharper*/
100+
*.[Rr]e[Ss]harper
101+
*.DotSettings.user
102+
103+
# JustCode is a .NET coding add-in
104+
.JustCode
105+
106+
# TeamCity is a build add-in
107+
_TeamCity*
108+
109+
# DotCover is a Code Coverage Tool
110+
*.dotCover
111+
112+
# NCrunch
113+
_NCrunch_*
114+
.*crunch*.local.xml
115+
nCrunchTemp_*
116+
117+
# MightyMoose
118+
*.mm.*
119+
AutoTest.Net/
120+
121+
# Web workbench (sass)
122+
.sass-cache/
123+
124+
# Installshield output folder
125+
[Ee]xpress/
126+
127+
# DocProject is a documentation generator add-in
128+
DocProject/buildhelp/
129+
DocProject/Help/*.HxT
130+
DocProject/Help/*.HxC
131+
DocProject/Help/*.hhc
132+
DocProject/Help/*.hhk
133+
DocProject/Help/*.hhp
134+
DocProject/Help/Html2
135+
DocProject/Help/html
136+
137+
# Click-Once directory
138+
publish/
139+
140+
# Publish Web Output
141+
*.[Pp]ublish.xml
142+
*.azurePubxml
143+
# TODO: Comment the next line if you want to checkin your web deploy settings
144+
# but database connection strings (with potential passwords) will be unencrypted
145+
*.pubxml
146+
*.publishproj
147+
148+
# NuGet Packages
149+
*.nupkg
150+
# The packages folder can be ignored because of Package Restore
151+
**/packages/*
152+
# except build/, which is used as an MSBuild target.
153+
!**/packages/build/
154+
# Uncomment if necessary however generally it will be regenerated when needed
155+
#!**/packages/repositories.config
156+
157+
# Microsoft Azure Build Output
158+
csx/
159+
*.build.csdef
160+
161+
# Microsoft Azure Emulator
162+
ecf/
163+
rcf/
164+
165+
# Microsoft Azure ApplicationInsights config file
166+
ApplicationInsights.config
167+
168+
# Windows Store app package directory
169+
AppPackages/
170+
BundleArtifacts/
171+
172+
# Visual Studio cache files
173+
# files ending in .cache can be ignored
174+
*.[Cc]ache
175+
# but keep track of directories ending in .cache
176+
!*.[Cc]ache/
177+
178+
# Others
179+
ClientBin/
180+
~$*
181+
*~
182+
*.dbmdl
183+
*.dbproj.schemaview
184+
*.pfx
185+
*.publishsettings
186+
node_modules/
187+
orleans.codegen.cs
188+
189+
# RIA/Silverlight projects
190+
Generated_Code/
191+
192+
# Backup & report files from converting an old project file
193+
# to a newer Visual Studio version. Backup files are not needed,
194+
# because we have git ;-)
195+
_UpgradeReport_Files/
196+
Backup*/
197+
UpgradeLog*.XML
198+
UpgradeLog*.htm
199+
200+
# SQL Server files
201+
*.mdf
202+
*.ldf
203+
204+
# Business Intelligence projects
205+
*.rdl.data
206+
*.bim.layout
207+
*.bim_*.settings
208+
209+
# Microsoft Fakes
210+
FakesAssemblies/
211+
212+
# GhostDoc plugin setting file
213+
*.GhostDoc.xml
214+
215+
# Node.js Tools for Visual Studio
216+
.ntvs_analysis.dat
217+
218+
# Visual Studio 6 build log
219+
*.plg
220+
221+
# Visual Studio 6 workspace options file
222+
*.opt
223+
224+
# Visual Studio LightSwitch build output
225+
**/*.HTMLClient/GeneratedArtifacts
226+
**/*.DesktopClient/GeneratedArtifacts
227+
**/*.DesktopClient/ModelManifest.xml
228+
**/*.Server/GeneratedArtifacts
229+
**/*.Server/ModelManifest.xml
230+
_Pvt_Extensions
231+
232+
# Paket dependency manager
233+
.paket/paket.exe
234+
235+
# FAKE - F# Make
236+
.fake/
237+
238+
# Bitbucket
239+
bitbucket-pipelines.yml
+95
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
using DataAccessLayer.Models;
2+
using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
3+
using Microsoft.EntityFrameworkCore;
4+
using System;
5+
6+
namespace DataAccessLayer
7+
{
8+
public class ApplicationDbContext : IdentityDbContext<ApplicationUser, ApplicationRole, long>
9+
{
10+
public ApplicationDbContext(DbContextOptions options)
11+
: base(options)
12+
{
13+
14+
}
15+
16+
public DbSet<Idea> Ideas { get; set; }
17+
public DbSet<Comment> Comments { get; set; }
18+
public DbSet<Tag> Tags { get; set; }
19+
public DbSet<relIdeaTag> relIdeaTags { get; set; }
20+
public DbSet<relIdeaFavorite> relIdeaFavorites { get; set; }
21+
public DbSet<relIdeaLike> relIdeaLikes { get; set; }
22+
public DbSet<relCommentLike> relCommentLikes { get; set; }
23+
24+
protected override void OnModelCreating(ModelBuilder builder)
25+
{
26+
base.OnModelCreating(builder);
27+
28+
builder.Entity<Idea>()
29+
.HasOne(x => x.CreatorUser)
30+
.WithMany(x => x.Ideas)
31+
.HasForeignKey(x => x.CreatorId);
32+
33+
builder.Entity<Comment>()
34+
.HasOne(x => x.CreatorUser)
35+
.WithMany(x => x.Comments)
36+
.HasForeignKey(x => x.CreatorId);
37+
38+
builder.Entity<Comment>()
39+
.HasOne(x => x.Idea)
40+
.WithMany(x => x.Comments)
41+
.HasForeignKey(x => x.IdeaId);
42+
43+
builder.Entity<Tag>()
44+
.HasOne(x => x.CreatorUser)
45+
.WithMany(x => x.Tags)
46+
.HasForeignKey(x => x.CreatorId);
47+
48+
builder.Entity<relIdeaFavorite>()
49+
.HasOne(x => x.CreatorUser)
50+
.WithMany(x => x.relIdeaFavorites)
51+
.HasForeignKey(x => x.CreatorId);
52+
53+
builder.Entity<relIdeaFavorite>()
54+
.HasOne(x => x.Idea)
55+
.WithMany(x => x.Favorites)
56+
.HasForeignKey(x => x.IdeaId);
57+
58+
builder.Entity<relIdeaTag>()
59+
.HasOne(x => x.CreatorUser)
60+
.WithMany(x => x.relIdeaTags)
61+
.HasForeignKey(x => x.CreatorId);
62+
63+
builder.Entity<relIdeaTag>()
64+
.HasOne(x => x.Tag)
65+
.WithMany(x => x.IdeaTags)
66+
.HasForeignKey(x => x.TagId);
67+
68+
builder.Entity<relIdeaTag>()
69+
.HasOne(x => x.Idea)
70+
.WithMany(x => x.Tags)
71+
.HasForeignKey(x => x.IdeaId);
72+
73+
builder.Entity<relIdeaLike>()
74+
.HasOne(x => x.CreatorUser)
75+
.WithMany(x => x.relIdeaLikes)
76+
.HasForeignKey(x => x.CreatorId);
77+
78+
builder.Entity<relIdeaLike>()
79+
.HasOne(x => x.Idea)
80+
.WithMany(x => x.Likes)
81+
.HasForeignKey(x => x.IdeaId);
82+
83+
builder.Entity<relCommentLike>()
84+
.HasOne(x => x.CreatorUser)
85+
.WithMany(x => x.relCommentLikes)
86+
.HasForeignKey(x => x.CreatorId);
87+
88+
builder.Entity<relCommentLike>()
89+
.HasOne(x => x.Comment)
90+
.WithMany(x => x.Likes)
91+
.HasForeignKey(x => x.CommentId);
92+
93+
}
94+
}
95+
}
+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<TargetFramework>netstandard2.0</TargetFramework>
5+
</PropertyGroup>
6+
7+
<ItemGroup>
8+
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="2.0.1" />
9+
</ItemGroup>
10+
11+
</Project>

DataAccessLayer/Enums/Language.cs

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
namespace DataAccessLayer.Enums
2+
{
3+
public enum Language
4+
{
5+
EN,
6+
RU
7+
}
8+
}

DataAccessLayer/Enums/Vote.cs

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
namespace DataAccessLayer.Enums
2+
{
3+
public enum Vote
4+
{
5+
Dislike = -1,
6+
None = 0,
7+
Like = 1
8+
}
9+
}
+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
using DataAccessLayer.Models;
2+
using Microsoft.AspNetCore.Identity;
3+
using System;
4+
using System.Collections.Generic;
5+
6+
namespace DataAccessLayer.Models
7+
{
8+
public class ApplicationRole : IdentityRole<long>
9+
{
10+
11+
}
12+
}

0 commit comments

Comments
 (0)