Guest User

Untitled

a guest
Jul 19th, 2018
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.54 KB | None | 0 0
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <configuration>
  3. <configSections>
  4. <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
  5. <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
  6.  
  7. <!-- I tried use that, but same error -->
  8. <!-- <section name="oracle.manageddataaccess.client"
  9. type="OracleInternal.Common.ODPMSectionHandler, Oracle.ManagedDataAccess"/> -->
  10.  
  11. </configSections>
  12. <connectionStrings>
  13. <!-- <add name="sqlServer"
  14. connectionString="Data Source=PMUNICIPALSQLEXPRESS;Initial Catalog=eSocial_0.2;Integrated Security=True"
  15. providerName="System.Data.SqlClient" /> -->
  16. <add name="oracle"
  17. connectionString="DATA SOURCE=localhost:1521/xe;PASSWORD=password;USER ID=user"
  18. providerName="Oracle.ManagedDataAccess.Client" />
  19. </connectionStrings>
  20. <system.serviceModel>
  21. <bindings>
  22. <basicHttpBinding>
  23. <binding name="WsEnviarLoteEventos" maxReceivedMessageSize="1000000">
  24. <security mode="Transport">
  25. <transport clientCredentialType="Certificate" />
  26. </security>
  27. </binding>
  28. <binding name="Servicos.Empregador_ServicoConsultarLoteEventos" maxReceivedMessageSize="1000000">
  29. <security mode="Transport">
  30. <transport clientCredentialType="Certificate" />
  31. </security>
  32. </binding>
  33. </basicHttpBinding>
  34. </bindings>
  35. <client>
  36. <endpoint address="https://webservices.producaorestrita.esocial.gov.br/servicos/empregador/enviarloteeventos/WsEnviarLoteEventos.svc"
  37. binding="basicHttpBinding" bindingConfiguration="WsEnviarLoteEventos"
  38. contract="ServicoEnviarLoteEventos.ServicoEnviarLoteEventos" name="WsEnviarLoteEventos" />
  39. <endpoint address="https://webservices.producaorestrita.esocial.gov.br/servicos/empregador/consultarloteeventos/WsConsultarLoteEventos.svc"
  40. binding="basicHttpBinding" bindingConfiguration="Servicos.Empregador_ServicoConsultarLoteEventos"
  41. contract="ServicoConsultarLoteEventos.ServicoConsultarLoteEventos" name="Servicos.Empregador_ServicoConsultarLoteEventos" />
  42. </client>
  43. </system.serviceModel>
  44. <runtime>
  45. <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
  46. <dependentAssembly>
  47. <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
  48. <bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" />
  49. </dependentAssembly>
  50. <dependentAssembly>
  51. <assemblyIdentity name="System.Collections.Immutable" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
  52. <bindingRedirect oldVersion="0.0.0.0-1.2.0.0" newVersion="1.2.0.0" />
  53. </dependentAssembly>
  54. </assemblyBinding>
  55. </runtime>
  56. <entityFramework>
  57. <defaultConnectionFactory type="Oracle.ManagedDataAccess.EntityFramework.OracleConnectionFactory, Oracle.ManagedDataAccess.EntityFramework" />
  58. <providers>
  59. <provider invariantName="Oracle.ManagedDataAccess.Client"
  60. type="Oracle.ManagedDataAccess.EntityFramework.EFOracleProviderServices, Oracle.ManagedDataAccess.EntityFramework" />
  61.  
  62. </providers>
  63. </entityFramework>
  64. <system.data>
  65. <DbProviderFactories>
  66. <add name="ODP.NET, Managed Driver" invariant="Oracle.ManagedDataAccess.Client"
  67. description="Oracle Data Provider for .NET, Managed Driver"
  68. type="Oracle.ManagedDataAccess.Client.OracleClientFactory, Oracle.ManagedDataAccess" />
  69. </DbProviderFactories>
  70. </system.data>
  71. </configuration>
  72.  
  73. class EntityContext : DbContext
  74. {
  75. public DbSet<HistoricoControle> HistoricoControles { get; set; }
  76. public DbSet<TabelaControle> TabelaControles { get; set; }
  77. public DbSet<TabelaControleStatus> TabelaControleStatuses { get; set; }
  78.  
  79. private string dataBase;
  80.  
  81. static string connectionString;
  82.  
  83. //The connection string will be loaded from eSocial.config file
  84. //public EntityContext() : base(new OracleConnection("User Id=user;Password=password; DATA SOURCE=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521))(CONNECT_DATA=(SERVER =localhost)(SID=xe)))"), true)
  85. public EntityContext() : base("name=oracle")
  86. {
  87.  
  88. }
  89.  
  90. protected override void OnModelCreating(DbModelBuilder modelBuilder)
  91. {
  92. modelBuilder.HasDefaultSchema("user".ToUpper());
  93. //base.OnModelCreating(modelBuilder);
  94. }
  95.  
  96. }
Add Comment
Please, Sign In to add comment