The next generation of the Teknik Services. Written in ASP.NET. https://www.teknik.io/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

TeknikEntities.cs 1.2KB

12345678910111213141516171819202122232425262728293031323334
  1. using Microsoft.AspNet.Identity.EntityFramework;
  2. using System.Data.Entity;
  3. using System.Data.Entity.Infrastructure;
  4. using Teknik.Areas.Blog.Models;
  5. using Teknik.Areas.Profile.Models;
  6. using Teknik.Areas.Contact.Models;
  7. using Teknik.Migrations;
  8. namespace Teknik.Models
  9. {
  10. public class TeknikEntities : DbContext
  11. {
  12. public DbSet<User> Users { get; set; }
  13. public DbSet<Group> Groups { get; set; }
  14. public DbSet<Role> Roles { get; set; }
  15. public DbSet<Blog> Blogs { get; set; }
  16. public DbSet<Post> Posts { get; set; }
  17. public DbSet<Comment> BlogComments { get; set; }
  18. public DbSet<Contact> Contact { get; set; }
  19. protected override void OnModelCreating(DbModelBuilder modelBuilder)
  20. {
  21. modelBuilder.Entity<User>().ToTable("Users");
  22. modelBuilder.Entity<Group>().ToTable("Groups");
  23. modelBuilder.Entity<Role>().ToTable("Roles");
  24. modelBuilder.Entity<Blog>().ToTable("Blogs");
  25. modelBuilder.Entity<Post>().ToTable("Posts");
  26. modelBuilder.Entity<Comment>().ToTable("BlogComments");
  27. modelBuilder.Entity<Contact>().ToTable("Contact");
  28. base.OnModelCreating(modelBuilder);
  29. }
  30. }
  31. }