PageRenderTime 51ms CodeModel.GetById 18ms RepoModel.GetById 1ms app.codeStats 0ms

/glados_proto/glados_proto/Generated_Code/glados.Web.g.cs.orig

https://bitbucket.org/s_vladimir/tsys
Unknown | 5494 lines | 4913 code | 581 blank | 0 comment | 0 complexity | d0a425f5f416f1df4fc33a82a4d51803 MD5 | raw file

Large files files are truncated, but you can click here to view the full file

  1. //------------------------------------------------------------------------------
  2. // <auto-generated>
  3. // This code was generated by a tool.
  4. <<<<<<< local
  5. // Runtime Version:4.0.30319.237
  6. =======
  7. // Runtime Version:4.0.30319.1
  8. >>>>>>> other
  9. //
  10. // Changes to this file may cause incorrect behavior and will be lost if
  11. // the code is regenerated.
  12. // </auto-generated>
  13. //------------------------------------------------------------------------------
  14. namespace glados
  15. {
  16. using System;
  17. using System.Collections.Generic;
  18. using System.ComponentModel;
  19. using System.ComponentModel.DataAnnotations;
  20. using System.Linq;
  21. using System.ServiceModel.DomainServices;
  22. using System.ServiceModel.DomainServices.Client;
  23. using System.ServiceModel.DomainServices.Client.ApplicationServices;
  24. using glados.Web;
  25. /// <summary>
  26. /// Context for the RIA application.
  27. /// </summary>
  28. /// <remarks>
  29. /// This context extends the base to make application services and types available
  30. /// for consumption from code and xaml.
  31. /// </remarks>
  32. public sealed partial class WebContext : WebContextBase
  33. {
  34. #region Extensibility Method Definitions
  35. /// <summary>
  36. /// This method is invoked from the constructor once initialization is complete and
  37. /// can be used for further object setup.
  38. /// </summary>
  39. partial void OnCreated();
  40. #endregion
  41. /// <summary>
  42. /// Initializes a new instance of the WebContext class.
  43. /// </summary>
  44. public WebContext()
  45. {
  46. this.OnCreated();
  47. }
  48. /// <summary>
  49. /// Gets the context that is registered as a lifetime object with the current application.
  50. /// </summary>
  51. /// <exception cref="InvalidOperationException"> is thrown if there is no current application,
  52. /// no contexts have been added, or more than one context has been added.
  53. /// </exception>
  54. /// <seealso cref="System.Windows.Application.ApplicationLifetimeObjects"/>
  55. public new static WebContext Current
  56. {
  57. get
  58. {
  59. return ((WebContext)(WebContextBase.Current));
  60. }
  61. }
  62. /// <summary>
  63. /// Gets a user representing the authenticated identity.
  64. /// </summary>
  65. public new AuthUser User
  66. {
  67. get
  68. {
  69. return ((AuthUser)(base.User));
  70. }
  71. }
  72. }
  73. }
  74. namespace Glados.TestingModule.Interfaces
  75. {
  76. using System;
  77. using System.Collections.Generic;
  78. using System.ComponentModel;
  79. using System.ComponentModel.DataAnnotations;
  80. using System.Linq;
  81. using System.ServiceModel.DomainServices;
  82. using System.ServiceModel.DomainServices.Client;
  83. using System.ServiceModel.DomainServices.Client.ApplicationServices;
  84. public enum ServerStatus
  85. {
  86. Idle = 0,
  87. Busy = 1,
  88. InternalError = 2,
  89. Unavailable = 3,
  90. Down = 4,
  91. }
  92. }
  93. namespace glados.Web
  94. {
  95. using System;
  96. using System.Collections.Generic;
  97. using System.ComponentModel;
  98. using System.ComponentModel.DataAnnotations;
  99. using System.Linq;
  100. using System.Runtime.Serialization;
  101. using System.ServiceModel;
  102. using System.ServiceModel.DomainServices;
  103. using System.ServiceModel.DomainServices.Client;
  104. using System.ServiceModel.DomainServices.Client.ApplicationServices;
  105. using System.ServiceModel.Web;
  106. using System.Xml.Serialization;
  107. /// <summary>
  108. /// The 'Assignment' entity class.
  109. /// </summary>
  110. [DataContract(Namespace="http://schemas.datacontract.org/2004/07/glados.Web")]
  111. public sealed partial class Assignment : Entity
  112. {
  113. private int _id;
  114. private EntityRef<Participation> _participation;
  115. private int _participationId;
  116. private EntityRef<Problem> _problem;
  117. private int _problemId;
  118. private byte[] _state;
  119. private EntityCollection<Submission> _submission;
  120. #region Extensibility Method Definitions
  121. /// <summary>
  122. /// This method is invoked from the constructor once initialization is complete and
  123. /// can be used for further object setup.
  124. /// </summary>
  125. partial void OnCreated();
  126. partial void OnIdChanging(int value);
  127. partial void OnIdChanged();
  128. partial void OnParticipationIdChanging(int value);
  129. partial void OnParticipationIdChanged();
  130. partial void OnProblemIdChanging(int value);
  131. partial void OnProblemIdChanged();
  132. partial void OnStateChanging(byte[] value);
  133. partial void OnStateChanged();
  134. #endregion
  135. /// <summary>
  136. /// Initializes a new instance of the <see cref="Assignment"/> class.
  137. /// </summary>
  138. public Assignment()
  139. {
  140. this.OnCreated();
  141. }
  142. /// <summary>
  143. /// Gets or sets the 'Id' value.
  144. /// </summary>
  145. [DataMember()]
  146. [Editable(false, AllowInitialValue=true)]
  147. [Key()]
  148. [RoundtripOriginal()]
  149. public int Id
  150. {
  151. get
  152. {
  153. return this._id;
  154. }
  155. set
  156. {
  157. if ((this._id != value))
  158. {
  159. this.OnIdChanging(value);
  160. this.ValidateProperty("Id", value);
  161. this._id = value;
  162. this.RaisePropertyChanged("Id");
  163. this.OnIdChanged();
  164. }
  165. }
  166. }
  167. /// <summary>
  168. /// Gets or sets the associated <see cref="Participation"/> entity.
  169. /// </summary>
  170. [Association("Participation_Assignment", "ParticipationId", "Id", IsForeignKey=true)]
  171. [XmlIgnore()]
  172. public Participation Participation
  173. {
  174. get
  175. {
  176. if ((this._participation == null))
  177. {
  178. this._participation = new EntityRef<Participation>(this, "Participation", this.FilterParticipation);
  179. }
  180. return this._participation.Entity;
  181. }
  182. set
  183. {
  184. Participation previous = this.Participation;
  185. if ((previous != value))
  186. {
  187. this.ValidateProperty("Participation", value);
  188. if ((previous != null))
  189. {
  190. this._participation.Entity = null;
  191. previous.Assignment.Remove(this);
  192. }
  193. if ((value != null))
  194. {
  195. this.ParticipationId = value.Id;
  196. }
  197. else
  198. {
  199. this.ParticipationId = default(int);
  200. }
  201. this._participation.Entity = value;
  202. if ((value != null))
  203. {
  204. value.Assignment.Add(this);
  205. }
  206. this.RaisePropertyChanged("Participation");
  207. }
  208. }
  209. }
  210. /// <summary>
  211. /// Gets or sets the 'ParticipationId' value.
  212. /// </summary>
  213. [DataMember()]
  214. [RoundtripOriginal()]
  215. public int ParticipationId
  216. {
  217. get
  218. {
  219. return this._participationId;
  220. }
  221. set
  222. {
  223. if ((this._participationId != value))
  224. {
  225. this.OnParticipationIdChanging(value);
  226. this.RaiseDataMemberChanging("ParticipationId");
  227. this.ValidateProperty("ParticipationId", value);
  228. this._participationId = value;
  229. this.RaiseDataMemberChanged("ParticipationId");
  230. this.OnParticipationIdChanged();
  231. }
  232. }
  233. }
  234. /// <summary>
  235. /// Gets or sets the associated <see cref="Problem"/> entity.
  236. /// </summary>
  237. [Association("Problem_Assignment", "ProblemId", "Id", IsForeignKey=true)]
  238. [XmlIgnore()]
  239. public Problem Problem
  240. {
  241. get
  242. {
  243. if ((this._problem == null))
  244. {
  245. this._problem = new EntityRef<Problem>(this, "Problem", this.FilterProblem);
  246. }
  247. return this._problem.Entity;
  248. }
  249. set
  250. {
  251. Problem previous = this.Problem;
  252. if ((previous != value))
  253. {
  254. this.ValidateProperty("Problem", value);
  255. if ((previous != null))
  256. {
  257. this._problem.Entity = null;
  258. previous.Assignment.Remove(this);
  259. }
  260. if ((value != null))
  261. {
  262. this.ProblemId = value.Id;
  263. }
  264. else
  265. {
  266. this.ProblemId = default(int);
  267. }
  268. this._problem.Entity = value;
  269. if ((value != null))
  270. {
  271. value.Assignment.Add(this);
  272. }
  273. this.RaisePropertyChanged("Problem");
  274. }
  275. }
  276. }
  277. /// <summary>
  278. /// Gets or sets the 'ProblemId' value.
  279. /// </summary>
  280. [DataMember()]
  281. [RoundtripOriginal()]
  282. public int ProblemId
  283. {
  284. get
  285. {
  286. return this._problemId;
  287. }
  288. set
  289. {
  290. if ((this._problemId != value))
  291. {
  292. this.OnProblemIdChanging(value);
  293. this.RaiseDataMemberChanging("ProblemId");
  294. this.ValidateProperty("ProblemId", value);
  295. this._problemId = value;
  296. this.RaiseDataMemberChanged("ProblemId");
  297. this.OnProblemIdChanged();
  298. }
  299. }
  300. }
  301. /// <summary>
  302. /// Gets or sets the 'State' value.
  303. /// </summary>
  304. [DataMember()]
  305. public byte[] State
  306. {
  307. get
  308. {
  309. return this._state;
  310. }
  311. set
  312. {
  313. if ((this._state != value))
  314. {
  315. this.OnStateChanging(value);
  316. this.RaiseDataMemberChanging("State");
  317. this.ValidateProperty("State", value);
  318. this._state = value;
  319. this.RaiseDataMemberChanged("State");
  320. this.OnStateChanged();
  321. }
  322. }
  323. }
  324. /// <summary>
  325. /// Gets the collection of associated <see cref="Submission"/> entity instances.
  326. /// </summary>
  327. [Association("Assignment_Submission", "Id", "AssignmentId")]
  328. [XmlIgnore()]
  329. public EntityCollection<Submission> Submission
  330. {
  331. get
  332. {
  333. if ((this._submission == null))
  334. {
  335. this._submission = new EntityCollection<Submission>(this, "Submission", this.FilterSubmission, this.AttachSubmission, this.DetachSubmission);
  336. }
  337. return this._submission;
  338. }
  339. }
  340. private bool FilterParticipation(Participation entity)
  341. {
  342. return (entity.Id == this.ParticipationId);
  343. }
  344. private bool FilterProblem(Problem entity)
  345. {
  346. return (entity.Id == this.ProblemId);
  347. }
  348. private void AttachSubmission(Submission entity)
  349. {
  350. entity.Assignment = this;
  351. }
  352. private void DetachSubmission(Submission entity)
  353. {
  354. entity.Assignment = null;
  355. }
  356. private bool FilterSubmission(Submission entity)
  357. {
  358. return (entity.AssignmentId == this.Id);
  359. }
  360. /// <summary>
  361. /// Computes a value from the key fields that uniquely identifies this entity instance.
  362. /// </summary>
  363. /// <returns>An object instance that uniquely identifies this entity instance.</returns>
  364. public override object GetIdentity()
  365. {
  366. return this._id;
  367. }
  368. }
  369. /// <summary>
  370. /// The DomainContext corresponding to the 'AuthenticationDomainService' DomainService.
  371. /// </summary>
  372. public sealed partial class AuthenticationDomainContext : global::System.ServiceModel.DomainServices.Client.ApplicationServices.AuthenticationDomainContextBase
  373. {
  374. #region Extensibility Method Definitions
  375. /// <summary>
  376. /// This method is invoked from the constructor once initialization is complete and
  377. /// can be used for further object setup.
  378. /// </summary>
  379. partial void OnCreated();
  380. #endregion
  381. /// <summary>
  382. /// Initializes a new instance of the <see cref="AuthenticationDomainContext"/> class.
  383. /// </summary>
  384. public AuthenticationDomainContext() :
  385. this(new WebDomainClient<IAuthenticationDomainServiceContract>(new Uri("glados-Web-AuthenticationDomainService.svc", UriKind.Relative)))
  386. {
  387. }
  388. /// <summary>
  389. /// Initializes a new instance of the <see cref="AuthenticationDomainContext"/> class with the specified service URI.
  390. /// </summary>
  391. /// <param name="serviceUri">The AuthenticationDomainService service URI.</param>
  392. public AuthenticationDomainContext(Uri serviceUri) :
  393. this(new WebDomainClient<IAuthenticationDomainServiceContract>(serviceUri))
  394. {
  395. }
  396. /// <summary>
  397. /// Initializes a new instance of the <see cref="AuthenticationDomainContext"/> class with the specified <paramref name="domainClient"/>.
  398. /// </summary>
  399. /// <param name="domainClient">The DomainClient instance to use for this DomainContext.</param>
  400. public AuthenticationDomainContext(DomainClient domainClient) :
  401. base(domainClient)
  402. {
  403. this.OnCreated();
  404. }
  405. /// <summary>
  406. /// Gets the set of <see cref="AuthUser"/> entity instances that have been loaded into this <see cref="AuthenticationDomainContext"/> instance.
  407. /// </summary>
  408. public EntitySet<AuthUser> AuthUsers
  409. {
  410. get
  411. {
  412. return base.EntityContainer.GetEntitySet<AuthUser>();
  413. }
  414. }
  415. /// <summary>
  416. /// Gets an EntityQuery instance that can be used to load <see cref="AuthUser"/> entity instances using the 'GetUser' query.
  417. /// </summary>
  418. /// <returns>An EntityQuery that can be loaded to retrieve <see cref="AuthUser"/> entity instances.</returns>
  419. public EntityQuery<AuthUser> GetUserQuery()
  420. {
  421. this.ValidateMethod("GetUserQuery", null);
  422. return base.CreateQuery<AuthUser>("GetUser", null, false, false);
  423. }
  424. /// <summary>
  425. /// Gets an EntityQuery instance that can be used to load <see cref="AuthUser"/> entity instances using the 'Login' query.
  426. /// </summary>
  427. /// <param name="userName">The value for the 'userName' parameter of the query.</param>
  428. /// <param name="password">The value for the 'password' parameter of the query.</param>
  429. /// <param name="isPersistent">The value for the 'isPersistent' parameter of the query.</param>
  430. /// <param name="customData">The value for the 'customData' parameter of the query.</param>
  431. /// <returns>An EntityQuery that can be loaded to retrieve <see cref="AuthUser"/> entity instances.</returns>
  432. public EntityQuery<AuthUser> LoginQuery(string userName, string password, bool isPersistent, string customData)
  433. {
  434. Dictionary<string, object> parameters = new Dictionary<string, object>();
  435. parameters.Add("userName", userName);
  436. parameters.Add("password", password);
  437. parameters.Add("isPersistent", isPersistent);
  438. parameters.Add("customData", customData);
  439. this.ValidateMethod("LoginQuery", parameters);
  440. return base.CreateQuery<AuthUser>("Login", parameters, true, false);
  441. }
  442. /// <summary>
  443. /// Gets an EntityQuery instance that can be used to load <see cref="AuthUser"/> entity instances using the 'Logout' query.
  444. /// </summary>
  445. /// <returns>An EntityQuery that can be loaded to retrieve <see cref="AuthUser"/> entity instances.</returns>
  446. public EntityQuery<AuthUser> LogoutQuery()
  447. {
  448. this.ValidateMethod("LogoutQuery", null);
  449. return base.CreateQuery<AuthUser>("Logout", null, true, false);
  450. }
  451. /// <summary>
  452. /// Creates a new EntityContainer for this DomainContext's EntitySets.
  453. /// </summary>
  454. /// <returns>A new container instance.</returns>
  455. protected override EntityContainer CreateEntityContainer()
  456. {
  457. return new AuthenticationDomainContextEntityContainer();
  458. }
  459. /// <summary>
  460. /// Service contract for the 'AuthenticationDomainService' DomainService.
  461. /// </summary>
  462. [ServiceContract()]
  463. public interface IAuthenticationDomainServiceContract
  464. {
  465. /// <summary>
  466. /// Asynchronously invokes the 'GetUser' operation.
  467. /// </summary>
  468. /// <param name="callback">Callback to invoke on completion.</param>
  469. /// <param name="asyncState">Optional state object.</param>
  470. /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
  471. [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/AuthenticationDomainService/GetUserDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
  472. [OperationContract(AsyncPattern=true, Action="http://tempuri.org/AuthenticationDomainService/GetUser", ReplyAction="http://tempuri.org/AuthenticationDomainService/GetUserResponse")]
  473. [WebGet()]
  474. IAsyncResult BeginGetUser(AsyncCallback callback, object asyncState);
  475. /// <summary>
  476. /// Completes the asynchronous operation begun by 'BeginGetUser'.
  477. /// </summary>
  478. /// <param name="result">The IAsyncResult returned from 'BeginGetUser'.</param>
  479. /// <returns>The 'QueryResult' returned from the 'GetUser' operation.</returns>
  480. QueryResult<AuthUser> EndGetUser(IAsyncResult result);
  481. /// <summary>
  482. /// Asynchronously invokes the 'Login' operation.
  483. /// </summary>
  484. /// <param name="userName">The value for the 'userName' parameter of this action.</param>
  485. /// <param name="password">The value for the 'password' parameter of this action.</param>
  486. /// <param name="isPersistent">The value for the 'isPersistent' parameter of this action.</param>
  487. /// <param name="customData">The value for the 'customData' parameter of this action.</param>
  488. /// <param name="callback">Callback to invoke on completion.</param>
  489. /// <param name="asyncState">Optional state object.</param>
  490. /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
  491. [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/AuthenticationDomainService/LoginDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
  492. [OperationContract(AsyncPattern=true, Action="http://tempuri.org/AuthenticationDomainService/Login", ReplyAction="http://tempuri.org/AuthenticationDomainService/LoginResponse")]
  493. IAsyncResult BeginLogin(string userName, string password, bool isPersistent, string customData, AsyncCallback callback, object asyncState);
  494. /// <summary>
  495. /// Completes the asynchronous operation begun by 'BeginLogin'.
  496. /// </summary>
  497. /// <param name="result">The IAsyncResult returned from 'BeginLogin'.</param>
  498. /// <returns>The 'QueryResult' returned from the 'Login' operation.</returns>
  499. QueryResult<AuthUser> EndLogin(IAsyncResult result);
  500. /// <summary>
  501. /// Asynchronously invokes the 'Logout' operation.
  502. /// </summary>
  503. /// <param name="callback">Callback to invoke on completion.</param>
  504. /// <param name="asyncState">Optional state object.</param>
  505. /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
  506. [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/AuthenticationDomainService/LogoutDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
  507. [OperationContract(AsyncPattern=true, Action="http://tempuri.org/AuthenticationDomainService/Logout", ReplyAction="http://tempuri.org/AuthenticationDomainService/LogoutResponse")]
  508. IAsyncResult BeginLogout(AsyncCallback callback, object asyncState);
  509. /// <summary>
  510. /// Completes the asynchronous operation begun by 'BeginLogout'.
  511. /// </summary>
  512. /// <param name="result">The IAsyncResult returned from 'BeginLogout'.</param>
  513. /// <returns>The 'QueryResult' returned from the 'Logout' operation.</returns>
  514. QueryResult<AuthUser> EndLogout(IAsyncResult result);
  515. /// <summary>
  516. /// Asynchronously invokes the 'SubmitChanges' operation.
  517. /// </summary>
  518. /// <param name="changeSet">The change-set to submit.</param>
  519. /// <param name="callback">Callback to invoke on completion.</param>
  520. /// <param name="asyncState">Optional state object.</param>
  521. /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
  522. [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/AuthenticationDomainService/SubmitChangesDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
  523. [OperationContract(AsyncPattern=true, Action="http://tempuri.org/AuthenticationDomainService/SubmitChanges", ReplyAction="http://tempuri.org/AuthenticationDomainService/SubmitChangesResponse")]
  524. IAsyncResult BeginSubmitChanges(IEnumerable<ChangeSetEntry> changeSet, AsyncCallback callback, object asyncState);
  525. /// <summary>
  526. /// Completes the asynchronous operation begun by 'BeginSubmitChanges'.
  527. /// </summary>
  528. /// <param name="result">The IAsyncResult returned from 'BeginSubmitChanges'.</param>
  529. /// <returns>The collection of change-set entry elements returned from 'SubmitChanges'.</returns>
  530. IEnumerable<ChangeSetEntry> EndSubmitChanges(IAsyncResult result);
  531. }
  532. internal sealed class AuthenticationDomainContextEntityContainer : EntityContainer
  533. {
  534. public AuthenticationDomainContextEntityContainer()
  535. {
  536. this.CreateEntitySet<AuthUser>(EntitySetOperations.Edit);
  537. }
  538. }
  539. }
  540. /// <summary>
  541. /// The 'AuthUser' entity class.
  542. /// </summary>
  543. [DataContract(Namespace="http://schemas.datacontract.org/2004/07/glados.Web")]
  544. public sealed partial class AuthUser : Entity, global::System.Security.Principal.IIdentity, global::System.Security.Principal.IPrincipal
  545. {
  546. private string _name = string.Empty;
  547. private IEnumerable<string> _roles;
  548. #region Extensibility Method Definitions
  549. /// <summary>
  550. /// This method is invoked from the constructor once initialization is complete and
  551. /// can be used for further object setup.
  552. /// </summary>
  553. partial void OnCreated();
  554. partial void OnNameChanging(string value);
  555. partial void OnNameChanged();
  556. partial void OnRolesChanging(IEnumerable<string> value);
  557. partial void OnRolesChanged();
  558. #endregion
  559. /// <summary>
  560. /// Initializes a new instance of the <see cref="AuthUser"/> class.
  561. /// </summary>
  562. public AuthUser()
  563. {
  564. this.OnCreated();
  565. }
  566. /// <summary>
  567. /// Gets or sets the 'Name' value.
  568. /// </summary>
  569. [DataMember()]
  570. [Editable(false, AllowInitialValue=true)]
  571. [Key()]
  572. [RoundtripOriginal()]
  573. public string Name
  574. {
  575. get
  576. {
  577. return this._name;
  578. }
  579. set
  580. {
  581. if ((this._name != value))
  582. {
  583. this.OnNameChanging(value);
  584. this.ValidateProperty("Name", value);
  585. this._name = value;
  586. this.RaisePropertyChanged("Name");
  587. this.OnNameChanged();
  588. this.RaisePropertyChanged("IsAuthenticated");
  589. }
  590. }
  591. }
  592. /// <summary>
  593. /// Gets or sets the 'Roles' value.
  594. /// </summary>
  595. [DataMember()]
  596. [Editable(false)]
  597. public IEnumerable<string> Roles
  598. {
  599. get
  600. {
  601. return this._roles;
  602. }
  603. set
  604. {
  605. if ((this._roles != value))
  606. {
  607. this.OnRolesChanging(value);
  608. this.ValidateProperty("Roles", value);
  609. this._roles = value;
  610. this.RaisePropertyChanged("Roles");
  611. this.OnRolesChanged();
  612. }
  613. }
  614. }
  615. string global::System.Security.Principal.IIdentity.AuthenticationType
  616. {
  617. get
  618. {
  619. return string.Empty;
  620. }
  621. }
  622. /// <summary>
  623. /// Gets a value indicating whether the identity is authenticated.
  624. /// </summary>
  625. /// <remarks>
  626. /// This value is <c>true</c> if <see cref="Name"/> is not <c>null</c> or empty.
  627. /// </remarks>
  628. public bool IsAuthenticated
  629. {
  630. get
  631. {
  632. return (true != string.IsNullOrEmpty(this.Name));
  633. }
  634. }
  635. string global::System.Security.Principal.IIdentity.Name
  636. {
  637. get
  638. {
  639. return this.Name;
  640. }
  641. }
  642. global::System.Security.Principal.IIdentity global::System.Security.Principal.IPrincipal.Identity
  643. {
  644. get
  645. {
  646. return this;
  647. }
  648. }
  649. /// <summary>
  650. /// Computes a value from the key fields that uniquely identifies this entity instance.
  651. /// </summary>
  652. /// <returns>An object instance that uniquely identifies this entity instance.</returns>
  653. public override object GetIdentity()
  654. {
  655. return this._name;
  656. }
  657. /// <summary>
  658. /// Return whether the principal is in the role.
  659. /// </summary>
  660. /// <remarks>
  661. /// Returns whether the specified role is contained in the roles.
  662. /// This implementation is case sensitive.
  663. /// </remarks>
  664. /// <param name="role">The name of the role for which to check membership.</param>
  665. /// <returns>Whether the principal is in the role.</returns>
  666. public bool IsInRole(string role)
  667. {
  668. if ((this.Roles == null))
  669. {
  670. return false;
  671. }
  672. return global::System.Linq.Enumerable.Contains(this.Roles, role);
  673. }
  674. }
  675. /// <summary>
  676. /// The 'Course' entity class.
  677. /// </summary>
  678. [DataContract(Namespace="http://schemas.datacontract.org/2004/07/glados.Web")]
  679. public sealed partial class Course : Entity
  680. {
  681. private int _id;
  682. private string _name;
  683. private EntityCollection<Participation> _participation;
  684. private byte[] _state;
  685. private string _type;
  686. #region Extensibility Method Definitions
  687. /// <summary>
  688. /// This method is invoked from the constructor once initialization is complete and
  689. /// can be used for further object setup.
  690. /// </summary>
  691. partial void OnCreated();
  692. partial void OnIdChanging(int value);
  693. partial void OnIdChanged();
  694. partial void OnNameChanging(string value);
  695. partial void OnNameChanged();
  696. partial void OnStateChanging(byte[] value);
  697. partial void OnStateChanged();
  698. partial void OnTypeChanging(string value);
  699. partial void OnTypeChanged();
  700. #endregion
  701. /// <summary>
  702. /// Initializes a new instance of the <see cref="Course"/> class.
  703. /// </summary>
  704. public Course()
  705. {
  706. this.OnCreated();
  707. }
  708. /// <summary>
  709. /// Gets or sets the 'Id' value.
  710. /// </summary>
  711. [DataMember()]
  712. [Editable(false, AllowInitialValue=true)]
  713. [Key()]
  714. [RoundtripOriginal()]
  715. public int Id
  716. {
  717. get
  718. {
  719. return this._id;
  720. }
  721. set
  722. {
  723. if ((this._id != value))
  724. {
  725. this.OnIdChanging(value);
  726. this.ValidateProperty("Id", value);
  727. this._id = value;
  728. this.RaisePropertyChanged("Id");
  729. this.OnIdChanged();
  730. }
  731. }
  732. }
  733. /// <summary>
  734. /// Gets or sets the 'Name' value.
  735. /// </summary>
  736. [DataMember()]
  737. [Required()]
  738. public string Name
  739. {
  740. get
  741. {
  742. return this._name;
  743. }
  744. set
  745. {
  746. if ((this._name != value))
  747. {
  748. this.OnNameChanging(value);
  749. this.RaiseDataMemberChanging("Name");
  750. this.ValidateProperty("Name", value);
  751. this._name = value;
  752. this.RaiseDataMemberChanged("Name");
  753. this.OnNameChanged();
  754. }
  755. }
  756. }
  757. /// <summary>
  758. /// Gets the collection of associated <see cref="Participation"/> entity instances.
  759. /// </summary>
  760. [Association("Course_Participation", "Id", "CourseId")]
  761. [XmlIgnore()]
  762. public EntityCollection<Participation> Participation
  763. {
  764. get
  765. {
  766. if ((this._participation == null))
  767. {
  768. this._participation = new EntityCollection<Participation>(this, "Participation", this.FilterParticipation, this.AttachParticipation, this.DetachParticipation);
  769. }
  770. return this._participation;
  771. }
  772. }
  773. /// <summary>
  774. /// Gets or sets the 'State' value.
  775. /// </summary>
  776. [DataMember()]
  777. public byte[] State
  778. {
  779. get
  780. {
  781. return this._state;
  782. }
  783. set
  784. {
  785. if ((this._state != value))
  786. {
  787. this.OnStateChanging(value);
  788. this.RaiseDataMemberChanging("State");
  789. this.ValidateProperty("State", value);
  790. this._state = value;
  791. this.RaiseDataMemberChanged("State");
  792. this.OnStateChanged();
  793. }
  794. }
  795. }
  796. /// <summary>
  797. /// Gets or sets the 'Type' value.
  798. /// </summary>
  799. [DataMember()]
  800. public string Type
  801. {
  802. get
  803. {
  804. return this._type;
  805. }
  806. set
  807. {
  808. if ((this._type != value))
  809. {
  810. this.OnTypeChanging(value);
  811. this.RaiseDataMemberChanging("Type");
  812. this.ValidateProperty("Type", value);
  813. this._type = value;
  814. this.RaiseDataMemberChanged("Type");
  815. this.OnTypeChanged();
  816. }
  817. }
  818. }
  819. private void AttachParticipation(Participation entity)
  820. {
  821. entity.Course = this;
  822. }
  823. private void DetachParticipation(Participation entity)
  824. {
  825. entity.Course = null;
  826. }
  827. private bool FilterParticipation(Participation entity)
  828. {
  829. return (entity.CourseId == this.Id);
  830. }
  831. /// <summary>
  832. /// Computes a value from the key fields that uniquely identifies this entity instance.
  833. /// </summary>
  834. /// <returns>An object instance that uniquely identifies this entity instance.</returns>
  835. public override object GetIdentity()
  836. {
  837. return this._id;
  838. }
  839. }
  840. /// <summary>
  841. /// The 'Group' entity class.
  842. /// </summary>
  843. [DataContract(Namespace="http://schemas.datacontract.org/2004/07/glados.Web")]
  844. public sealed partial class Group : Entity
  845. {
  846. private int _id;
  847. private EntityCollection<Membership> _membership;
  848. private string _name;
  849. #region Extensibility Method Definitions
  850. /// <summary>
  851. /// This method is invoked from the constructor once initialization is complete and
  852. /// can be used for further object setup.
  853. /// </summary>
  854. partial void OnCreated();
  855. partial void OnIdChanging(int value);
  856. partial void OnIdChanged();
  857. partial void OnNameChanging(string value);
  858. partial void OnNameChanged();
  859. #endregion
  860. /// <summary>
  861. /// Initializes a new instance of the <see cref="Group"/> class.
  862. /// </summary>
  863. public Group()
  864. {
  865. this.OnCreated();
  866. }
  867. /// <summary>
  868. /// Gets or sets the 'Id' value.
  869. /// </summary>
  870. [DataMember()]
  871. [Editable(false, AllowInitialValue=true)]
  872. [Key()]
  873. [RoundtripOriginal()]
  874. public int Id
  875. {
  876. get
  877. {
  878. return this._id;
  879. }
  880. set
  881. {
  882. if ((this._id != value))
  883. {
  884. this.OnIdChanging(value);
  885. this.ValidateProperty("Id", value);
  886. this._id = value;
  887. this.RaisePropertyChanged("Id");
  888. this.OnIdChanged();
  889. }
  890. }
  891. }
  892. /// <summary>
  893. /// Gets the collection of associated <see cref="Membership"/> entity instances.
  894. /// </summary>
  895. [Association("Group_Membership", "Id", "GroupId")]
  896. [XmlIgnore()]
  897. public EntityCollection<Membership> Membership
  898. {
  899. get
  900. {
  901. if ((this._membership == null))
  902. {
  903. this._membership = new EntityCollection<Membership>(this, "Membership", this.FilterMembership, this.AttachMembership, this.DetachMembership);
  904. }
  905. return this._membership;
  906. }
  907. }
  908. /// <summary>
  909. /// Gets or sets the 'Name' value.
  910. /// </summary>
  911. [DataMember()]
  912. [Required()]
  913. public string Name
  914. {
  915. get
  916. {
  917. return this._name;
  918. }
  919. set
  920. {
  921. if ((this._name != value))
  922. {
  923. this.OnNameChanging(value);
  924. this.RaiseDataMemberChanging("Name");
  925. this.ValidateProperty("Name", value);
  926. this._name = value;
  927. this.RaiseDataMemberChanged("Name");
  928. this.OnNameChanged();
  929. }
  930. }
  931. }
  932. private void AttachMembership(Membership entity)
  933. {
  934. entity.Group = this;
  935. }
  936. private void DetachMembership(Membership entity)
  937. {
  938. entity.Group = null;
  939. }
  940. private bool FilterMembership(Membership entity)
  941. {
  942. return (entity.GroupId == this.Id);
  943. }
  944. /// <summary>
  945. /// Computes a value from the key fields that uniquely identifies this entity instance.
  946. /// </summary>
  947. /// <returns>An object instance that uniquely identifies this entity instance.</returns>
  948. public override object GetIdentity()
  949. {
  950. return this._id;
  951. }
  952. }
  953. /// <summary>
  954. /// The 'Membership' entity class.
  955. /// </summary>
  956. [DataContract(Namespace="http://schemas.datacontract.org/2004/07/glados.Web")]
  957. public sealed partial class Membership : Entity
  958. {
  959. private EntityRef<Group> _group;
  960. private int _groupId;
  961. private int _id;
  962. private EntityRef<User> _user;
  963. private int _userId;
  964. #region Extensibility Method Definitions
  965. /// <summary>
  966. /// This method is invoked from the constructor once initialization is complete and
  967. /// can be used for further object setup.
  968. /// </summary>
  969. partial void OnCreated();
  970. partial void OnGroupIdChanging(int value);
  971. partial void OnGroupIdChanged();
  972. partial void OnIdChanging(int value);
  973. partial void OnIdChanged();
  974. partial void OnUserIdChanging(int value);
  975. partial void OnUserIdChanged();
  976. #endregion
  977. /// <summary>
  978. /// Initializes a new instance of the <see cref="Membership"/> class.
  979. /// </summary>
  980. public Membership()
  981. {
  982. this.OnCreated();
  983. }
  984. /// <summary>
  985. /// Gets or sets the associated <see cref="Group"/> entity.
  986. /// </summary>
  987. [Association("Group_Membership", "GroupId", "Id", IsForeignKey=true)]
  988. [XmlIgnore()]
  989. public Group Group
  990. {
  991. get
  992. {
  993. if ((this._group == null))
  994. {
  995. this._group = new EntityRef<Group>(this, "Group", this.FilterGroup);
  996. }
  997. return this._group.Entity;
  998. }
  999. set
  1000. {
  1001. Group previous = this.Group;
  1002. if ((previous != value))
  1003. {
  1004. this.ValidateProperty("Group", value);
  1005. if ((previous != null))
  1006. {
  1007. this._group.Entity = null;
  1008. previous.Membership.Remove(this);
  1009. }
  1010. if ((value != null))
  1011. {
  1012. this.GroupId = value.Id;
  1013. }
  1014. else
  1015. {
  1016. this.GroupId = default(int);
  1017. }
  1018. this._group.Entity = value;
  1019. if ((value != null))
  1020. {
  1021. value.Membership.Add(this);
  1022. }
  1023. this.RaisePropertyChanged("Group");
  1024. }
  1025. }
  1026. }
  1027. /// <summary>
  1028. /// Gets or sets the 'GroupId' value.
  1029. /// </summary>
  1030. [DataMember()]
  1031. [RoundtripOriginal()]
  1032. public int GroupId
  1033. {
  1034. get
  1035. {
  1036. return this._groupId;
  1037. }
  1038. set
  1039. {
  1040. if ((this._groupId != value))
  1041. {
  1042. this.OnGroupIdChanging(value);
  1043. this.RaiseDataMemberChanging("GroupId");
  1044. this.ValidateProperty("GroupId", value);
  1045. this._groupId = value;
  1046. this.RaiseDataMemberChanged("GroupId");
  1047. this.OnGroupIdChanged();
  1048. }
  1049. }
  1050. }
  1051. /// <summary>
  1052. /// Gets or sets the 'Id' value.
  1053. /// </summary>
  1054. [DataMember()]
  1055. [Editable(false, AllowInitialValue=true)]
  1056. [Key()]
  1057. [RoundtripOriginal()]
  1058. public int Id
  1059. {
  1060. get
  1061. {
  1062. return this._id;
  1063. }
  1064. set
  1065. {
  1066. if ((this._id != value))
  1067. {
  1068. this.OnIdChanging(value);
  1069. this.ValidateProperty("Id", value);
  1070. this._id = value;
  1071. this.RaisePropertyChanged("Id");
  1072. this.OnIdChanged();
  1073. }
  1074. }
  1075. }
  1076. /// <summary>
  1077. /// Gets or sets the associated <see cref="User"/> entity.
  1078. /// </summary>
  1079. [Association("User_Membership", "UserId", "Id", IsForeignKey=true)]
  1080. [XmlIgnore()]
  1081. public User User
  1082. {
  1083. get
  1084. {
  1085. if ((this._user == null))
  1086. {
  1087. this._user = new EntityRef<User>(this, "User", this.FilterUser);
  1088. }
  1089. return this._user.Entity;
  1090. }
  1091. set
  1092. {
  1093. User previous = this.User;
  1094. if ((previous != value))
  1095. {
  1096. this.ValidateProperty("User", value);
  1097. if ((previous != null))
  1098. {
  1099. this._user.Entity = null;
  1100. previous.Membership.Remove(this);
  1101. }
  1102. if ((value != null))
  1103. {
  1104. this.UserId = value.Id;
  1105. }
  1106. else
  1107. {
  1108. this.UserId = default(int);
  1109. }
  1110. this._user.Entity = value;
  1111. if ((value != null))
  1112. {
  1113. value.Membership.Add(this);
  1114. }
  1115. this.RaisePropertyChanged("User");
  1116. }
  1117. }
  1118. }
  1119. /// <summary>
  1120. /// Gets or sets the 'UserId' value.
  1121. /// </summary>
  1122. [DataMember()]
  1123. [RoundtripOriginal()]
  1124. public int UserId
  1125. {
  1126. get
  1127. {
  1128. return this._userId;
  1129. }
  1130. set
  1131. {
  1132. if ((this._userId != value))
  1133. {
  1134. this.OnUserIdChanging(value);
  1135. this.RaiseDataMemberChanging("UserId");
  1136. this.ValidateProperty("UserId", value);
  1137. this._userId = value;
  1138. this.RaiseDataMemberChanged("UserId");
  1139. this.OnUserIdChanged();
  1140. }
  1141. }
  1142. }
  1143. private bool FilterGroup(Group entity)
  1144. {
  1145. return (entity.Id == this.GroupId);
  1146. }
  1147. private bool FilterUser(User entity)
  1148. {
  1149. return (entity.Id == this.UserId);
  1150. }
  1151. /// <summary>
  1152. /// Computes a value from the key fields that uniquely identifies this entity instance.
  1153. /// </summary>
  1154. /// <returns>An object instance that uniquely identifies this entity instance.</returns>
  1155. public override object GetIdentity()
  1156. {
  1157. return this._id;
  1158. }
  1159. }
  1160. /// <summary>
  1161. /// The 'Message' entity class.
  1162. /// </summary>
  1163. [DataContract(Namespace="http://schemas.datacontract.org/2004/07/glados.Web")]
  1164. public sealed partial class Message : Entity
  1165. {
  1166. private int _id;
  1167. private int _receiverId;
  1168. private int _senderId;
  1169. private DateTime _sentTime;
  1170. private int _status;
  1171. private string _subject;
  1172. private string _text;
  1173. #region Extensibility Method Definitions
  1174. /// <summary>
  1175. /// This method is invoked from the constructor once initialization is complete and
  1176. /// can be used for further object setup.
  1177. /// </summary>
  1178. partial void OnCreated();
  1179. partial void OnIdChanging(int value);
  1180. partial void OnIdChanged();
  1181. partial void OnReceiverIdChanging(int value);
  1182. partial void OnReceiverIdChanged();
  1183. partial void OnSenderIdChanging(int value);
  1184. partial void OnSenderIdChanged();
  1185. partial void OnSentTimeChanging(DateTime value);
  1186. partial void OnSentTimeChanged();
  1187. partial void OnStatusChanging(int value);
  1188. partial void OnStatusChanged();
  1189. partial void OnSubjectChanging(string value);
  1190. partial void OnSubjectChanged();
  1191. partial void OnTextChanging(string value);
  1192. partial void OnTextChanged();
  1193. #endregion
  1194. /// <summary>
  1195. /// Initializes a new instance of the <see cref="Message"/> class.
  1196. /// </summary>
  1197. public Message()
  1198. {
  1199. this.OnCreated();
  1200. }
  1201. /// <summary>
  1202. /// Gets or sets the 'Id' value.
  1203. /// </summary>
  1204. // The following attributes were not generated:
  1205. //
  1206. // - The attribute 'System.ComponentModel.DataAnnotations.DatabaseGeneratedAttribute' is not visible in the client project 'glados.UI'. Are you missing an assembly reference?
  1207. // [DatabaseGeneratedAttribute(Identity)]
  1208. //
  1209. [DataMember()]
  1210. [Editable(false, AllowInitialValue=true)]
  1211. [Key()]
  1212. [RoundtripOriginal()]
  1213. public int Id
  1214. {
  1215. get
  1216. {
  1217. return this._id;
  1218. }
  1219. set
  1220. {
  1221. if ((this._id != value))
  1222. {
  1223. this.OnIdChanging(value);
  1224. this.ValidateProperty("Id", value);
  1225. this._id = value;
  1226. this.RaisePropertyChanged("Id");
  1227. this.OnIdChanged();
  1228. }
  1229. }
  1230. }
  1231. /// <summary>
  1232. /// Gets or sets the 'ReceiverId' value.
  1233. /// </summary>
  1234. [DataMember()]
  1235. [RoundtripOriginal()]
  1236. public int ReceiverId
  1237. {
  1238. get
  1239. {
  1240. return this._receiverId;
  1241. }
  1242. set
  1243. {
  1244. if ((this._receiverId != value))
  1245. {
  1246. this.OnReceiverIdChanging(value);
  1247. this.RaiseDataMemberChanging("ReceiverId");
  1248. this.ValidateProperty("ReceiverId", value);
  1249. this._receiverId = value;
  1250. this.RaiseDataMemberChanged("ReceiverId");
  1251. this.OnReceiverIdChanged();
  1252. }
  1253. }
  1254. }
  1255. /// <summary>
  1256. /// Gets or sets the 'SenderId' value.
  1257. /// </summary>
  1258. [DataMember()]
  1259. [RoundtripOriginal()]
  1260. public int SenderId
  1261. {
  1262. get
  1263. {
  1264. return this._senderId;
  1265. }
  1266. set
  1267. {
  1268. if ((this._senderId != value))
  1269. {
  1270. this.OnSenderIdChanging(value);
  1271. this.RaiseDataMemberChanging("SenderId");
  1272. this.ValidateProperty("SenderId", value);
  1273. this._senderId = value;
  1274. this.RaiseDataMemberChanged("SenderId");
  1275. this.OnSenderIdChanged();

Large files files are truncated, but you can click here to view the full file