Added basics for userstories

This commit is contained in:
Niggl1999 2020-06-04 08:32:44 +02:00
parent aed9ca008a
commit 19e6ed16ec
3 changed files with 44 additions and 8 deletions

View File

@ -0,0 +1,30 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using ScrumTaskboard;
namespace ScrumTaskboard.Controllers
{
[Route("[controller]")]
[ApiController]
public class UserstoryController : ControllerBase
{
private readonly TaskContext _context;
public UserstoryController(TaskContext context)
{
_context = context;
}
// GET: api/Tasks
[HttpGet]
public async Task<ActionResult<IEnumerable<ScrumUserstory>>> GetUserstory()
{
return await _context.Userstories.ToListAsync();
}
}
}

View File

@ -12,6 +12,7 @@
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference> </PackageReference>
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="3.1.0-preview1.19506.1" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="3.1.3" /> <PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="3.1.3" />
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="3.1.3" /> <PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="3.1.3" />
</ItemGroup> </ItemGroup>

View File

@ -6,6 +6,7 @@ namespace ScrumTaskboard
public class TaskContext : DbContext public class TaskContext : DbContext
{ {
public DbSet<ScrumTask> Tasks { get; set; } public DbSet<ScrumTask> Tasks { get; set; }
public DbSet<ScrumUserstory> Userstories { get; set; }
public TaskContext() { } public TaskContext() { }
@ -20,22 +21,26 @@ namespace ScrumTaskboard
public class ScrumTask public class ScrumTask
{ {
public int Id { get; set; } public int Id { get; set; }
public string Titel { get; set; } public string Titel { get; set; }
public string Inhalt { get; set; } public string Inhalt { get; set; }
public int Status { get; set; } public int Status { get; set; }
public int Kategorie { get; set; } public int Kategorie { get; set; }
public int Bearbeiter { get; set; } public int Bearbeiter { get; set; }
public int ZugeordneterSprint { get; set; } public int ZugeordneterSprint { get; set; }
public int Projekt { get; set; } public int Projekt { get; set; }
public int Userstory { get; set; } public int Userstory { get; set; }
} }
public class ScrumUserstory
{
public int id { get; set; }
public string title { get; set; }
public string conetent { get; set; }
public int priority { get; set; }
public int status { get; set; }
public int category { get; set; }
public int creator { get; set; }
public int project { get; set; }
}
} }