Advertisement
joaopaulofcc

Untitled

Sep 15th, 2021
1,110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.66 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Threading.Tasks;
  5. using Microsoft.AspNetCore.Http;
  6. using Microsoft.AspNetCore.Mvc;
  7. using projetoTeste.Models;
  8.  
  9. namespace projetoTeste.Controllers
  10. {
  11.     [Route("[controller]/[action]")]
  12.     [ApiController]
  13.     public class ColaboradorController : ControllerBase
  14.     {
  15.         private BDContexto contexto;
  16.        
  17.         public ColaboradorController(BDContexto bdContexto)
  18.         {
  19.             contexto = bdContexto;
  20.         }
  21.        
  22.         [HttpGet]
  23.         public List<Colaborador> Listar()
  24.         {
  25.             return contexto.Colaborador.ToList();
  26.         }
  27.     }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement