-
Notifications
You must be signed in to change notification settings - Fork 19
/
ActivityController.cs
44 lines (39 loc) · 1.06 KB
/
ActivityController.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
using System;
using System.Collections.Generic;
using Microsoft.AspNetCore.Mvc;
using Arda.Common.Interfaces.Kanban;
using Arda.Common.ViewModels.Main;
// For more information on enabling MVC for empty projects, visit http://go.microsoft.com/fwlink/?LinkID=397860
namespace Arda.Kanban.Controllers
{
[Route("api/[controller]")]
public class ActivityController : Controller
{
IActivityRepository _repository;
public ActivityController(IActivityRepository repository)
{
_repository = repository;
}
[HttpGet]
[Route("list")]
public IEnumerable<ActivityViewModel> List()
{
try
{
var activities = _repository.GetAllActivities();
if (activities != null)
{
return activities;
}
else
{
return null;
}
}
catch (Exception)
{
return null;
}
}
}
}