Skip to content

Commit

Permalink
feat: Atualiza Tags no banco
Browse files Browse the repository at this point in the history
  • Loading branch information
renebentes committed Aug 16, 2022
1 parent e0ca260 commit e864058
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Blog/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,9 @@

using var context = new BlogDataContext();

context.Tags.Add(new Tag { Name = "ASP.NET", Slug = "aspnet" });
var tag = context.Tags.FirstOrDefault(tag => tag.Id == 2);
tag.Name = ".NET";
tag.Slug = "dotnet";

context.Update(tag);
context.SaveChanges();

0 comments on commit e864058

Please sign in to comment.