aboutsummaryrefslogtreecommitdiff
path: root/API
diff options
context:
space:
mode:
authortranstrike <transtrike@gmail.com>2020-12-08 11:47:09 +0200
committertranstrike <transtrike@gmail.com>2020-12-08 11:47:09 +0200
commit536ff0677db7dd000393456b668da902b2d85021 (patch)
treea03c4869890e54f5bf74e0d2d48b771b0c503b19 /API
parent0c79f396cad64042ae123b81d0bc412e2dddc924 (diff)
downloadDevHive-536ff0677db7dd000393456b668da902b2d85021.tar
DevHive-536ff0677db7dd000393456b668da902b2d85021.tar.gz
DevHive-536ff0677db7dd000393456b668da902b2d85021.zip
DbContext implemented
Diffstat (limited to 'API')
-rw-r--r--API/API.csproj32
-rw-r--r--API/Database/DevHiveContext.cs18
2 files changed, 33 insertions, 17 deletions
diff --git a/API/API.csproj b/API/API.csproj
index 5c04910..401d5bc 100644
--- a/API/API.csproj
+++ b/API/API.csproj
@@ -1,18 +1,16 @@
-<Project Sdk="Microsoft.NET.Sdk.Web">
-
- <PropertyGroup>
- <TargetFramework>net5.0</TargetFramework>
- <RootNamespace>API</RootNamespace>
- </PropertyGroup>
-
- <ItemGroup>
- <PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="5.0.0" NoWarn="NU1605" />
- <PackageReference Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="5.0.0" NoWarn="NU1605" />
- <PackageReference Include="Swashbuckle.AspNetCore" Version="5.6.3" />
- </ItemGroup>
-
+<Project Sdk="Microsoft.NET.Sdk.Web">
+ <PropertyGroup>
+ <TargetFramework>net5.0</TargetFramework>
+ <RootNamespace>API</RootNamespace>
+ </PropertyGroup>
<ItemGroup>
- <ProjectReference Include="..\Models\Models.csproj" />
- </ItemGroup>
-
-</Project>
+ <PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="5.0.0" NoWarn="NU1605"/>
+ <PackageReference Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="5.0.0" NoWarn="NU1605"/>
+ <PackageReference Include="Swashbuckle.AspNetCore" Version="5.6.3"/>
+ <PackageReference Include="Microsoft.EntityFrameworkCore" Version="5.0.0"/>
+ <PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="5.0.0"/>
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\Models\Models.csproj"/>
+ </ItemGroup>
+</Project> \ No newline at end of file
diff --git a/API/Database/DevHiveContext.cs b/API/Database/DevHiveContext.cs
new file mode 100644
index 0000000..8623a11
--- /dev/null
+++ b/API/Database/DevHiveContext.cs
@@ -0,0 +1,18 @@
+using Microsoft.AspNetCore;
+using Microsoft.EntityFrameworkCore;
+using Models.Classes;
+using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
+using Microsoft.AspNetCore.Identity;
+
+namespace Database
+{
+ public class DevHiveContext : IdentityDbContext<IdentityUser<int>, IdentityRole<int>, int>
+ {
+ public DevHiveContext(DbContextOptions options)
+ : base(options) { }
+
+
+ public DbSet<Technology> Technologies { get; set; }
+ public DbSet<Language> Languages { get; set; }
+ }
+} \ No newline at end of file