public async Task Postar(PostModel postModel) { var post = new Post(postModel.Titulo, postModel.Descricao, postModel.Conteudo); await _blogStarWarsDbContext .Post .AddAsync(post); await _blogStarWarsDbContext.SaveChangesAsync(); }
public async Task InsertAsync(Post obj) { _context.Add(obj); await _context.SaveChangesAsync(); }