Last active
June 19, 2020 23:39
-
-
Save httpmurilo/6b999eb41f1ea522d979fdd562af73c9 to your computer and use it in GitHub Desktop.
construtor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using Faculdade.Api.Data; | |
using Microsoft.AspNetCore.Mvc; | |
namespace Faculdade.Api.Controllers | |
{ | |
[ApiController] | |
[Route("api/[controller]")] | |
public class AutorController | |
{ | |
private readonly DataContext _context; | |
public AutorController(DataContext context) | |
{ | |
_context = context ?? | |
throw new ArgumentNullException(nameof(context)); | |
_context.Database.EnsureCreated(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment