diff --git a/api/Controllers/TeamsController.cs b/api/Controllers/TeamsController.cs new file mode 100644 index 00000000..e5598d92 --- /dev/null +++ b/api/Controllers/TeamsController.cs @@ -0,0 +1,44 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using api.Data; +using api.Dtos; +using api.Models; +using AutoMapper; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Identity; +using Microsoft.AspNetCore.Mvc; +using Microsoft.EntityFrameworkCore; + +namespace api.Controllers +{ + + [Authorize] + [Route("api/[controller]")] + [ApiController] + public class TeamsController : ControllerBase + { + private readonly DataContext context; + private readonly IUsersRepository _repo; + private readonly IMapper _mapper; + private readonly RoleManager _roleManager; + private readonly UserManager _userManager; + public TeamsController(DataContext context,IUsersRepository repo, IMapper mapper,RoleManager roleManager,UserManager UserManager) + { + this.context = context; + _mapper = mapper; + _roleManager = roleManager; + _userManager = UserManager; + _repo = repo; + } + + // GET api/teams + [HttpGet] + public async Task GetTeams() + { + var values= await context.Values.ToListAsync(); + return Ok(values); + } + } +} diff --git a/api/obj/Debug/netcoreapp2.1/api.assets.cache b/api/obj/Debug/netcoreapp2.1/api.assets.cache index b5b8a63c..5e8a8b31 100755 Binary files a/api/obj/Debug/netcoreapp2.1/api.assets.cache and b/api/obj/Debug/netcoreapp2.1/api.assets.cache differ