PageRenderTime 73ms CodeModel.GetById 25ms RepoModel.GetById 0ms app.codeStats 0ms

/App.Account/DataAccess/SqlServer/AccountRepository.designer.cs

#
C# | 597 lines | 518 code | 70 blank | 9 comment | 50 complexity | 20ef73863a5b60c38190024e60bd7003 MD5 | raw file
Possible License(s): MIT
  1. #pragma warning disable 1591
  2. //------------------------------------------------------------------------------
  3. // <auto-generated>
  4. // This code was generated by a tool.
  5. // Runtime Version:2.0.50727.3053
  6. //
  7. // Changes to this file may cause incorrect behavior and will be lost if
  8. // the code is regenerated.
  9. // </auto-generated>
  10. //------------------------------------------------------------------------------
  11. namespace App.Account.DataAccess.SqlServer
  12. {
  13. using System.Data.Linq;
  14. using System.Data.Linq.Mapping;
  15. using System.Data;
  16. using System.Collections.Generic;
  17. using System.Reflection;
  18. using System.Linq;
  19. using System.Linq.Expressions;
  20. [System.Data.Linq.Mapping.DatabaseAttribute(Name="Unifico")]
  21. public partial class AccountRepositoryDataContext : System.Data.Linq.DataContext
  22. {
  23. private static System.Data.Linq.Mapping.MappingSource mappingSource = new AttributeMappingSource();
  24. #region Extensibility Method Definitions
  25. partial void OnCreated();
  26. partial void InsertRole(App.Account.DataAccess.SqlServer.Models.Role instance);
  27. partial void UpdateRole(App.Account.DataAccess.SqlServer.Models.Role instance);
  28. partial void DeleteRole(App.Account.DataAccess.SqlServer.Models.Role instance);
  29. partial void InsertUser(App.Account.DataAccess.SqlServer.Models.User instance);
  30. partial void UpdateUser(App.Account.DataAccess.SqlServer.Models.User instance);
  31. partial void DeleteUser(App.Account.DataAccess.SqlServer.Models.User instance);
  32. partial void InsertUsersRole(App.Account.DataAccess.SqlServer.Models.UsersRole instance);
  33. partial void UpdateUsersRole(App.Account.DataAccess.SqlServer.Models.UsersRole instance);
  34. partial void DeleteUsersRole(App.Account.DataAccess.SqlServer.Models.UsersRole instance);
  35. #endregion
  36. public AccountRepositoryDataContext() :
  37. base(global::App.Account.Properties.Settings.Default.Connection, mappingSource)
  38. {
  39. OnCreated();
  40. }
  41. public AccountRepositoryDataContext(string connection) :
  42. base(connection, mappingSource)
  43. {
  44. OnCreated();
  45. }
  46. public AccountRepositoryDataContext(System.Data.IDbConnection connection) :
  47. base(connection, mappingSource)
  48. {
  49. OnCreated();
  50. }
  51. public AccountRepositoryDataContext(string connection, System.Data.Linq.Mapping.MappingSource mappingSource) :
  52. base(connection, mappingSource)
  53. {
  54. OnCreated();
  55. }
  56. public AccountRepositoryDataContext(System.Data.IDbConnection connection, System.Data.Linq.Mapping.MappingSource mappingSource) :
  57. base(connection, mappingSource)
  58. {
  59. OnCreated();
  60. }
  61. public System.Data.Linq.Table<App.Account.DataAccess.SqlServer.Models.Role> Roles
  62. {
  63. get
  64. {
  65. return this.GetTable<App.Account.DataAccess.SqlServer.Models.Role>();
  66. }
  67. }
  68. public System.Data.Linq.Table<App.Account.DataAccess.SqlServer.Models.User> Users
  69. {
  70. get
  71. {
  72. return this.GetTable<App.Account.DataAccess.SqlServer.Models.User>();
  73. }
  74. }
  75. public System.Data.Linq.Table<App.Account.DataAccess.SqlServer.Models.UsersRole> UsersRoles
  76. {
  77. get
  78. {
  79. return this.GetTable<App.Account.DataAccess.SqlServer.Models.UsersRole>();
  80. }
  81. }
  82. }
  83. }
  84. namespace App.Account.DataAccess.SqlServer.Models
  85. {
  86. using System.Data.Linq;
  87. using System.Data.Linq.Mapping;
  88. using System.ComponentModel;
  89. using System;
  90. [Table(Name="dbo.Role")]
  91. public partial class Role : INotifyPropertyChanging, INotifyPropertyChanged
  92. {
  93. private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
  94. private System.Guid _RoleID;
  95. private string _Name;
  96. private int _Level;
  97. private EntitySet<UsersRole> _UsersRoles;
  98. #region Extensibility Method Definitions
  99. partial void OnLoaded();
  100. partial void OnValidate(System.Data.Linq.ChangeAction action);
  101. partial void OnCreated();
  102. partial void OnRoleIDChanging(System.Guid value);
  103. partial void OnRoleIDChanged();
  104. partial void OnNameChanging(string value);
  105. partial void OnNameChanged();
  106. partial void OnLevelChanging(int value);
  107. partial void OnLevelChanged();
  108. #endregion
  109. public Role()
  110. {
  111. this._UsersRoles = new EntitySet<UsersRole>(new Action<UsersRole>(this.attach_UsersRoles), new Action<UsersRole>(this.detach_UsersRoles));
  112. OnCreated();
  113. }
  114. [Column(Storage="_RoleID", DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true)]
  115. public System.Guid RoleID
  116. {
  117. get
  118. {
  119. return this._RoleID;
  120. }
  121. set
  122. {
  123. if ((this._RoleID != value))
  124. {
  125. this.OnRoleIDChanging(value);
  126. this.SendPropertyChanging();
  127. this._RoleID = value;
  128. this.SendPropertyChanged("RoleID");
  129. this.OnRoleIDChanged();
  130. }
  131. }
  132. }
  133. [Column(Storage="_Name", DbType="NVarChar(50) NOT NULL", CanBeNull=false)]
  134. public string Name
  135. {
  136. get
  137. {
  138. return this._Name;
  139. }
  140. set
  141. {
  142. if ((this._Name != value))
  143. {
  144. this.OnNameChanging(value);
  145. this.SendPropertyChanging();
  146. this._Name = value;
  147. this.SendPropertyChanged("Name");
  148. this.OnNameChanged();
  149. }
  150. }
  151. }
  152. [Column(Name="[Level]", Storage="_Level", DbType="Int NOT NULL")]
  153. public int Level
  154. {
  155. get
  156. {
  157. return this._Level;
  158. }
  159. set
  160. {
  161. if ((this._Level != value))
  162. {
  163. this.OnLevelChanging(value);
  164. this.SendPropertyChanging();
  165. this._Level = value;
  166. this.SendPropertyChanged("Level");
  167. this.OnLevelChanged();
  168. }
  169. }
  170. }
  171. [Association(Name="Role_UsersRole", Storage="_UsersRoles", ThisKey="RoleID", OtherKey="RoleID")]
  172. public EntitySet<UsersRole> UsersRoles
  173. {
  174. get
  175. {
  176. return this._UsersRoles;
  177. }
  178. set
  179. {
  180. this._UsersRoles.Assign(value);
  181. }
  182. }
  183. public event PropertyChangingEventHandler PropertyChanging;
  184. public event PropertyChangedEventHandler PropertyChanged;
  185. protected virtual void SendPropertyChanging()
  186. {
  187. if ((this.PropertyChanging != null))
  188. {
  189. this.PropertyChanging(this, emptyChangingEventArgs);
  190. }
  191. }
  192. protected virtual void SendPropertyChanged(String propertyName)
  193. {
  194. if ((this.PropertyChanged != null))
  195. {
  196. this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
  197. }
  198. }
  199. private void attach_UsersRoles(UsersRole entity)
  200. {
  201. this.SendPropertyChanging();
  202. entity.Role = this;
  203. }
  204. private void detach_UsersRoles(UsersRole entity)
  205. {
  206. this.SendPropertyChanging();
  207. entity.Role = null;
  208. }
  209. }
  210. [Table(Name="dbo.[User]")]
  211. public partial class User : INotifyPropertyChanging, INotifyPropertyChanged
  212. {
  213. private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
  214. private System.Guid _UserID;
  215. private string _Name;
  216. private string _Password;
  217. private string _Email;
  218. private EntitySet<UsersRole> _UsersRoles;
  219. #region Extensibility Method Definitions
  220. partial void OnLoaded();
  221. partial void OnValidate(System.Data.Linq.ChangeAction action);
  222. partial void OnCreated();
  223. partial void OnUserIDChanging(System.Guid value);
  224. partial void OnUserIDChanged();
  225. partial void OnNameChanging(string value);
  226. partial void OnNameChanged();
  227. partial void OnPasswordChanging(string value);
  228. partial void OnPasswordChanged();
  229. partial void OnEmailChanging(string value);
  230. partial void OnEmailChanged();
  231. #endregion
  232. public User()
  233. {
  234. this._UsersRoles = new EntitySet<UsersRole>(new Action<UsersRole>(this.attach_UsersRoles), new Action<UsersRole>(this.detach_UsersRoles));
  235. OnCreated();
  236. }
  237. [Column(Storage="_UserID", DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true)]
  238. public System.Guid UserID
  239. {
  240. get
  241. {
  242. return this._UserID;
  243. }
  244. set
  245. {
  246. if ((this._UserID != value))
  247. {
  248. this.OnUserIDChanging(value);
  249. this.SendPropertyChanging();
  250. this._UserID = value;
  251. this.SendPropertyChanged("UserID");
  252. this.OnUserIDChanged();
  253. }
  254. }
  255. }
  256. [Column(Storage="_Name", DbType="NVarChar(50) NOT NULL", CanBeNull=false)]
  257. public string Name
  258. {
  259. get
  260. {
  261. return this._Name;
  262. }
  263. set
  264. {
  265. if ((this._Name != value))
  266. {
  267. this.OnNameChanging(value);
  268. this.SendPropertyChanging();
  269. this._Name = value;
  270. this.SendPropertyChanged("Name");
  271. this.OnNameChanged();
  272. }
  273. }
  274. }
  275. [Column(Storage="_Password", DbType="NVarChar(255) NOT NULL", CanBeNull=false)]
  276. public string Password
  277. {
  278. get
  279. {
  280. return this._Password;
  281. }
  282. set
  283. {
  284. if ((this._Password != value))
  285. {
  286. this.OnPasswordChanging(value);
  287. this.SendPropertyChanging();
  288. this._Password = value;
  289. this.SendPropertyChanged("Password");
  290. this.OnPasswordChanged();
  291. }
  292. }
  293. }
  294. [Column(Storage="_Email", DbType="NVarChar(255) NOT NULL", CanBeNull=false)]
  295. public string Email
  296. {
  297. get
  298. {
  299. return this._Email;
  300. }
  301. set
  302. {
  303. if ((this._Email != value))
  304. {
  305. this.OnEmailChanging(value);
  306. this.SendPropertyChanging();
  307. this._Email = value;
  308. this.SendPropertyChanged("Email");
  309. this.OnEmailChanged();
  310. }
  311. }
  312. }
  313. [Association(Name="User_UsersRole", Storage="_UsersRoles", ThisKey="UserID", OtherKey="UserID")]
  314. public EntitySet<UsersRole> UsersRoles
  315. {
  316. get
  317. {
  318. return this._UsersRoles;
  319. }
  320. set
  321. {
  322. this._UsersRoles.Assign(value);
  323. }
  324. }
  325. public event PropertyChangingEventHandler PropertyChanging;
  326. public event PropertyChangedEventHandler PropertyChanged;
  327. protected virtual void SendPropertyChanging()
  328. {
  329. if ((this.PropertyChanging != null))
  330. {
  331. this.PropertyChanging(this, emptyChangingEventArgs);
  332. }
  333. }
  334. protected virtual void SendPropertyChanged(String propertyName)
  335. {
  336. if ((this.PropertyChanged != null))
  337. {
  338. this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
  339. }
  340. }
  341. private void attach_UsersRoles(UsersRole entity)
  342. {
  343. this.SendPropertyChanging();
  344. entity.User = this;
  345. }
  346. private void detach_UsersRoles(UsersRole entity)
  347. {
  348. this.SendPropertyChanging();
  349. entity.User = null;
  350. }
  351. }
  352. [Table(Name="dbo.UsersRoles")]
  353. public partial class UsersRole : INotifyPropertyChanging, INotifyPropertyChanged
  354. {
  355. private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
  356. private System.Guid _UsersRolesID;
  357. private System.Guid _UserID;
  358. private System.Guid _RoleID;
  359. private EntityRef<Role> _Role;
  360. private EntityRef<User> _User;
  361. #region Extensibility Method Definitions
  362. partial void OnLoaded();
  363. partial void OnValidate(System.Data.Linq.ChangeAction action);
  364. partial void OnCreated();
  365. partial void OnUsersRolesIDChanging(System.Guid value);
  366. partial void OnUsersRolesIDChanged();
  367. partial void OnUserIDChanging(System.Guid value);
  368. partial void OnUserIDChanged();
  369. partial void OnRoleIDChanging(System.Guid value);
  370. partial void OnRoleIDChanged();
  371. #endregion
  372. public UsersRole()
  373. {
  374. this._Role = default(EntityRef<Role>);
  375. this._User = default(EntityRef<User>);
  376. OnCreated();
  377. }
  378. [Column(Storage="_UsersRolesID", DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true)]
  379. public System.Guid UsersRolesID
  380. {
  381. get
  382. {
  383. return this._UsersRolesID;
  384. }
  385. set
  386. {
  387. if ((this._UsersRolesID != value))
  388. {
  389. this.OnUsersRolesIDChanging(value);
  390. this.SendPropertyChanging();
  391. this._UsersRolesID = value;
  392. this.SendPropertyChanged("UsersRolesID");
  393. this.OnUsersRolesIDChanged();
  394. }
  395. }
  396. }
  397. [Column(Storage="_UserID", DbType="UniqueIdentifier NOT NULL")]
  398. public System.Guid UserID
  399. {
  400. get
  401. {
  402. return this._UserID;
  403. }
  404. set
  405. {
  406. if ((this._UserID != value))
  407. {
  408. if (this._User.HasLoadedOrAssignedValue)
  409. {
  410. throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
  411. }
  412. this.OnUserIDChanging(value);
  413. this.SendPropertyChanging();
  414. this._UserID = value;
  415. this.SendPropertyChanged("UserID");
  416. this.OnUserIDChanged();
  417. }
  418. }
  419. }
  420. [Column(Storage="_RoleID", DbType="UniqueIdentifier NOT NULL")]
  421. public System.Guid RoleID
  422. {
  423. get
  424. {
  425. return this._RoleID;
  426. }
  427. set
  428. {
  429. if ((this._RoleID != value))
  430. {
  431. if (this._Role.HasLoadedOrAssignedValue)
  432. {
  433. throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
  434. }
  435. this.OnRoleIDChanging(value);
  436. this.SendPropertyChanging();
  437. this._RoleID = value;
  438. this.SendPropertyChanged("RoleID");
  439. this.OnRoleIDChanged();
  440. }
  441. }
  442. }
  443. [Association(Name="Role_UsersRole", Storage="_Role", ThisKey="RoleID", OtherKey="RoleID", IsForeignKey=true)]
  444. public Role Role
  445. {
  446. get
  447. {
  448. return this._Role.Entity;
  449. }
  450. set
  451. {
  452. Role previousValue = this._Role.Entity;
  453. if (((previousValue != value)
  454. || (this._Role.HasLoadedOrAssignedValue == false)))
  455. {
  456. this.SendPropertyChanging();
  457. if ((previousValue != null))
  458. {
  459. this._Role.Entity = null;
  460. previousValue.UsersRoles.Remove(this);
  461. }
  462. this._Role.Entity = value;
  463. if ((value != null))
  464. {
  465. value.UsersRoles.Add(this);
  466. this._RoleID = value.RoleID;
  467. }
  468. else
  469. {
  470. this._RoleID = default(System.Guid);
  471. }
  472. this.SendPropertyChanged("Role");
  473. }
  474. }
  475. }
  476. [Association(Name="User_UsersRole", Storage="_User", ThisKey="UserID", OtherKey="UserID", IsForeignKey=true)]
  477. public User User
  478. {
  479. get
  480. {
  481. return this._User.Entity;
  482. }
  483. set
  484. {
  485. User previousValue = this._User.Entity;
  486. if (((previousValue != value)
  487. || (this._User.HasLoadedOrAssignedValue == false)))
  488. {
  489. this.SendPropertyChanging();
  490. if ((previousValue != null))
  491. {
  492. this._User.Entity = null;
  493. previousValue.UsersRoles.Remove(this);
  494. }
  495. this._User.Entity = value;
  496. if ((value != null))
  497. {
  498. value.UsersRoles.Add(this);
  499. this._UserID = value.UserID;
  500. }
  501. else
  502. {
  503. this._UserID = default(System.Guid);
  504. }
  505. this.SendPropertyChanged("User");
  506. }
  507. }
  508. }
  509. public event PropertyChangingEventHandler PropertyChanging;
  510. public event PropertyChangedEventHandler PropertyChanged;
  511. protected virtual void SendPropertyChanging()
  512. {
  513. if ((this.PropertyChanging != null))
  514. {
  515. this.PropertyChanging(this, emptyChangingEventArgs);
  516. }
  517. }
  518. protected virtual void SendPropertyChanged(String propertyName)
  519. {
  520. if ((this.PropertyChanged != null))
  521. {
  522. this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
  523. }
  524. }
  525. }
  526. }
  527. #pragma warning restore 1591