public async Task Postar(PostModel postModel)
        {
            var post = new Post(postModel.Titulo, postModel.Descricao, postModel.Conteudo);

            await _blogStarWarsDbContext
            .Post
            .AddAsync(post);

            await _blogStarWarsDbContext.SaveChangesAsync();
        }
Exemplo n.º 2
0
 public async Task InsertAsync(Post obj)
 {
     _context.Add(obj);
     await _context.SaveChangesAsync();
 }