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.4KB

12345678910111213141516171819202122232425262728293031323334353637
  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. using Teknik.Areas.Upload.Models;
  9. namespace Teknik.Models
  10. {
  11. public class TeknikEntities : DbContext
  12. {
  13. public DbSet<User> Users { get; set; }
  14. public DbSet<Group> Groups { get; set; }
  15. public DbSet<Role> Roles { get; set; }
  16. public DbSet<Blog> Blogs { get; set; }
  17. public DbSet<Post> Posts { get; set; }
  18. public DbSet<Comment> BlogComments { get; set; }
  19. public DbSet<Contact> Contact { get; set; }
  20. public DbSet<Upload> Uploads { get; set; }
  21. protected override void OnModelCreating(DbModelBuilder modelBuilder)
  22. {
  23. modelBuilder.Entity<User>().ToTable("Users");
  24. modelBuilder.Entity<Group>().ToTable("Groups");
  25. modelBuilder.Entity<Role>().ToTable("Roles");
  26. modelBuilder.Entity<Blog>().ToTable("Blogs");
  27. modelBuilder.Entity<Post>().ToTable("Posts");
  28. modelBuilder.Entity<Comment>().ToTable("BlogComments");
  29. modelBuilder.Entity<Contact>().ToTable("Contact");
  30. modelBuilder.Entity<Upload>().ToTable("Uploads");
  31. base.OnModelCreating(modelBuilder);
  32. }
  33. }
  34. }