EMIS.Entities.HRServices.Context.cs 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. //------------------------------------------------------------------------------
  2. // <auto-generated>
  3. // This code was generated from a template.
  4. //
  5. // Manual changes to this file may cause unexpected behavior in your application.
  6. // Manual changes to this file will be overwritten if the code is regenerated.
  7. // </auto-generated>
  8. //------------------------------------------------------------------------------
  9. #pragma warning disable 1573
  10. namespace EMIS.Entities.HRServices
  11. {
  12. using System;
  13. using System.Data.Common;
  14. using System.Data.Entity;
  15. using System.Data.Entity.Infrastructure;
  16. public partial class HRServiceContextContainer : DbContext
  17. {
  18. static HRServiceContextContainer()
  19. {
  20. Database.SetInitializer<HRServiceContextContainer>(null);
  21. }
  22. public HRServiceContextContainer() : base("name=HRServiceContextContainer") {
  23. var objectContext = (this as IObjectContextAdapter).ObjectContext;
  24. objectContext.CommandTimeout = 12000;
  25. base.Configuration.ProxyCreationEnabled = false;
  26. }
  27. public HRServiceContextContainer(string nameOrConnectionString) : base(nameOrConnectionString) {
  28. var objectContext = (this as IObjectContextAdapter).ObjectContext;
  29. objectContext.CommandTimeout = 12000;
  30. base.Configuration.ProxyCreationEnabled = false;
  31. }
  32. protected override void OnModelCreating(DbModelBuilder modelBuilder)
  33. {
  34. modelBuilder.Conventions.Remove<IncludeMetadataConvention>();
  35. modelBuilder.Configurations.Add(new Comm_OrgInfo_Mapping());
  36. modelBuilder.Configurations.Add(new Comm_Posts_Mapping());
  37. modelBuilder.Configurations.Add(new Comm_Users_Mapping());
  38. }
  39. public DbSet<Comm_OrgInfo> Comm_OrgInfo { get; set; }
  40. public DbSet<Comm_Posts> Comm_Posts { get; set; }
  41. public DbSet<Comm_Users> Comm_Users { get; set; }
  42. }
  43. }