diff options
Diffstat (limited to 'backend')
-rw-r--r-- | backend/api/api/Data/MongoDbSettings.cs | 17 | ||||
-rw-r--r-- | backend/api/api/Models/User.cs | 18 | ||||
-rw-r--r-- | backend/api/api/Services/MongoDbService.cs | 11 | ||||
-rw-r--r-- | backend/api/api/api.csproj | 5 | ||||
-rw-r--r-- | backend/api/api/appsettings.json | 10 |
5 files changed, 60 insertions, 1 deletions
diff --git a/backend/api/api/Data/MongoDbSettings.cs b/backend/api/api/Data/MongoDbSettings.cs new file mode 100644 index 00000000..8b42a02c --- /dev/null +++ b/backend/api/api/Data/MongoDbSettings.cs @@ -0,0 +1,17 @@ +using Microsoft.EntityFrameworkCore; +using MongoDB.Driver; + +namespace api.Data +{ + public class MongoDbSettings + { + public string? ConnectionURI { get; set; } = null; + public string? DatabaseName { get; set; } = null; + public string? CollectionName { get; set; } = null; + + + + + + } +} diff --git a/backend/api/api/Models/User.cs b/backend/api/api/Models/User.cs new file mode 100644 index 00000000..d0f2bc0f --- /dev/null +++ b/backend/api/api/Models/User.cs @@ -0,0 +1,18 @@ +using System.ComponentModel.DataAnnotations; + +namespace api.Models +{ + public class User + { + [Key] + public Guid userId { get; set; } + public string username { get; set; } + public string email { get; set; } + public string password { get; set; } + + + public string firstName { get; set; } + public int lastName { get; set; } + + } +} diff --git a/backend/api/api/Services/MongoDbService.cs b/backend/api/api/Services/MongoDbService.cs new file mode 100644 index 00000000..f8b37536 --- /dev/null +++ b/backend/api/api/Services/MongoDbService.cs @@ -0,0 +1,11 @@ + + + +namespace api.Services +{ + public class MongoDbService + { + + + } +} diff --git a/backend/api/api/api.csproj b/backend/api/api/api.csproj index f278c90a..d4cc5552 100644 --- a/backend/api/api/api.csproj +++ b/backend/api/api/api.csproj @@ -10,4 +10,9 @@ <Folder Include="Controllers\" /> </ItemGroup> + <ItemGroup> + <PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.2" /> + <PackageReference Include="MongoDB.Driver" Version="2.14.1" /> + </ItemGroup> + </Project> diff --git a/backend/api/api/appsettings.json b/backend/api/api/appsettings.json index 10f68b8c..7a5b7f7a 100644 --- a/backend/api/api/appsettings.json +++ b/backend/api/api/appsettings.json @@ -5,5 +5,13 @@ "Microsoft.AspNetCore": "Warning" } }, - "AllowedHosts": "*" + "AllowedHosts": "*", + + "MongoDb": { + "ConnectionURI": "mongodb+srv://LINKIKKKKKKK" + "DatabaseName": "" + "CollectionName": "" + + } + } |