Skip to content

Commit

Permalink
feat: Mapeia modelos de dados no DataContext
Browse files Browse the repository at this point in the history
  • Loading branch information
renebentes committed Jul 29, 2022
1 parent 7835028 commit 9469ece
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions Blog/Data/BlogDataContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,19 @@ namespace Blog.Data;
public class BlogDataContext : DbContext
{
public DbSet<Category> Categories { get; set; }

public DbSet<Post> Posts { get; set; }

public DbSet<PostTag> PostTags { get; set; }

public DbSet<Role> Roles { get; set; }

public DbSet<Tag> Tags { get; set; }

public DbSet<UserRole> UserRoles { get; set; }

public DbSet<User> Users { get; set; }

protected override void OnConfiguring(DbContextOptionsBuilder options)
=> options.UseSqlServer("Server=localhost,1433;Database=Blog;User ID=sa;Password=1q2w3e4r@#$;Trusted_Connection=False;TrustServerCertificate=True;");
}

0 comments on commit 9469ece

Please sign in to comment.