From dc1938dbb98dc9edf16558e505b2961246c83e6e Mon Sep 17 00:00:00 2001 From: Luca Matei Pintilie Date: Wed, 30 Oct 2024 21:59:53 +0100 Subject: Add API and Test --- Api/Models/Content.cs | 7 +++++++ Api/Models/DbWikiWakaContext.cs | 11 +++++++++++ Api/Models/Language.cs | 7 +++++++ Api/Models/Property.cs | 11 +++++++++++ Api/Models/Version.cs | 6 ++++++ 5 files changed, 42 insertions(+) create mode 100644 Api/Models/Content.cs create mode 100644 Api/Models/DbWikiWakaContext.cs create mode 100644 Api/Models/Language.cs create mode 100644 Api/Models/Property.cs create mode 100644 Api/Models/Version.cs (limited to 'Api/Models') diff --git a/Api/Models/Content.cs b/Api/Models/Content.cs new file mode 100644 index 0000000..d59c8e1 --- /dev/null +++ b/Api/Models/Content.cs @@ -0,0 +1,7 @@ +namespace WikiWaka.Api.Models; + +public class Content +{ + public int Id { get; set; } + public ICollection Properties { get; set; } +} diff --git a/Api/Models/DbWikiWakaContext.cs b/Api/Models/DbWikiWakaContext.cs new file mode 100644 index 0000000..cf5632a --- /dev/null +++ b/Api/Models/DbWikiWakaContext.cs @@ -0,0 +1,11 @@ +using Microsoft.EntityFrameworkCore; + +namespace WikiWaka.Api.Models; + +public class DbWikiWakaContext(DbContextOptions options) : DbContext(options) +{ + public DbSet Content { get; set; } + public DbSet Version { get; set; } + public DbSet Property { get; set; } + public DbSet Language { get; set; } +} diff --git a/Api/Models/Language.cs b/Api/Models/Language.cs new file mode 100644 index 0000000..a8fd30e --- /dev/null +++ b/Api/Models/Language.cs @@ -0,0 +1,7 @@ +namespace WikiWaka.Api.Models; + +public class Language +{ + public int Id { get; set; } + public required string LanguageCode { get; set; } +} diff --git a/Api/Models/Property.cs b/Api/Models/Property.cs new file mode 100644 index 0000000..b20adac --- /dev/null +++ b/Api/Models/Property.cs @@ -0,0 +1,11 @@ +namespace WikiWaka.Api.Models; + +public class Property +{ + public int Id { get; set; } + public required string Text { get; set; } + + public required Content Content { get; set; } + public required Language Language { get; set; } + public required Version Version { get; set; } +} diff --git a/Api/Models/Version.cs b/Api/Models/Version.cs new file mode 100644 index 0000000..e4971e9 --- /dev/null +++ b/Api/Models/Version.cs @@ -0,0 +1,6 @@ +namespace WikiWaka.Api.Models; + +public class Version +{ + public int Id { get; set; } +} -- cgit v1.2.3