PageRenderTime 63ms CodeModel.GetById 24ms RepoModel.GetById 0ms app.codeStats 2ms

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

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

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