diff --git a/ScrumTaskboard/Controllers/UserstoryController.cs b/ScrumTaskboard/Controllers/UserstoryController.cs new file mode 100644 index 0000000..95ff529 --- /dev/null +++ b/ScrumTaskboard/Controllers/UserstoryController.cs @@ -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>> GetUserstory() + { + return await _context.Userstories.ToListAsync(); + } + } +} \ No newline at end of file diff --git a/ScrumTaskboard/ScrumTaskboard.csproj b/ScrumTaskboard/ScrumTaskboard.csproj index 436c762..54b53bb 100644 --- a/ScrumTaskboard/ScrumTaskboard.csproj +++ b/ScrumTaskboard/ScrumTaskboard.csproj @@ -12,6 +12,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive + diff --git a/ScrumTaskboard/TaskContext.cs b/ScrumTaskboard/TaskContext.cs index a6d74e7..6920c07 100644 --- a/ScrumTaskboard/TaskContext.cs +++ b/ScrumTaskboard/TaskContext.cs @@ -6,6 +6,7 @@ namespace ScrumTaskboard public class TaskContext : DbContext { public DbSet Tasks { get; set; } + public DbSet Userstories { get; set; } public TaskContext() { } @@ -20,22 +21,26 @@ namespace ScrumTaskboard public class ScrumTask { public int Id { get; set; } - public string Titel { get; set; } - public string Inhalt { get; set; } - - - - public int Status { get; set; } public int Kategorie { get; set; } public int Bearbeiter { get; set; } public int ZugeordneterSprint { get; set; } public int Projekt { 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; } + } }