Initial commit

This commit is contained in:
Jimmy Engström 2023-02-17 15:28:17 +01:00
parent 2190113c56
commit 3088165398
1765 changed files with 192085 additions and 0 deletions

View file

@ -0,0 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
</Project>

View file

@ -0,0 +1,20 @@
namespace Data.Models.Interfaces;
public interface IBlogApi
{
Task<int> GetBlogPostCountAsync();
Task<List<BlogPost>?> GetBlogPostsAsync(int numberofposts, int startindex);
Task<List<Category>?> GetCategoriesAsync();
Task<List<Tag>?> GetTagsAsync();
Task<BlogPost?> GetBlogPostAsync(string id);
Task<Category?> GetCategoryAsync(string id);
Task<Tag?> GetTagAsync(string id);
Task<BlogPost?> SaveBlogPostAsync(BlogPost item);
Task<Category?> SaveCategoryAsync(Category item);
Task<Tag?> SaveTagAsync(Tag item);
Task DeleteBlogPostAsync(string id);
Task DeleteCategoryAsync(string id);
Task DeleteTagAsync(string id);
Task InvalidateCacheAsync();
}

View file

@ -0,0 +1,11 @@
namespace Data.Models;
public class BlogPost
{
public string? Id { get; set; }
public string Title { get; set; } = string.Empty;
public string Text { get; set; } = string.Empty;
public DateTime PublishDate { get; set; }
public Category? Category { get; set; }
public List<Tag> Tags { get; set; } = new();
}

View file

@ -0,0 +1,6 @@
namespace Data.Models;
public class Category
{
public string? Id { get; set; }
public string Name { get; set; } = string.Empty;
}

View file

@ -0,0 +1,6 @@
namespace Data.Models;
public class Tag
{
public string? Id { get; set; }
public string Name { get; set; } = string.Empty;
}