Guest User

Untitled

a guest
Mar 7th, 2018
409
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 15.41 KB | None | 0 0
  1. the best overload for '.ctor' does not have a parameter named 'throwifv1schema'
  2.  
  3.  
  4. using System.Data.Entity;
  5. using System.Security.Claims;
  6. using System.Threading.Tasks;
  7. using Microsoft.AspNet.Identity;
  8. using Microsoft.AspNet.Identity.EntityFramework;
  9. using System;
  10. using System.Collections.Generic;
  11. using System.ComponentModel.DataAnnotations;
  12. using System.ComponentModel.DataAnnotations.Schema;
  13. //using PortalAdmCC.AcessoDados;
  14. using System.Data.Entity.ModelConfiguration.Conventions;
  15.  
  16. namespace PortalAdmCC.Models
  17. {
  18. // You can add profile data for the user by adding more properties to your ApplicationUser class, please visit https://go.microsoft.com/fwlink/?LinkID=317594 to learn more.
  19. public class ApplicationUser : IdentityUser
  20. {
  21. internal string PhoneNumber;
  22.  
  23. public async Task<ClaimsIdentity> GenerateUserIdentityAsync(UserManager<ApplicationUser> manager)
  24. {
  25. // Note the authenticationType must match the one defined in CookieAuthenticationOptions.AuthenticationType
  26. var userIdentity = await manager.CreateIdentityAsync(this, DefaultAuthenticationTypes.ApplicationCookie);
  27. // Add custom user claims here
  28. return userIdentity;
  29. }
  30.  
  31.  
  32. public string AreaSolicitante { get; set; }
  33. public string Perfil { get; set; }
  34. public DateTime? LastPasswordChangedDate { get; set; }
  35. public ApplicationUser()
  36. : base()
  37. {
  38. PreviousUserPasswords = new List<PreviousPassword>();
  39. }
  40. public virtual IList<PreviousPassword> PreviousUserPasswords { get; set; }
  41. public string Email { get; internal set; }
  42. }
  43.  
  44.  
  45. public class PreviousPassword
  46. {
  47. public PreviousPassword()
  48. {
  49. CreateDate = DateTimeOffset.Now;
  50. }
  51.  
  52. [Key, Column(Order = 0)]
  53. public string PasswordHash { get; set; }
  54. public DateTimeOffset CreateDate { get; set; }
  55. [Key, Column(Order = 1)]
  56. public string UserId { get; set; }
  57. public virtual ApplicationUser User { get; set; }
  58.  
  59. }
  60.  
  61.  
  62. public class ApplicationDbContext : IdentityDbContext<ApplicationUser>
  63. {
  64. public ApplicationDbContext()
  65. : base("vivo", throwIfV1Schema: false)
  66. {
  67.  
  68. }
  69. protected override void OnModelCreating(DbModelBuilder modelBuilder)
  70. {
  71. base.OnModelCreating(modelBuilder);
  72. //tira o plural no nome das tabelas
  73. modelBuilder.Conventions.Remove<PluralizingTableNameConvention>();
  74. //Limita tamanho dos campos string
  75. modelBuilder.Properties<string>().Configure(c => c.HasMaxLength(255));
  76. // modelBuilder.Entity()HasRequired( )
  77. //.Entity().HasRequired(d => d.Administrator).WithMany().WillCascadeOnDelete(false);
  78.  
  79. }
  80.  
  81. public static ApplicationDbContext Create()
  82. {
  83. return new ApplicationDbContext();
  84. }
  85.  
  86. //----------------------------------------------------------------------------------------------
  87. }
  88.  
  89. }
  90.  
  91. <?xml version="1.0" encoding="utf-8"?>
  92. <!--
  93. For more information on how to configure your ASP.NET application, please visit
  94. https://go.microsoft.com/fwlink/?LinkId=301880
  95. -->
  96. <configuration>
  97. <configSections>
  98. <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
  99.  
  100. <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 --></configSections>
  101. <connectionStrings>
  102. <add name="Excel03ConString" connectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source={0};Extended Properties='Excel 8.0;HDR=YES;IMEX=1'" />
  103. <add name="Excel07+ConString" connectionString="Provider=Microsoft.ACE.OLEDB.12.0;Data Source={0};Extended Properties='Excel 8.0;HDR=YES;IMEX=1'" />
  104.  
  105. <add name="DefaultConnection" connectionString="Data Source=(localdb)MSSQLLocalDB; Initial Catalog=vivo; Integrated Security=False; User ID= sa; Password=382700; Encrypt=False; TrustServerCertificate=True; ApplicationIntent=ReadWrite; Connection Timeout=60; MultiSubnetFailover=False" providerName="System.Data.SqlClient" />
  106. <!-- <add name="DefaultConnection" connectionString="Data Source=172.16.0.5; Initial Catalog=DB_PROJETO_HOMOLOG; Integrated Security=False; User ID= user_projeto_homologacao; Password=rat4xAr7pra; Encrypt=False; TrustServerCertificate=True; ApplicationIntent=ReadWrite; MultiSubnetFailover=False" providerName="System.Data.SqlClient" />
  107. <add name="Download_Data" connectionString = "Data Source=172.16.0.5; Initial Catalog=DB_PROJETO_HOMOLOG; Integrated Security=False; User ID=user_projeto_homologacao; Password=rat4xAr7pra; Encrypt=False; TrustServerCertificate=True; ApplicationIntent=ReadWrite; MultiSubnetFailover=False" providerName="System.Data.SqlClient" />-->
  108. </connectionStrings>
  109. <appSettings>
  110. <add key="webpages:Version" value="3.0.0.0" />
  111. <add key="webpages:Enabled" value="false" />
  112. <add key="ClientValidationEnabled" value="true" />
  113. <add key="UnobtrusiveJavaScriptEnabled" value="true" />
  114. </appSettings>
  115.  
  116.  
  117. <!--
  118. For a description of web.config changes see http://go.microsoft.com/fwlink/?LinkId=235367.
  119.  
  120. The following attributes can be set on the <httpRuntime> tag.
  121. <system.Web>
  122. <httpRuntime targetFramework="4.6.1" />
  123. </system.Web>
  124. -->
  125. <system.web>
  126. <authentication mode="None" />
  127. <compilation debug="true" targetFramework="4.6.1" />
  128. <httpRuntime maxRequestLength="50192" executionTimeout="3600" />
  129. <httpModules>
  130. <add name="ApplicationInsightsWebTracking" type="Microsoft.ApplicationInsights.Web.ApplicationInsightsHttpModule, Microsoft.AI.Web" />
  131. </httpModules>
  132. <pages controlRenderingCompatibilityVersion="4.0" />
  133. </system.web>
  134. <system.webServer>
  135. <modules>
  136. <remove name="FormsAuthentication" />
  137. <remove name="TelemetryCorrelationHttpModule" />
  138. <add name="TelemetryCorrelationHttpModule" type="Microsoft.AspNet.TelemetryCorrelation.TelemetryCorrelationHttpModule, Microsoft.AspNet.TelemetryCorrelation" preCondition="integratedMode,managedHandler" />
  139. <remove name="ApplicationInsightsWebTracking" />
  140. <add name="ApplicationInsightsWebTracking" type="Microsoft.ApplicationInsights.Web.ApplicationInsightsHttpModule, Microsoft.AI.Web" preCondition="managedHandler" />
  141. </modules>
  142. <validation validateIntegratedModeConfiguration="false" />
  143. <handlers>
  144. <remove name="ExtensionlessUrlHandler-Integrated-4.0" />
  145. <remove name="OPTIONSVerbHandler" />
  146. <remove name="TRACEVerbHandler" />
  147. <add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
  148. </handlers>
  149. </system.webServer>
  150. <runtime>
  151. <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
  152. <dependentAssembly>
  153. <assemblyIdentity name="Microsoft.Owin.Security" publicKeyToken="31bf3856ad364e35" />
  154. <bindingRedirect oldVersion="0.0.0.0-3.1.0.0" newVersion="3.1.0.0" />
  155. </dependentAssembly>
  156. <dependentAssembly>
  157. <assemblyIdentity name="Microsoft.Owin.Security.OAuth" publicKeyToken="31bf3856ad364e35" />
  158. <bindingRedirect oldVersion="0.0.0.0-3.1.0.0" newVersion="3.1.0.0" />
  159. </dependentAssembly>
  160. <dependentAssembly>
  161. <assemblyIdentity name="Microsoft.Owin.Security.Cookies" publicKeyToken="31bf3856ad364e35" />
  162. <bindingRedirect oldVersion="0.0.0.0-3.1.0.0" newVersion="3.1.0.0" />
  163. </dependentAssembly>
  164. <dependentAssembly>
  165. <assemblyIdentity name="Microsoft.Owin" publicKeyToken="31bf3856ad364e35" />
  166. <bindingRedirect oldVersion="0.0.0.0-3.1.0.0" newVersion="3.1.0.0" />
  167. </dependentAssembly>
  168. <dependentAssembly>
  169. <assemblyIdentity name="Newtonsoft.Json" culture="neutral" publicKeyToken="30ad4fe6b2a6aeed" />
  170. <bindingRedirect oldVersion="0.0.0.0-11.0.0.0" newVersion="11.0.0.0" />
  171. </dependentAssembly>
  172. <dependentAssembly>
  173. <assemblyIdentity name="System.Web.Optimization" publicKeyToken="31bf3856ad364e35" />
  174. <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="1.1.0.0" />
  175. </dependentAssembly>
  176. <dependentAssembly>
  177. <assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" />
  178. <bindingRedirect oldVersion="0.0.0.0-1.6.5135.21930" newVersion="1.6.5135.21930" />
  179. </dependentAssembly>
  180. <dependentAssembly>
  181. <assemblyIdentity name="DocumentFormat.OpenXml" publicKeyToken="8fb06cb64d019a17" culture="neutral" />
  182. <bindingRedirect oldVersion="0.0.0.0-2.8.0.0" newVersion="2.8.0.0" />
  183. </dependentAssembly>
  184. <dependentAssembly>
  185. <assemblyIdentity name="System.Diagnostics.DiagnosticSource" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
  186. <bindingRedirect oldVersion="0.0.0.0-4.0.2.1" newVersion="4.0.2.1" />
  187. </dependentAssembly>
  188. <dependentAssembly>
  189. <assemblyIdentity name="System.IO.Compression" publicKeyToken="b77a5c561934e089" culture="neutral" />
  190. <bindingRedirect oldVersion="0.0.0.0-4.1.2.0" newVersion="4.1.2.0" />
  191. </dependentAssembly>
  192. <dependentAssembly>
  193. <assemblyIdentity name="FastMember.Signed" publicKeyToken="9e8f22703bef9a29" culture="neutral" />
  194. <bindingRedirect oldVersion="0.0.0.0-1.3.0.0" newVersion="1.3.0.0" />
  195. </dependentAssembly>
  196. <dependentAssembly>
  197. <assemblyIdentity name="System.Net.Http" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
  198. <bindingRedirect oldVersion="0.0.0.0-4.1.1.1" newVersion="4.1.1.1" />
  199. </dependentAssembly>
  200. <dependentAssembly>
  201. <assemblyIdentity name="Antlr3.Runtime" publicKeyToken="eb42632606e9261f" culture="neutral" />
  202. <bindingRedirect oldVersion="0.0.0.0-3.5.0.2" newVersion="3.5.0.2" />
  203. </dependentAssembly>
  204. <dependentAssembly>
  205. <assemblyIdentity name="ToastNotifications" publicKeyToken="e89d9d7314a7c797" culture="neutral" />
  206. <bindingRedirect oldVersion="0.0.0.0-2.2.5.0" newVersion="2.2.5.0" />
  207. </dependentAssembly>
  208. <dependentAssembly>
  209. <assemblyIdentity name="System.Net.Http.Formatting" publicKeyToken="31bf3856ad364e35" culture="neutral" />
  210. <bindingRedirect oldVersion="0.0.0.0-5.2.4.0" newVersion="5.2.4.0" />
  211. </dependentAssembly>
  212. <dependentAssembly>
  213. <assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" />
  214. <bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
  215. </dependentAssembly>
  216. <dependentAssembly>
  217. <assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35" />
  218. <bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
  219. </dependentAssembly>
  220. <dependentAssembly>
  221. <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
  222. <bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="5.2.3.0" />
  223. </dependentAssembly>
  224. <dependentAssembly>
  225. <assemblyIdentity name="System.Web.Http" publicKeyToken="31bf3856ad364e35" culture="neutral" />
  226. <bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="5.2.3.0" />
  227. </dependentAssembly>
  228. <dependentAssembly>
  229. <assemblyIdentity name="System.Security.Cryptography.Algorithms" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
  230. <bindingRedirect oldVersion="0.0.0.0-4.1.0.0" newVersion="4.1.0.0" />
  231. </dependentAssembly>
  232. <dependentAssembly>
  233. <assemblyIdentity name="System.IO.FileSystem" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
  234. <bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" />
  235. </dependentAssembly>
  236. <dependentAssembly>
  237. <assemblyIdentity name="System.Security.Cryptography.Primitives" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
  238. <bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" />
  239. </dependentAssembly>
  240. <dependentAssembly>
  241. <assemblyIdentity name="System.Console" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
  242. <bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" />
  243. </dependentAssembly>
  244. <dependentAssembly>
  245. <assemblyIdentity name="System.IO.FileSystem.Primitives" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
  246. <bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" />
  247. </dependentAssembly>
  248. <dependentAssembly>
  249. <assemblyIdentity name="Microsoft.AspNet.Identity.Core" publicKeyToken="31bf3856ad364e35" culture="neutral" />
  250. <bindingRedirect oldVersion="0.0.0.0-2.0.0.0" newVersion="2.0.0.0" />
  251. </dependentAssembly>
  252. </assemblyBinding>
  253. </runtime>
  254. <entityFramework>
  255. <defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
  256. <parameters>
  257. <parameter value="mssqllocaldb" />
  258. </parameters>
  259. </defaultConnectionFactory>
  260. <providers>
  261. <provider invariantName="System.Data.SQLite.EF6" type="System.Data.SQLite.EF6.SQLiteProviderServices, System.Data.SQLite.EF6, Version=1.0.91.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139" />
  262. <provider invariantName="System.Data.SQLite" type="System.Data.SQLite.EF6.SQLiteProviderServices, System.Data.SQLite.EF6, Version=1.0.91.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139" />
  263. <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
  264. </providers>
  265. </entityFramework>
  266. <!--<location path="ImportaContratosAux">-->
  267. <!-- <system.web>-->
  268. <!-- 50MB in kilobytes, default is 4096 or 4MB executionTimeout="3600"-->
  269. <!-- <httpRuntime maxRequestLength="51200" />
  270. </system.web>-->
  271. <!-- <system.webServer>
  272. <security>
  273. <requestFiltering>-->
  274. <!-- 50MB in bytes, default is 30000000 or approx. 28.6102 Mb-->
  275. <!-- <requestLimits maxAllowedContentLength="52428800" />
  276.  
  277. </requestFiltering>
  278. </security>
  279. </system.webServer>-->
  280. <!-- </location>-->
  281. <system.data>
  282. <DbProviderFactories>
  283. <remove invariant="System.Data.SQLite.EF6" />
  284. <add name="SQLite Data Provider (Entity Framework 6)" invariant="System.Data.SQLite.EF6" description=".NET Framework Data Provider for SQLite (Entity Framework 6)" type="System.Data.SQLite.EF6.SQLiteProviderFactory, System.Data.SQLite.EF6" />
  285. <remove invariant="System.Data.SQLite" />
  286. <add name="SQLite Data Provider" invariant="System.Data.SQLite" description=".NET Framework Data Provider for SQLite" type="System.Data.SQLite.SQLiteFactory, System.Data.SQLite" />
  287. </DbProviderFactories>
  288. </system.data>
  289. <system.codedom>
  290. <compilers>
  291. <compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.7.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:default /nowarn:1659;1699;1701" />
  292. <compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.VBCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.7.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:default /nowarn:41008 /define:_MYTYPE="Web" /optionInfer+" />
  293. </compilers>
  294. </system.codedom>
  295. </configuration>
Add Comment
Please, Sign In to add comment