PageRenderTime 120ms CodeModel.GetById 23ms RepoModel.GetById 2ms app.codeStats 1ms

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

https://bitbucket.org/s_vladimir/tsys
Unknown | 4288 lines | 3835 code | 453 blank | 0 comment | 0 complexity | dad4f27d9ecc35f07cb06d789609b7c5 MD5 | raw file
  1. //------------------------------------------------------------------------------
  2. // <auto-generated>
  3. // This code was generated by a tool.
  4. // Runtime Version:4.0.30319.431
  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 'Participation' entity class.
  1158. /// </summary>
  1159. [DataContract(Namespace="http://schemas.datacontract.org/2004/07/glados.Web")]
  1160. public sealed partial class Participation : Entity
  1161. {
  1162. private EntityCollection<Assignment> _assignment;
  1163. private EntityRef<Course> _course;
  1164. private int _courseId;
  1165. private int _id;
  1166. private byte[] _state;
  1167. private EntityRef<User> _user;
  1168. private int _userId;
  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 OnCourseIdChanging(int value);
  1176. partial void OnCourseIdChanged();
  1177. partial void OnIdChanging(int value);
  1178. partial void OnIdChanged();
  1179. partial void OnStateChanging(byte[] value);
  1180. partial void OnStateChanged();
  1181. partial void OnUserIdChanging(int value);
  1182. partial void OnUserIdChanged();
  1183. #endregion
  1184. /// <summary>
  1185. /// Initializes a new instance of the <see cref="Participation"/> class.
  1186. /// </summary>
  1187. public Participation()
  1188. {
  1189. this.OnCreated();
  1190. }
  1191. /// <summary>
  1192. /// Gets the collection of associated <see cref="Assignment"/> entity instances.
  1193. /// </summary>
  1194. [Association("Participation_Assignment", "Id", "ParticipationId")]
  1195. [XmlIgnore()]
  1196. public EntityCollection<Assignment> Assignment
  1197. {
  1198. get
  1199. {
  1200. if ((this._assignment == null))
  1201. {
  1202. this._assignment = new EntityCollection<Assignment>(this, "Assignment", this.FilterAssignment, this.AttachAssignment, this.DetachAssignment);
  1203. }
  1204. return this._assignment;
  1205. }
  1206. }
  1207. /// <summary>
  1208. /// Gets or sets the associated <see cref="Course"/> entity.
  1209. /// </summary>
  1210. [Association("Course_Participation", "CourseId", "Id", IsForeignKey=true)]
  1211. [XmlIgnore()]
  1212. public Course Course
  1213. {
  1214. get
  1215. {
  1216. if ((this._course == null))
  1217. {
  1218. this._course = new EntityRef<Course>(this, "Course", this.FilterCourse);
  1219. }
  1220. return this._course.Entity;
  1221. }
  1222. set
  1223. {
  1224. Course previous = this.Course;
  1225. if ((previous != value))
  1226. {
  1227. this.ValidateProperty("Course", value);
  1228. if ((previous != null))
  1229. {
  1230. this._course.Entity = null;
  1231. previous.Participation.Remove(this);
  1232. }
  1233. if ((value != null))
  1234. {
  1235. this.CourseId = value.Id;
  1236. }
  1237. else
  1238. {
  1239. this.CourseId = default(int);
  1240. }
  1241. this._course.Entity = value;
  1242. if ((value != null))
  1243. {
  1244. value.Participation.Add(this);
  1245. }
  1246. this.RaisePropertyChanged("Course");
  1247. }
  1248. }
  1249. }
  1250. /// <summary>
  1251. /// Gets or sets the 'CourseId' value.
  1252. /// </summary>
  1253. [DataMember()]
  1254. [RoundtripOriginal()]
  1255. public int CourseId
  1256. {
  1257. get
  1258. {
  1259. return this._courseId;
  1260. }
  1261. set
  1262. {
  1263. if ((this._courseId != value))
  1264. {
  1265. this.OnCourseIdChanging(value);
  1266. this.RaiseDataMemberChanging("CourseId");
  1267. this.ValidateProperty("CourseId", value);
  1268. this._courseId = value;
  1269. this.RaiseDataMemberChanged("CourseId");
  1270. this.OnCourseIdChanged();
  1271. }
  1272. }
  1273. }
  1274. /// <summary>
  1275. /// Gets or sets the 'Id' value.
  1276. /// </summary>
  1277. [DataMember()]
  1278. [Editable(false, AllowInitialValue=true)]
  1279. [Key()]
  1280. [RoundtripOriginal()]
  1281. public int Id
  1282. {
  1283. get
  1284. {
  1285. return this._id;
  1286. }
  1287. set
  1288. {
  1289. if ((this._id != value))
  1290. {
  1291. this.OnIdChanging(value);
  1292. this.ValidateProperty("Id", value);
  1293. this._id = value;
  1294. this.RaisePropertyChanged("Id");
  1295. this.OnIdChanged();
  1296. }
  1297. }
  1298. }
  1299. /// <summary>
  1300. /// Gets or sets the 'State' value.
  1301. /// </summary>
  1302. [DataMember()]
  1303. public byte[] State
  1304. {
  1305. get
  1306. {
  1307. return this._state;
  1308. }
  1309. set
  1310. {
  1311. if ((this._state != value))
  1312. {
  1313. this.OnStateChanging(value);
  1314. this.RaiseDataMemberChanging("State");
  1315. this.ValidateProperty("State", value);
  1316. this._state = value;
  1317. this.RaiseDataMemberChanged("State");
  1318. this.OnStateChanged();
  1319. }
  1320. }
  1321. }
  1322. /// <summary>
  1323. /// Gets or sets the associated <see cref="User"/> entity.
  1324. /// </summary>
  1325. [Association("User_Participation", "UserId", "Id", IsForeignKey=true)]
  1326. [XmlIgnore()]
  1327. public User User
  1328. {
  1329. get
  1330. {
  1331. if ((this._user == null))
  1332. {
  1333. this._user = new EntityRef<User>(this, "User", this.FilterUser);
  1334. }
  1335. return this._user.Entity;
  1336. }
  1337. set
  1338. {
  1339. User previous = this.User;
  1340. if ((previous != value))
  1341. {
  1342. this.ValidateProperty("User", value);
  1343. if ((previous != null))
  1344. {
  1345. this._user.Entity = null;
  1346. previous.Participation.Remove(this);
  1347. }
  1348. if ((value != null))
  1349. {
  1350. this.UserId = value.Id;
  1351. }
  1352. else
  1353. {
  1354. this.UserId = default(int);
  1355. }
  1356. this._user.Entity = value;
  1357. if ((value != null))
  1358. {
  1359. value.Participation.Add(this);
  1360. }
  1361. this.RaisePropertyChanged("User");
  1362. }
  1363. }
  1364. }
  1365. /// <summary>
  1366. /// Gets or sets the 'UserId' value.
  1367. /// </summary>
  1368. [DataMember()]
  1369. [RoundtripOriginal()]
  1370. public int UserId
  1371. {
  1372. get
  1373. {
  1374. return this._userId;
  1375. }
  1376. set
  1377. {
  1378. if ((this._userId != value))
  1379. {
  1380. this.OnUserIdChanging(value);
  1381. this.RaiseDataMemberChanging("UserId");
  1382. this.ValidateProperty("UserId", value);
  1383. this._userId = value;
  1384. this.RaiseDataMemberChanged("UserId");
  1385. this.OnUserIdChanged();
  1386. }
  1387. }
  1388. }
  1389. private void AttachAssignment(Assignment entity)
  1390. {
  1391. entity.Participation = this;
  1392. }
  1393. private void DetachAssignment(Assignment entity)
  1394. {
  1395. entity.Participation = null;
  1396. }
  1397. private bool FilterAssignment(Assignment entity)
  1398. {
  1399. return (entity.ParticipationId == this.Id);
  1400. }
  1401. private bool FilterCourse(Course entity)
  1402. {
  1403. return (entity.Id == this.CourseId);
  1404. }
  1405. private bool FilterUser(User entity)
  1406. {
  1407. return (entity.Id == this.UserId);
  1408. }
  1409. /// <summary>
  1410. /// Computes a value from the key fields that uniquely identifies this entity instance.
  1411. /// </summary>
  1412. /// <returns>An object instance that uniquely identifies this entity instance.</returns>
  1413. public override object GetIdentity()
  1414. {
  1415. return this._id;
  1416. }
  1417. }
  1418. /// <summary>
  1419. /// The 'Problem' entity class.
  1420. /// </summary>
  1421. [DataContract(Namespace="http://schemas.datacontract.org/2004/07/glados.Web")]
  1422. public sealed partial class Problem : Entity
  1423. {
  1424. private EntityCollection<Assignment> _assignment;
  1425. private string _filePath;
  1426. private Nullable<int> _groupId;
  1427. private int _id;
  1428. private string _name;
  1429. private EntityRef<ProblemGroup> _problemGroup;
  1430. #region Extensibility Method Definitions
  1431. /// <summary>
  1432. /// This method is invoked from the constructor once initialization is complete and
  1433. /// can be used for further object setup.
  1434. /// </summary>
  1435. partial void OnCreated();
  1436. partial void OnFilePathChanging(string value);
  1437. partial void OnFilePathChanged();
  1438. partial void OnGroupIdChanging(Nullable<int> value);
  1439. partial void OnGroupIdChanged();
  1440. partial void OnIdChanging(int value);
  1441. partial void OnIdChanged();
  1442. partial void OnNameChanging(string value);
  1443. partial void OnNameChanged();
  1444. #endregion
  1445. /// <summary>
  1446. /// Initializes a new instance of the <see cref="Problem"/> class.
  1447. /// </summary>
  1448. public Problem()
  1449. {
  1450. this.OnCreated();
  1451. }
  1452. /// <summary>
  1453. /// Gets the collection of associated <see cref="Assignment"/> entity instances.
  1454. /// </summary>
  1455. [Association("Problem_Assignment", "Id", "ProblemId")]
  1456. [XmlIgnore()]
  1457. public EntityCollection<Assignment> Assignment
  1458. {
  1459. get
  1460. {
  1461. if ((this._assignment == null))
  1462. {
  1463. this._assignment = new EntityCollection<Assignment>(this, "Assignment", this.FilterAssignment, this.AttachAssignment, this.DetachAssignment);
  1464. }
  1465. return this._assignment;
  1466. }
  1467. }
  1468. /// <summary>
  1469. /// Gets or sets the 'FilePath' value.
  1470. /// </summary>
  1471. [DataMember()]
  1472. public string FilePath
  1473. {
  1474. get
  1475. {
  1476. return this._filePath;
  1477. }
  1478. set
  1479. {
  1480. if ((this._filePath != value))
  1481. {
  1482. this.OnFilePathChanging(value);
  1483. this.RaiseDataMemberChanging("FilePath");
  1484. this.ValidateProperty("FilePath", value);
  1485. this._filePath = value;
  1486. this.RaiseDataMemberChanged("FilePath");
  1487. this.OnFilePathChanged();
  1488. }
  1489. }
  1490. }
  1491. /// <summary>
  1492. /// Gets or sets the 'GroupId' value.
  1493. /// </summary>
  1494. [DataMember()]
  1495. [RoundtripOriginal()]
  1496. public Nullable<int> GroupId
  1497. {
  1498. get
  1499. {
  1500. return this._groupId;
  1501. }
  1502. set
  1503. {
  1504. if ((this._groupId != value))
  1505. {
  1506. this.OnGroupIdChanging(value);
  1507. this.RaiseDataMemberChanging("GroupId");
  1508. this.ValidateProperty("GroupId", value);
  1509. this._groupId = value;
  1510. this.RaiseDataMemberChanged("GroupId");
  1511. this.OnGroupIdChanged();
  1512. }
  1513. }
  1514. }
  1515. /// <summary>
  1516. /// Gets or sets the 'Id' value.
  1517. /// </summary>
  1518. [DataMember()]
  1519. [Editable(false, AllowInitialValue=true)]
  1520. [Key()]
  1521. [RoundtripOriginal()]
  1522. public int Id
  1523. {
  1524. get
  1525. {
  1526. return this._id;
  1527. }
  1528. set
  1529. {
  1530. if ((this._id != value))
  1531. {
  1532. this.OnIdChanging(value);
  1533. this.ValidateProperty("Id", value);
  1534. this._id = value;
  1535. this.RaisePropertyChanged("Id");
  1536. this.OnIdChanged();
  1537. }
  1538. }
  1539. }
  1540. /// <summary>
  1541. /// Gets or sets the 'Name' value.
  1542. /// </summary>
  1543. [DataMember()]
  1544. [Required()]
  1545. public string Name
  1546. {
  1547. get
  1548. {
  1549. return this._name;
  1550. }
  1551. set
  1552. {
  1553. if ((this._name != value))
  1554. {
  1555. this.OnNameChanging(value);
  1556. this.RaiseDataMemberChanging("Name");
  1557. this.ValidateProperty("Name", value);
  1558. this._name = value;
  1559. this.RaiseDataMemberChanged("Name");
  1560. this.OnNameChanged();
  1561. }
  1562. }
  1563. }
  1564. /// <summary>
  1565. /// Gets or sets the associated <see cref="ProblemGroup"/> entity.
  1566. /// </summary>
  1567. [Association("ProblemGroup_Problem", "GroupId", "Id", IsForeignKey=true)]
  1568. [XmlIgnore()]
  1569. public ProblemGroup ProblemGroup
  1570. {
  1571. get
  1572. {
  1573. if ((this._problemGroup == null))
  1574. {
  1575. this._problemGroup = new EntityRef<ProblemGroup>(this, "ProblemGroup", this.FilterProblemGroup);
  1576. }
  1577. return this._problemGroup.Entity;
  1578. }
  1579. set
  1580. {
  1581. ProblemGroup previous = this.ProblemGroup;
  1582. if ((previous != value))
  1583. {
  1584. this.ValidateProperty("ProblemGroup", value);
  1585. if ((previous != null))
  1586. {
  1587. this._problemGroup.Entity = null;
  1588. previous.Problem.Remove(this);
  1589. }
  1590. if ((value != null))
  1591. {
  1592. this.GroupId = value.Id;
  1593. }
  1594. else
  1595. {
  1596. this.GroupId = default(Nullable<int>);
  1597. }
  1598. this._problemGroup.Entity = value;
  1599. if ((value != null))
  1600. {
  1601. value.Problem.Add(this);
  1602. }
  1603. this.RaisePropertyChanged("ProblemGroup");
  1604. }
  1605. }
  1606. }
  1607. private void AttachAssignment(Assignment entity)
  1608. {
  1609. entity.Problem = this;
  1610. }
  1611. private void DetachAssignment(Assignment entity)
  1612. {
  1613. entity.Problem = null;
  1614. }
  1615. private bool FilterAssignment(Assignment entity)
  1616. {
  1617. return (entity.ProblemId == this.Id);
  1618. }
  1619. private bool FilterProblemGroup(ProblemGroup entity)
  1620. {
  1621. return (entity.Id == this.GroupId);
  1622. }
  1623. /// <summary>
  1624. /// Computes a value from the key fields that uniquely identifies this entity instance.
  1625. /// </summary>
  1626. /// <returns>An object instance that uniquely identifies this entity instance.</returns>
  1627. public override object GetIdentity()
  1628. {
  1629. return this._id;
  1630. }
  1631. }
  1632. /// <summary>
  1633. /// The 'ProblemGroup' entity class.
  1634. /// </summary>
  1635. [DataContract(Namespace="http://schemas.datacontract.org/2004/07/glados.Web")]
  1636. public sealed partial class ProblemGroup : Entity
  1637. {
  1638. private EntityCollection<ProblemGroup> _children;
  1639. private int _id;
  1640. private string _name;
  1641. private EntityRef<ProblemGroup> _parent;
  1642. private Nullable<int> _parentId;
  1643. private EntityCollection<Problem> _problem;
  1644. #region Extensibility Method Definitions
  1645. /// <summary>
  1646. /// This method is invoked from the constructor once initialization is complete and
  1647. /// can be used for further object setup.
  1648. /// </summary>
  1649. partial void OnCreated();
  1650. partial void OnIdChanging(int value);
  1651. partial void OnIdChanged();
  1652. partial void OnNameChanging(string value);
  1653. partial void OnNameChanged();
  1654. partial void OnParentIdChanging(Nullable<int> value);
  1655. partial void OnParentIdChanged();
  1656. #endregion
  1657. /// <summary>
  1658. /// Initializes a new instance of the <see cref="ProblemGroup"/> class.
  1659. /// </summary>
  1660. public ProblemGroup()
  1661. {
  1662. this.OnCreated();
  1663. }
  1664. /// <summary>
  1665. /// Gets the collection of associated <see cref="ProblemGroup"/> entity instances.
  1666. /// </summary>
  1667. [Association("ProblemGroup_ProblemGroup", "Id", "ParentId")]
  1668. [XmlIgnore()]
  1669. public EntityCollection<ProblemGroup> Children
  1670. {
  1671. get
  1672. {
  1673. if ((this._children == null))
  1674. {
  1675. this._children = new EntityCollection<ProblemGroup>(this, "Children", this.FilterChildren, this.AttachChildren, this.DetachChildren);
  1676. }
  1677. return this._children;
  1678. }
  1679. }
  1680. /// <summary>
  1681. /// Gets or sets the 'Id' value.
  1682. /// </summary>
  1683. [DataMember()]
  1684. [Editable(false, AllowInitialValue=true)]
  1685. [Key()]
  1686. [RoundtripOriginal()]
  1687. public int Id
  1688. {
  1689. get
  1690. {
  1691. return this._id;
  1692. }
  1693. set
  1694. {
  1695. if ((this._id != value))
  1696. {
  1697. this.OnIdChanging(value);
  1698. this.ValidateProperty("Id", value);
  1699. this._id = value;
  1700. this.RaisePropertyChanged("Id");
  1701. this.OnIdChanged();
  1702. }
  1703. }
  1704. }
  1705. /// <summary>
  1706. /// Gets or sets the 'Name' value.
  1707. /// </summary>
  1708. [DataMember()]
  1709. [Required()]
  1710. public string Name
  1711. {
  1712. get
  1713. {
  1714. return this._name;
  1715. }
  1716. set
  1717. {
  1718. if ((this._name != value))
  1719. {
  1720. this.OnNameChanging(value);
  1721. this.RaiseDataMemberChanging("Name");
  1722. this.ValidateProperty("Name", value);
  1723. this._name = value;
  1724. this.RaiseDataMemberChanged("Name");
  1725. this.OnNameChanged();
  1726. }
  1727. }
  1728. }
  1729. /// <summary>
  1730. /// Gets or sets the associated <see cref="ProblemGroup"/> entity.
  1731. /// </summary>
  1732. [Association("ProblemGroup_ProblemGroup", "ParentId", "Id", IsForeignKey=true)]
  1733. [XmlIgnore()]
  1734. public ProblemGroup Parent
  1735. {
  1736. get
  1737. {
  1738. if ((this._parent == null))
  1739. {
  1740. this._parent = new EntityRef<ProblemGroup>(this, "Parent", this.FilterParent);
  1741. }
  1742. return this._parent.Entity;
  1743. }
  1744. set
  1745. {
  1746. ProblemGroup previous = this.Parent;
  1747. if ((previous != value))
  1748. {
  1749. this.ValidateProperty("Parent", value);
  1750. if ((previous != null))
  1751. {
  1752. this._parent.Entity = null;
  1753. previous.Children.Remove(this);
  1754. }
  1755. if ((value != null))
  1756. {
  1757. this.ParentId = value.Id;
  1758. }
  1759. else
  1760. {
  1761. this.ParentId = default(Nullable<int>);
  1762. }
  1763. this._parent.Entity = value;
  1764. if ((value != null))
  1765. {
  1766. value.Children.Add(this);
  1767. }
  1768. this.RaisePropertyChanged("Parent");
  1769. }
  1770. }
  1771. }
  1772. /// <summary>
  1773. /// Gets or sets the 'ParentId' value.
  1774. /// </summary>
  1775. [DataMember()]
  1776. [RoundtripOriginal()]
  1777. public Nullable<int> ParentId
  1778. {
  1779. get
  1780. {
  1781. return this._parentId;
  1782. }
  1783. set
  1784. {
  1785. if ((this._parentId != value))
  1786. {
  1787. this.OnParentIdChanging(value);
  1788. this.RaiseDataMemberChanging("ParentId");
  1789. this.ValidateProperty("ParentId", value);
  1790. this._parentId = value;
  1791. this.RaiseDataMemberChanged("ParentId");
  1792. this.OnParentIdChanged();
  1793. }
  1794. }
  1795. }
  1796. /// <summary>
  1797. /// Gets the collection of associated <see cref="Problem"/> entity instances.
  1798. /// </summary>
  1799. [Association("ProblemGroup_Problem", "Id", "GroupId")]
  1800. [XmlIgnore()]
  1801. public EntityCollection<Problem> Problem
  1802. {
  1803. get
  1804. {
  1805. if ((this._problem == null))
  1806. {
  1807. this._problem = new EntityCollection<Problem>(this, "Problem", this.FilterProblem, this.AttachProblem, this.DetachProblem);
  1808. }
  1809. return this._problem;
  1810. }
  1811. }
  1812. private void AttachChildren(ProblemGroup entity)
  1813. {
  1814. entity.Parent = this;
  1815. }
  1816. private void DetachChildren(ProblemGroup entity)
  1817. {
  1818. entity.Parent = null;
  1819. }
  1820. private bool FilterChildren(ProblemGroup entity)
  1821. {
  1822. return (entity.ParentId == this.Id);
  1823. }
  1824. private bool FilterParent(ProblemGroup entity)
  1825. {
  1826. return (entity.Id == this.ParentId);
  1827. }
  1828. private void AttachProblem(Problem entity)
  1829. {
  1830. entity.ProblemGroup = this;
  1831. }
  1832. private void DetachProblem(Problem entity)
  1833. {
  1834. entity.ProblemGroup = null;
  1835. }
  1836. private bool FilterProblem(Problem entity)
  1837. {
  1838. return (entity.GroupId == this.Id);
  1839. }
  1840. /// <summary>
  1841. /// Computes a value from the key fields that uniquely identifies this entity instance.
  1842. /// </summary>
  1843. /// <returns>An object instance that uniquely identifies this entity instance.</returns>
  1844. public override object GetIdentity()
  1845. {
  1846. return this._id;
  1847. }
  1848. }
  1849. /// <summary>
  1850. /// The 'Submission' entity class.
  1851. /// </summary>
  1852. [DataContract(Namespace="http://schemas.datacontract.org/2004/07/glados.Web")]
  1853. public sealed partial class Submission : Entity
  1854. {
  1855. private EntityRef<Assignment> _assignment;
  1856. private int _assignmentId;
  1857. private string _filePath;
  1858. private int _id;
  1859. private string _lang;
  1860. private string _result;
  1861. private DateTime _time;
  1862. #region Extensibility Method Definitions
  1863. /// <summary>
  1864. /// This method is invoked from the constructor once initialization is complete and
  1865. /// can be used for further object setup.
  1866. /// </summary>
  1867. partial void OnCreated();
  1868. partial void OnAssignmentIdChanging(int value);
  1869. partial void OnAssignmentIdChanged();
  1870. partial void OnFilePathChanging(string value);
  1871. partial void OnFilePathChanged();
  1872. partial void OnIdChanging(int value);
  1873. partial void OnIdChanged();
  1874. partial void OnLangChanging(string value);
  1875. partial void OnLangChanged();
  1876. partial void OnResultChanging(string value);
  1877. partial void OnResultChanged();
  1878. partial void OnTimeChanging(DateTime value);
  1879. partial void OnTimeChanged();
  1880. #endregion
  1881. /// <summary>
  1882. /// Initializes a new instance of the <see cref="Submission"/> class.
  1883. /// </summary>
  1884. public Submission()
  1885. {
  1886. this.OnCreated();
  1887. }
  1888. /// <summary>
  1889. /// Gets or sets the associated <see cref="Assignment"/> entity.
  1890. /// </summary>
  1891. [Association("Assignment_Submission", "AssignmentId", "Id", IsForeignKey=true)]
  1892. [XmlIgnore()]
  1893. public Assignment Assignment
  1894. {
  1895. get
  1896. {
  1897. if ((this._assignment == null))
  1898. {
  1899. this._assignment = new EntityRef<Assignment>(this, "Assignment", this.FilterAssignment);
  1900. }
  1901. return this._assignment.Entity;
  1902. }
  1903. set
  1904. {
  1905. Assignment previous = this.Assignment;
  1906. if ((previous != value))
  1907. {
  1908. this.ValidateProperty("Assignment", value);
  1909. if ((previous != null))
  1910. {
  1911. this._assignment.Entity = null;
  1912. previous.Submission.Remove(this);
  1913. }
  1914. if ((value != null))
  1915. {
  1916. this.AssignmentId = value.Id;
  1917. }
  1918. else
  1919. {
  1920. this.AssignmentId = default(int);
  1921. }
  1922. this._assignment.Entity = value;
  1923. if ((value != null))
  1924. {
  1925. value.Submission.Add(this);
  1926. }
  1927. this.RaisePropertyChanged("Assignment");
  1928. }
  1929. }
  1930. }
  1931. /// <summary>
  1932. /// Gets or sets the 'AssignmentId' value.
  1933. /// </summary>
  1934. [DataMember()]
  1935. [RoundtripOriginal()]
  1936. public int AssignmentId
  1937. {
  1938. get
  1939. {
  1940. return this._assignmentId;
  1941. }
  1942. set
  1943. {
  1944. if ((this._assignmentId != value))
  1945. {
  1946. this.OnAssignmentIdChanging(value);
  1947. this.RaiseDataMemberChanging("AssignmentId");
  1948. this.ValidateProperty("AssignmentId", value);
  1949. this._assignmentId = value;
  1950. this.RaiseDataMemberChanged("AssignmentId");
  1951. this.OnAssignmentIdChanged();
  1952. }
  1953. }
  1954. }
  1955. /// <summary>
  1956. /// Gets or sets the 'FilePath' value.
  1957. /// </summary>
  1958. [DataMember()]
  1959. public string FilePath
  1960. {
  1961. get
  1962. {
  1963. return this._filePath;
  1964. }
  1965. set
  1966. {
  1967. if ((this._filePath != value))
  1968. {
  1969. this.OnFilePathChanging(value);
  1970. this.RaiseDataMemberChanging("FilePath");
  1971. this.ValidateProperty("FilePath", value);
  1972. this._filePath = value;
  1973. this.RaiseDataMemberChanged("FilePath");
  1974. this.OnFilePathChanged();
  1975. }
  1976. }
  1977. }
  1978. /// <summary>
  1979. /// Gets or sets the 'Id' value.
  1980. /// </summary>
  1981. [DataMember()]
  1982. [Editable(false, AllowInitialValue=true)]
  1983. [Key()]
  1984. [RoundtripOriginal()]
  1985. public int Id
  1986. {
  1987. get
  1988. {
  1989. return this._id;
  1990. }
  1991. set
  1992. {
  1993. if ((this._id != value))
  1994. {
  1995. this.OnIdChanging(value);
  1996. this.ValidateProperty("Id", value);
  1997. this._id = value;
  1998. this.RaisePropertyChanged("Id");
  1999. this.OnIdChanged();
  2000. }
  2001. }
  2002. }
  2003. /// <summary>
  2004. /// Gets or sets the 'Lang' value.
  2005. /// </summary>
  2006. [DataMember()]
  2007. public string Lang
  2008. {
  2009. get
  2010. {
  2011. return this._lang;
  2012. }
  2013. set
  2014. {
  2015. if ((this._lang != value))
  2016. {
  2017. this.OnLangChanging(value);
  2018. this.RaiseDataMemberChanging("Lang");
  2019. this.ValidateProperty("Lang", value);
  2020. this._lang = value;
  2021. this.RaiseDataMemberChanged("Lang");
  2022. this.OnLangChanged();
  2023. }
  2024. }
  2025. }
  2026. /// <summary>
  2027. /// Gets or sets the 'Result' value.
  2028. /// </summary>
  2029. [DataMember()]
  2030. [Required()]
  2031. public string Result
  2032. {
  2033. get
  2034. {
  2035. return this._result;
  2036. }
  2037. set
  2038. {
  2039. if ((this._result != value))
  2040. {
  2041. this.OnResultChanging(value);
  2042. this.RaiseDataMemberChanging("Result");
  2043. this.ValidateProperty("Result", value);
  2044. this._result = value;
  2045. this.RaiseDataMemberChanged("Result");
  2046. this.OnResultChanged();
  2047. }
  2048. }
  2049. }
  2050. /// <summary>
  2051. /// Gets or sets the 'Time' value.
  2052. /// </summary>
  2053. [DataMember()]
  2054. public DateTime Time
  2055. {
  2056. get
  2057. {
  2058. return this._time;
  2059. }
  2060. set
  2061. {
  2062. if ((this._time != value))
  2063. {
  2064. this.OnTimeChanging(value);
  2065. this.RaiseDataMemberChanging("Time");
  2066. this.ValidateProperty("Time", value);
  2067. this._time = value;
  2068. this.RaiseDataMemberChanged("Time");
  2069. this.OnTimeChanged();
  2070. }
  2071. }
  2072. }
  2073. private bool FilterAssignment(Assignment entity)
  2074. {
  2075. return (entity.Id == this.AssignmentId);
  2076. }
  2077. /// <summary>
  2078. /// Computes a value from the key fields that uniquely identifies this entity instance.
  2079. /// </summary>
  2080. /// <returns>An object instance that uniquely identifies this entity instance.</returns>
  2081. public override object GetIdentity()
  2082. {
  2083. return this._id;
  2084. }
  2085. }
  2086. /// <summary>
  2087. /// The 'User' entity class.
  2088. /// </summary>
  2089. [DataContract(Namespace="http://schemas.datacontract.org/2004/07/glados.Web")]
  2090. public sealed partial class User : Entity
  2091. {
  2092. private int _id;
  2093. private EntityCollection<Membership> _membership;
  2094. private string _name;
  2095. private EntityCollection<Participation> _participation;
  2096. private string _password;
  2097. #region Extensibility Method Definitions
  2098. /// <summary>
  2099. /// This method is invoked from the constructor once initialization is complete and
  2100. /// can be used for further object setup.
  2101. /// </summary>
  2102. partial void OnCreated();
  2103. partial void OnIdChanging(int value);
  2104. partial void OnIdChanged();
  2105. partial void OnNameChanging(string value);
  2106. partial void OnNameChanged();
  2107. partial void OnPasswordChanging(string value);
  2108. partial void OnPasswordChanged();
  2109. #endregion
  2110. /// <summary>
  2111. /// Initializes a new instance of the <see cref="User"/> class.
  2112. /// </summary>
  2113. public User()
  2114. {
  2115. this.OnCreated();
  2116. }
  2117. /// <summary>
  2118. /// Gets or sets the 'Id' value.
  2119. /// </summary>
  2120. [DataMember()]
  2121. [Editable(false, AllowInitialValue=true)]
  2122. [Key()]
  2123. [RoundtripOriginal()]
  2124. public int Id
  2125. {
  2126. get
  2127. {
  2128. return this._id;
  2129. }
  2130. set
  2131. {
  2132. if ((this._id != value))
  2133. {
  2134. this.OnIdChanging(value);
  2135. this.ValidateProperty("Id", value);
  2136. this._id = value;
  2137. this.RaisePropertyChanged("Id");
  2138. this.OnIdChanged();
  2139. }
  2140. }
  2141. }
  2142. /// <summary>
  2143. /// Gets the collection of associated <see cref="Membership"/> entity instances.
  2144. /// </summary>
  2145. [Association("User_Membership", "Id", "UserId")]
  2146. [XmlIgnore()]
  2147. public EntityCollection<Membership> Membership
  2148. {
  2149. get
  2150. {
  2151. if ((this._membership == null))
  2152. {
  2153. this._membership = new EntityCollection<Membership>(this, "Membership", this.FilterMembership, this.AttachMembership, this.DetachMembership);
  2154. }
  2155. return this._membership;
  2156. }
  2157. }
  2158. /// <summary>
  2159. /// Gets or sets the 'Name' value.
  2160. /// </summary>
  2161. [DataMember()]
  2162. [Required()]
  2163. public string Name
  2164. {
  2165. get
  2166. {
  2167. return this._name;
  2168. }
  2169. set
  2170. {
  2171. if ((this._name != value))
  2172. {
  2173. this.OnNameChanging(value);
  2174. this.RaiseDataMemberChanging("Name");
  2175. this.ValidateProperty("Name", value);
  2176. this._name = value;
  2177. this.RaiseDataMemberChanged("Name");
  2178. this.OnNameChanged();
  2179. }
  2180. }
  2181. }
  2182. /// <summary>
  2183. /// Gets the collection of associated <see cref="Participation"/> entity instances.
  2184. /// </summary>
  2185. [Association("User_Participation", "Id", "UserId")]
  2186. [XmlIgnore()]
  2187. public EntityCollection<Participation> Participation
  2188. {
  2189. get
  2190. {
  2191. if ((this._participation == null))
  2192. {
  2193. this._participation = new EntityCollection<Participation>(this, "Participation", this.FilterParticipation, this.AttachParticipation, this.DetachParticipation);
  2194. }
  2195. return this._participation;
  2196. }
  2197. }
  2198. /// <summary>
  2199. /// Gets or sets the 'Password' value.
  2200. /// </summary>
  2201. [DataMember()]
  2202. [Required()]
  2203. public string Password
  2204. {
  2205. get
  2206. {
  2207. return this._password;
  2208. }
  2209. set
  2210. {
  2211. if ((this._password != value))
  2212. {
  2213. this.OnPasswordChanging(value);
  2214. this.RaiseDataMemberChanging("Password");
  2215. this.ValidateProperty("Password", value);
  2216. this._password = value;
  2217. this.RaiseDataMemberChanged("Password");
  2218. this.OnPasswordChanged();
  2219. }
  2220. }
  2221. }
  2222. private void AttachMembership(Membership entity)
  2223. {
  2224. entity.User = this;
  2225. }
  2226. private void DetachMembership(Membership entity)
  2227. {
  2228. entity.User = null;
  2229. }
  2230. private bool FilterMembership(Membership entity)
  2231. {
  2232. return (entity.UserId == this.Id);
  2233. }
  2234. private void AttachParticipation(Participation entity)
  2235. {
  2236. entity.User = this;
  2237. }
  2238. private void DetachParticipation(Participation entity)
  2239. {
  2240. entity.User = null;
  2241. }
  2242. private bool FilterParticipation(Participation entity)
  2243. {
  2244. return (entity.UserId == this.Id);
  2245. }
  2246. /// <summary>
  2247. /// Computes a value from the key fields that uniquely identifies this entity instance.
  2248. /// </summary>
  2249. /// <returns>An object instance that uniquely identifies this entity instance.</returns>
  2250. public override object GetIdentity()
  2251. {
  2252. return this._id;
  2253. }
  2254. }
  2255. }
  2256. namespace glados.Web.Services
  2257. {
  2258. using System;
  2259. using System.Collections.Generic;
  2260. using System.ComponentModel;
  2261. using System.ComponentModel.DataAnnotations;
  2262. using System.Linq;
  2263. using System.ServiceModel;
  2264. using System.ServiceModel.DomainServices;
  2265. using System.ServiceModel.DomainServices.Client;
  2266. using System.ServiceModel.DomainServices.Client.ApplicationServices;
  2267. using System.ServiceModel.Web;
  2268. using glados.Web;
  2269. using glados.Web.Services.Entities;
  2270. /// <summary>
  2271. /// The DomainContext corresponding to the 'StatusService' DomainService.
  2272. /// </summary>
  2273. public sealed partial class StatusContext : DomainContext
  2274. {
  2275. #region Extensibility Method Definitions
  2276. /// <summary>
  2277. /// This method is invoked from the constructor once initialization is complete and
  2278. /// can be used for further object setup.
  2279. /// </summary>
  2280. partial void OnCreated();
  2281. #endregion
  2282. /// <summary>
  2283. /// Initializes a new instance of the <see cref="StatusContext"/> class.
  2284. /// </summary>
  2285. public StatusContext() :
  2286. this(new WebDomainClient<IStatusServiceContract>(new Uri("glados-Web-Services-StatusService.svc", UriKind.Relative)))
  2287. {
  2288. }
  2289. /// <summary>
  2290. /// Initializes a new instance of the <see cref="StatusContext"/> class with the specified service URI.
  2291. /// </summary>
  2292. /// <param name="serviceUri">The StatusService service URI.</param>
  2293. public StatusContext(Uri serviceUri) :
  2294. this(new WebDomainClient<IStatusServiceContract>(serviceUri))
  2295. {
  2296. }
  2297. /// <summary>
  2298. /// Initializes a new instance of the <see cref="StatusContext"/> class with the specified <paramref name="domainClient"/>.
  2299. /// </summary>
  2300. /// <param name="domainClient">The DomainClient instance to use for this DomainContext.</param>
  2301. public StatusContext(DomainClient domainClient) :
  2302. base(domainClient)
  2303. {
  2304. this.OnCreated();
  2305. }
  2306. /// <summary>
  2307. /// Gets the set of <see cref="TestingMachineEntity"/> entity instances that have been loaded into this <see cref="StatusContext"/> instance.
  2308. /// </summary>
  2309. public EntitySet<TestingMachineEntity> TestingMachineEntities
  2310. {
  2311. get
  2312. {
  2313. return base.EntityContainer.GetEntitySet<TestingMachineEntity>();
  2314. }
  2315. }
  2316. /// <summary>
  2317. /// Gets an EntityQuery instance that can be used to load <see cref="TestingMachineEntity"/> entity instances using the 'GetTesterStatus' query.
  2318. /// </summary>
  2319. /// <returns>An EntityQuery that can be loaded to retrieve <see cref="TestingMachineEntity"/> entity instances.</returns>
  2320. public EntityQuery<TestingMachineEntity> GetTesterStatusQuery()
  2321. {
  2322. this.ValidateMethod("GetTesterStatusQuery", null);
  2323. return base.CreateQuery<TestingMachineEntity>("GetTesterStatus", null, false, true);
  2324. }
  2325. /// <summary>
  2326. /// Asynchronously invokes the 'ReloadProblemsIntoDb' method of the DomainService.
  2327. /// </summary>
  2328. /// <param name="callback">Callback to invoke when the operation completes.</param>
  2329. /// <param name="userState">Value to pass to the callback. It can be <c>null</c>.</param>
  2330. /// <returns>An operation instance that can be used to manage the asynchronous request.</returns>
  2331. public InvokeOperation ReloadProblemsIntoDb(Action<InvokeOperation> callback, object userState)
  2332. {
  2333. this.ValidateMethod("ReloadProblemsIntoDb", null);
  2334. return this.InvokeOperation("ReloadProblemsIntoDb", typeof(void), null, true, callback, userState);
  2335. }
  2336. /// <summary>
  2337. /// Asynchronously invokes the 'ReloadProblemsIntoDb' method of the DomainService.
  2338. /// </summary>
  2339. /// <returns>An operation instance that can be used to manage the asynchronous request.</returns>
  2340. public InvokeOperation ReloadProblemsIntoDb()
  2341. {
  2342. this.ValidateMethod("ReloadProblemsIntoDb", null);
  2343. return this.InvokeOperation("ReloadProblemsIntoDb", typeof(void), null, true, null, null);
  2344. }
  2345. /// <summary>
  2346. /// Asynchronously invokes the 'RetestSubmission' method of the DomainService.
  2347. /// </summary>
  2348. /// <param name="id">The value for the 'id' parameter of this action.</param>
  2349. /// <param name="callback">Callback to invoke when the operation completes.</param>
  2350. /// <param name="userState">Value to pass to the callback. It can be <c>null</c>.</param>
  2351. /// <returns>An operation instance that can be used to manage the asynchronous request.</returns>
  2352. public InvokeOperation RetestSubmission(int id, Action<InvokeOperation> callback, object userState)
  2353. {
  2354. Dictionary<string, object> parameters = new Dictionary<string, object>();
  2355. parameters.Add("id", id);
  2356. this.ValidateMethod("RetestSubmission", parameters);
  2357. return this.InvokeOperation("RetestSubmission", typeof(void), parameters, true, callback, userState);
  2358. }
  2359. /// <summary>
  2360. /// Asynchronously invokes the 'RetestSubmission' method of the DomainService.
  2361. /// </summary>
  2362. /// <param name="id">The value for the 'id' parameter of this action.</param>
  2363. /// <returns>An operation instance that can be used to manage the asynchronous request.</returns>
  2364. public InvokeOperation RetestSubmission(int id)
  2365. {
  2366. Dictionary<string, object> parameters = new Dictionary<string, object>();
  2367. parameters.Add("id", id);
  2368. this.ValidateMethod("RetestSubmission", parameters);
  2369. return this.InvokeOperation("RetestSubmission", typeof(void), parameters, true, null, null);
  2370. }
  2371. /// <summary>
  2372. /// Creates a new EntityContainer for this DomainContext's EntitySets.
  2373. /// </summary>
  2374. /// <returns>A new container instance.</returns>
  2375. protected override EntityContainer CreateEntityContainer()
  2376. {
  2377. return new StatusContextEntityContainer();
  2378. }
  2379. /// <summary>
  2380. /// Service contract for the 'StatusService' DomainService.
  2381. /// </summary>
  2382. [ServiceContract()]
  2383. public interface IStatusServiceContract
  2384. {
  2385. /// <summary>
  2386. /// Asynchronously invokes the 'GetTesterStatus' operation.
  2387. /// </summary>
  2388. /// <param name="callback">Callback to invoke on completion.</param>
  2389. /// <param name="asyncState">Optional state object.</param>
  2390. /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
  2391. [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/StatusService/GetTesterStatusDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
  2392. [OperationContract(AsyncPattern=true, Action="http://tempuri.org/StatusService/GetTesterStatus", ReplyAction="http://tempuri.org/StatusService/GetTesterStatusResponse")]
  2393. [WebGet()]
  2394. IAsyncResult BeginGetTesterStatus(AsyncCallback callback, object asyncState);
  2395. /// <summary>
  2396. /// Completes the asynchronous operation begun by 'BeginGetTesterStatus'.
  2397. /// </summary>
  2398. /// <param name="result">The IAsyncResult returned from 'BeginGetTesterStatus'.</param>
  2399. /// <returns>The 'QueryResult' returned from the 'GetTesterStatus' operation.</returns>
  2400. QueryResult<TestingMachineEntity> EndGetTesterStatus(IAsyncResult result);
  2401. /// <summary>
  2402. /// Asynchronously invokes the 'ReloadProblemsIntoDb' operation.
  2403. /// </summary>
  2404. /// <param name="callback">Callback to invoke on completion.</param>
  2405. /// <param name="asyncState">Optional state object.</param>
  2406. /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
  2407. [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/StatusService/ReloadProblemsIntoDbDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
  2408. [OperationContract(AsyncPattern=true, Action="http://tempuri.org/StatusService/ReloadProblemsIntoDb", ReplyAction="http://tempuri.org/StatusService/ReloadProblemsIntoDbResponse")]
  2409. IAsyncResult BeginReloadProblemsIntoDb(AsyncCallback callback, object asyncState);
  2410. /// <summary>
  2411. /// Completes the asynchronous operation begun by 'BeginReloadProblemsIntoDb'.
  2412. /// </summary>
  2413. /// <param name="result">The IAsyncResult returned from 'BeginReloadProblemsIntoDb'.</param>
  2414. void EndReloadProblemsIntoDb(IAsyncResult result);
  2415. /// <summary>
  2416. /// Asynchronously invokes the 'RetestSubmission' operation.
  2417. /// </summary>
  2418. /// <param name="id">The value for the 'id' parameter of this action.</param>
  2419. /// <param name="callback">Callback to invoke on completion.</param>
  2420. /// <param name="asyncState">Optional state object.</param>
  2421. /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
  2422. [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/StatusService/RetestSubmissionDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
  2423. [OperationContract(AsyncPattern=true, Action="http://tempuri.org/StatusService/RetestSubmission", ReplyAction="http://tempuri.org/StatusService/RetestSubmissionResponse")]
  2424. IAsyncResult BeginRetestSubmission(int id, AsyncCallback callback, object asyncState);
  2425. /// <summary>
  2426. /// Completes the asynchronous operation begun by 'BeginRetestSubmission'.
  2427. /// </summary>
  2428. /// <param name="result">The IAsyncResult returned from 'BeginRetestSubmission'.</param>
  2429. void EndRetestSubmission(IAsyncResult result);
  2430. }
  2431. internal sealed class StatusContextEntityContainer : EntityContainer
  2432. {
  2433. public StatusContextEntityContainer()
  2434. {
  2435. this.CreateEntitySet<TestingMachineEntity>(EntitySetOperations.None);
  2436. }
  2437. }
  2438. }
  2439. /// <summary>
  2440. /// The DomainContext corresponding to the 'TaskStructureService' DomainService.
  2441. /// </summary>
  2442. public sealed partial class TaskStructureContext : DomainContext
  2443. {
  2444. #region Extensibility Method Definitions
  2445. /// <summary>
  2446. /// This method is invoked from the constructor once initialization is complete and
  2447. /// can be used for further object setup.
  2448. /// </summary>
  2449. partial void OnCreated();
  2450. #endregion
  2451. /// <summary>
  2452. /// Initializes a new instance of the <see cref="TaskStructureContext"/> class.
  2453. /// </summary>
  2454. public TaskStructureContext() :
  2455. this(new WebDomainClient<ITaskStructureServiceContract>(new Uri("glados-Web-Services-TaskStructureService.svc", UriKind.Relative)))
  2456. {
  2457. }
  2458. /// <summary>
  2459. /// Initializes a new instance of the <see cref="TaskStructureContext"/> class with the specified service URI.
  2460. /// </summary>
  2461. /// <param name="serviceUri">The TaskStructureService service URI.</param>
  2462. public TaskStructureContext(Uri serviceUri) :
  2463. this(new WebDomainClient<ITaskStructureServiceContract>(serviceUri))
  2464. {
  2465. }
  2466. /// <summary>
  2467. /// Initializes a new instance of the <see cref="TaskStructureContext"/> class with the specified <paramref name="domainClient"/>.
  2468. /// </summary>
  2469. /// <param name="domainClient">The DomainClient instance to use for this DomainContext.</param>
  2470. public TaskStructureContext(DomainClient domainClient) :
  2471. base(domainClient)
  2472. {
  2473. this.OnCreated();
  2474. }
  2475. /// <summary>
  2476. /// Gets the set of <see cref="Assignment"/> entity instances that have been loaded into this <see cref="TaskStructureContext"/> instance.
  2477. /// </summary>
  2478. public EntitySet<Assignment> Assignments
  2479. {
  2480. get
  2481. {
  2482. return base.EntityContainer.GetEntitySet<Assignment>();
  2483. }
  2484. }
  2485. /// <summary>
  2486. /// Gets the set of <see cref="Course"/> entity instances that have been loaded into this <see cref="TaskStructureContext"/> instance.
  2487. /// </summary>
  2488. public EntitySet<Course> Courses
  2489. {
  2490. get
  2491. {
  2492. return base.EntityContainer.GetEntitySet<Course>();
  2493. }
  2494. }
  2495. /// <summary>
  2496. /// Gets the set of <see cref="Group"/> entity instances that have been loaded into this <see cref="TaskStructureContext"/> instance.
  2497. /// </summary>
  2498. public EntitySet<Group> Groups
  2499. {
  2500. get
  2501. {
  2502. return base.EntityContainer.GetEntitySet<Group>();
  2503. }
  2504. }
  2505. /// <summary>
  2506. /// Gets the set of <see cref="Membership"/> entity instances that have been loaded into this <see cref="TaskStructureContext"/> instance.
  2507. /// </summary>
  2508. public EntitySet<Membership> Memberships
  2509. {
  2510. get
  2511. {
  2512. return base.EntityContainer.GetEntitySet<Membership>();
  2513. }
  2514. }
  2515. /// <summary>
  2516. /// Gets the set of <see cref="Participation"/> entity instances that have been loaded into this <see cref="TaskStructureContext"/> instance.
  2517. /// </summary>
  2518. public EntitySet<Participation> Participations
  2519. {
  2520. get
  2521. {
  2522. return base.EntityContainer.GetEntitySet<Participation>();
  2523. }
  2524. }
  2525. /// <summary>
  2526. /// Gets the set of <see cref="ProblemGroup"/> entity instances that have been loaded into this <see cref="TaskStructureContext"/> instance.
  2527. /// </summary>
  2528. public EntitySet<ProblemGroup> ProblemGroups
  2529. {
  2530. get
  2531. {
  2532. return base.EntityContainer.GetEntitySet<ProblemGroup>();
  2533. }
  2534. }
  2535. /// <summary>
  2536. /// Gets the set of <see cref="Problem"/> entity instances that have been loaded into this <see cref="TaskStructureContext"/> instance.
  2537. /// </summary>
  2538. public EntitySet<Problem> Problems
  2539. {
  2540. get
  2541. {
  2542. return base.EntityContainer.GetEntitySet<Problem>();
  2543. }
  2544. }
  2545. /// <summary>
  2546. /// Gets the set of <see cref="Submission"/> entity instances that have been loaded into this <see cref="TaskStructureContext"/> instance.
  2547. /// </summary>
  2548. public EntitySet<Submission> Submissions
  2549. {
  2550. get
  2551. {
  2552. return base.EntityContainer.GetEntitySet<Submission>();
  2553. }
  2554. }
  2555. /// <summary>
  2556. /// Gets the set of <see cref="User"/> entity instances that have been loaded into this <see cref="TaskStructureContext"/> instance.
  2557. /// </summary>
  2558. public EntitySet<User> Users
  2559. {
  2560. get
  2561. {
  2562. return base.EntityContainer.GetEntitySet<User>();
  2563. }
  2564. }
  2565. /// <summary>
  2566. /// Gets an EntityQuery instance that can be used to load <see cref="Assignment"/> entity instances using the 'GetAssignmentSet' query.
  2567. /// </summary>
  2568. /// <returns>An EntityQuery that can be loaded to retrieve <see cref="Assignment"/> entity instances.</returns>
  2569. public EntityQuery<Assignment> GetAssignmentSetQuery()
  2570. {
  2571. this.ValidateMethod("GetAssignmentSetQuery", null);
  2572. return base.CreateQuery<Assignment>("GetAssignmentSet", null, false, true);
  2573. }
  2574. /// <summary>
  2575. /// Gets an EntityQuery instance that can be used to load <see cref="Assignment"/> entity instances using the 'GetAssignmentsForMe' query.
  2576. /// </summary>
  2577. /// <returns>An EntityQuery that can be loaded to retrieve <see cref="Assignment"/> entity instances.</returns>
  2578. public EntityQuery<Assignment> GetAssignmentsForMeQuery()
  2579. {
  2580. this.ValidateMethod("GetAssignmentsForMeQuery", null);
  2581. return base.CreateQuery<Assignment>("GetAssignmentsForMe", null, false, true);
  2582. }
  2583. /// <summary>
  2584. /// Gets an EntityQuery instance that can be used to load <see cref="Course"/> entity instances using the 'GetCourseSet' query.
  2585. /// </summary>
  2586. /// <returns>An EntityQuery that can be loaded to retrieve <see cref="Course"/> entity instances.</returns>
  2587. public EntityQuery<Course> GetCourseSetQuery()
  2588. {
  2589. this.ValidateMethod("GetCourseSetQuery", null);
  2590. return base.CreateQuery<Course>("GetCourseSet", null, false, true);
  2591. }
  2592. /// <summary>
  2593. /// Gets an EntityQuery instance that can be used to load <see cref="Group"/> entity instances using the 'GetGroupSet' query.
  2594. /// </summary>
  2595. /// <returns>An EntityQuery that can be loaded to retrieve <see cref="Group"/> entity instances.</returns>
  2596. public EntityQuery<Group> GetGroupSetQuery()
  2597. {
  2598. this.ValidateMethod("GetGroupSetQuery", null);
  2599. return base.CreateQuery<Group>("GetGroupSet", null, false, true);
  2600. }
  2601. /// <summary>
  2602. /// Gets an EntityQuery instance that can be used to load <see cref="Membership"/> entity instances using the 'GetMembershipSet' query.
  2603. /// </summary>
  2604. /// <returns>An EntityQuery that can be loaded to retrieve <see cref="Membership"/> entity instances.</returns>
  2605. public EntityQuery<Membership> GetMembershipSetQuery()
  2606. {
  2607. this.ValidateMethod("GetMembershipSetQuery", null);
  2608. return base.CreateQuery<Membership>("GetMembershipSet", null, false, true);
  2609. }
  2610. /// <summary>
  2611. /// Gets an EntityQuery instance that can be used to load <see cref="Participation"/> entity instances using the 'GetParticipationSet' query.
  2612. /// </summary>
  2613. /// <returns>An EntityQuery that can be loaded to retrieve <see cref="Participation"/> entity instances.</returns>
  2614. public EntityQuery<Participation> GetParticipationSetQuery()
  2615. {
  2616. this.ValidateMethod("GetParticipationSetQuery", null);
  2617. return base.CreateQuery<Participation>("GetParticipationSet", null, false, true);
  2618. }
  2619. /// <summary>
  2620. /// Gets an EntityQuery instance that can be used to load <see cref="ProblemGroup"/> entity instances using the 'GetProblemGroupSet' query.
  2621. /// </summary>
  2622. /// <returns>An EntityQuery that can be loaded to retrieve <see cref="ProblemGroup"/> entity instances.</returns>
  2623. public EntityQuery<ProblemGroup> GetProblemGroupSetQuery()
  2624. {
  2625. this.ValidateMethod("GetProblemGroupSetQuery", null);
  2626. return base.CreateQuery<ProblemGroup>("GetProblemGroupSet", null, false, true);
  2627. }
  2628. /// <summary>
  2629. /// Gets an EntityQuery instance that can be used to load <see cref="Problem"/> entity instances using the 'GetProblemSet' query.
  2630. /// </summary>
  2631. /// <returns>An EntityQuery that can be loaded to retrieve <see cref="Problem"/> entity instances.</returns>
  2632. public EntityQuery<Problem> GetProblemSetQuery()
  2633. {
  2634. this.ValidateMethod("GetProblemSetQuery", null);
  2635. return base.CreateQuery<Problem>("GetProblemSet", null, false, true);
  2636. }
  2637. /// <summary>
  2638. /// Gets an EntityQuery instance that can be used to load <see cref="Problem"/> entity instances using the 'GetProblemSetByGroupId' query.
  2639. /// </summary>
  2640. /// <param name="id">The value for the 'id' parameter of the query.</param>
  2641. /// <returns>An EntityQuery that can be loaded to retrieve <see cref="Problem"/> entity instances.</returns>
  2642. public EntityQuery<Problem> GetProblemSetByGroupIdQuery(int id)
  2643. {
  2644. Dictionary<string, object> parameters = new Dictionary<string, object>();
  2645. parameters.Add("id", id);
  2646. this.ValidateMethod("GetProblemSetByGroupIdQuery", parameters);
  2647. return base.CreateQuery<Problem>("GetProblemSetByGroupId", parameters, false, true);
  2648. }
  2649. /// <summary>
  2650. /// Gets an EntityQuery instance that can be used to load <see cref="Submission"/> entity instances using the 'GetSubmissionSet' query.
  2651. /// </summary>
  2652. /// <returns>An EntityQuery that can be loaded to retrieve <see cref="Submission"/> entity instances.</returns>
  2653. public EntityQuery<Submission> GetSubmissionSetQuery()
  2654. {
  2655. this.ValidateMethod("GetSubmissionSetQuery", null);
  2656. return base.CreateQuery<Submission>("GetSubmissionSet", null, false, true);
  2657. }
  2658. /// <summary>
  2659. /// Gets an EntityQuery instance that can be used to load <see cref="User"/> entity instances using the 'GetUsers' query.
  2660. /// </summary>
  2661. /// <returns>An EntityQuery that can be loaded to retrieve <see cref="User"/> entity instances.</returns>
  2662. public EntityQuery<User> GetUsersQuery()
  2663. {
  2664. this.ValidateMethod("GetUsersQuery", null);
  2665. return base.CreateQuery<User>("GetUsers", null, false, true);
  2666. }
  2667. /// <summary>
  2668. /// Creates a new EntityContainer for this DomainContext's EntitySets.
  2669. /// </summary>
  2670. /// <returns>A new container instance.</returns>
  2671. protected override EntityContainer CreateEntityContainer()
  2672. {
  2673. return new TaskStructureContextEntityContainer();
  2674. }
  2675. /// <summary>
  2676. /// Service contract for the 'TaskStructureService' DomainService.
  2677. /// </summary>
  2678. [ServiceContract()]
  2679. public interface ITaskStructureServiceContract
  2680. {
  2681. /// <summary>
  2682. /// Asynchronously invokes the 'GetAssignmentSet' operation.
  2683. /// </summary>
  2684. /// <param name="callback">Callback to invoke on completion.</param>
  2685. /// <param name="asyncState">Optional state object.</param>
  2686. /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
  2687. [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/TaskStructureService/GetAssignmentSetDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
  2688. [OperationContract(AsyncPattern=true, Action="http://tempuri.org/TaskStructureService/GetAssignmentSet", ReplyAction="http://tempuri.org/TaskStructureService/GetAssignmentSetResponse")]
  2689. [WebGet()]
  2690. IAsyncResult BeginGetAssignmentSet(AsyncCallback callback, object asyncState);
  2691. /// <summary>
  2692. /// Completes the asynchronous operation begun by 'BeginGetAssignmentSet'.
  2693. /// </summary>
  2694. /// <param name="result">The IAsyncResult returned from 'BeginGetAssignmentSet'.</param>
  2695. /// <returns>The 'QueryResult' returned from the 'GetAssignmentSet' operation.</returns>
  2696. QueryResult<Assignment> EndGetAssignmentSet(IAsyncResult result);
  2697. /// <summary>
  2698. /// Asynchronously invokes the 'GetAssignmentsForMe' operation.
  2699. /// </summary>
  2700. /// <param name="callback">Callback to invoke on completion.</param>
  2701. /// <param name="asyncState">Optional state object.</param>
  2702. /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
  2703. [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/TaskStructureService/GetAssignmentsForMeDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
  2704. [OperationContract(AsyncPattern=true, Action="http://tempuri.org/TaskStructureService/GetAssignmentsForMe", ReplyAction="http://tempuri.org/TaskStructureService/GetAssignmentsForMeResponse")]
  2705. [WebGet()]
  2706. IAsyncResult BeginGetAssignmentsForMe(AsyncCallback callback, object asyncState);
  2707. /// <summary>
  2708. /// Completes the asynchronous operation begun by 'BeginGetAssignmentsForMe'.
  2709. /// </summary>
  2710. /// <param name="result">The IAsyncResult returned from 'BeginGetAssignmentsForMe'.</param>
  2711. /// <returns>The 'QueryResult' returned from the 'GetAssignmentsForMe' operation.</returns>
  2712. QueryResult<Assignment> EndGetAssignmentsForMe(IAsyncResult result);
  2713. /// <summary>
  2714. /// Asynchronously invokes the 'GetCourseSet' operation.
  2715. /// </summary>
  2716. /// <param name="callback">Callback to invoke on completion.</param>
  2717. /// <param name="asyncState">Optional state object.</param>
  2718. /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
  2719. [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/TaskStructureService/GetCourseSetDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
  2720. [OperationContract(AsyncPattern=true, Action="http://tempuri.org/TaskStructureService/GetCourseSet", ReplyAction="http://tempuri.org/TaskStructureService/GetCourseSetResponse")]
  2721. [WebGet()]
  2722. IAsyncResult BeginGetCourseSet(AsyncCallback callback, object asyncState);
  2723. /// <summary>
  2724. /// Completes the asynchronous operation begun by 'BeginGetCourseSet'.
  2725. /// </summary>
  2726. /// <param name="result">The IAsyncResult returned from 'BeginGetCourseSet'.</param>
  2727. /// <returns>The 'QueryResult' returned from the 'GetCourseSet' operation.</returns>
  2728. QueryResult<Course> EndGetCourseSet(IAsyncResult result);
  2729. /// <summary>
  2730. /// Asynchronously invokes the 'GetGroupSet' operation.
  2731. /// </summary>
  2732. /// <param name="callback">Callback to invoke on completion.</param>
  2733. /// <param name="asyncState">Optional state object.</param>
  2734. /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
  2735. [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/TaskStructureService/GetGroupSetDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
  2736. [OperationContract(AsyncPattern=true, Action="http://tempuri.org/TaskStructureService/GetGroupSet", ReplyAction="http://tempuri.org/TaskStructureService/GetGroupSetResponse")]
  2737. [WebGet()]
  2738. IAsyncResult BeginGetGroupSet(AsyncCallback callback, object asyncState);
  2739. /// <summary>
  2740. /// Completes the asynchronous operation begun by 'BeginGetGroupSet'.
  2741. /// </summary>
  2742. /// <param name="result">The IAsyncResult returned from 'BeginGetGroupSet'.</param>
  2743. /// <returns>The 'QueryResult' returned from the 'GetGroupSet' operation.</returns>
  2744. QueryResult<Group> EndGetGroupSet(IAsyncResult result);
  2745. /// <summary>
  2746. /// Asynchronously invokes the 'GetMembershipSet' operation.
  2747. /// </summary>
  2748. /// <param name="callback">Callback to invoke on completion.</param>
  2749. /// <param name="asyncState">Optional state object.</param>
  2750. /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
  2751. [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/TaskStructureService/GetMembershipSetDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
  2752. [OperationContract(AsyncPattern=true, Action="http://tempuri.org/TaskStructureService/GetMembershipSet", ReplyAction="http://tempuri.org/TaskStructureService/GetMembershipSetResponse")]
  2753. [WebGet()]
  2754. IAsyncResult BeginGetMembershipSet(AsyncCallback callback, object asyncState);
  2755. /// <summary>
  2756. /// Completes the asynchronous operation begun by 'BeginGetMembershipSet'.
  2757. /// </summary>
  2758. /// <param name="result">The IAsyncResult returned from 'BeginGetMembershipSet'.</param>
  2759. /// <returns>The 'QueryResult' returned from the 'GetMembershipSet' operation.</returns>
  2760. QueryResult<Membership> EndGetMembershipSet(IAsyncResult result);
  2761. /// <summary>
  2762. /// Asynchronously invokes the 'GetParticipationSet' operation.
  2763. /// </summary>
  2764. /// <param name="callback">Callback to invoke on completion.</param>
  2765. /// <param name="asyncState">Optional state object.</param>
  2766. /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
  2767. [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/TaskStructureService/GetParticipationSetDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
  2768. [OperationContract(AsyncPattern=true, Action="http://tempuri.org/TaskStructureService/GetParticipationSet", ReplyAction="http://tempuri.org/TaskStructureService/GetParticipationSetResponse")]
  2769. [WebGet()]
  2770. IAsyncResult BeginGetParticipationSet(AsyncCallback callback, object asyncState);
  2771. /// <summary>
  2772. /// Completes the asynchronous operation begun by 'BeginGetParticipationSet'.
  2773. /// </summary>
  2774. /// <param name="result">The IAsyncResult returned from 'BeginGetParticipationSet'.</param>
  2775. /// <returns>The 'QueryResult' returned from the 'GetParticipationSet' operation.</returns>
  2776. QueryResult<Participation> EndGetParticipationSet(IAsyncResult result);
  2777. /// <summary>
  2778. /// Asynchronously invokes the 'GetProblemGroupSet' operation.
  2779. /// </summary>
  2780. /// <param name="callback">Callback to invoke on completion.</param>
  2781. /// <param name="asyncState">Optional state object.</param>
  2782. /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
  2783. [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/TaskStructureService/GetProblemGroupSetDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
  2784. [OperationContract(AsyncPattern=true, Action="http://tempuri.org/TaskStructureService/GetProblemGroupSet", ReplyAction="http://tempuri.org/TaskStructureService/GetProblemGroupSetResponse")]
  2785. [WebGet()]
  2786. IAsyncResult BeginGetProblemGroupSet(AsyncCallback callback, object asyncState);
  2787. /// <summary>
  2788. /// Completes the asynchronous operation begun by 'BeginGetProblemGroupSet'.
  2789. /// </summary>
  2790. /// <param name="result">The IAsyncResult returned from 'BeginGetProblemGroupSet'.</param>
  2791. /// <returns>The 'QueryResult' returned from the 'GetProblemGroupSet' operation.</returns>
  2792. QueryResult<ProblemGroup> EndGetProblemGroupSet(IAsyncResult result);
  2793. /// <summary>
  2794. /// Asynchronously invokes the 'GetProblemSet' operation.
  2795. /// </summary>
  2796. /// <param name="callback">Callback to invoke on completion.</param>
  2797. /// <param name="asyncState">Optional state object.</param>
  2798. /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
  2799. [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/TaskStructureService/GetProblemSetDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
  2800. [OperationContract(AsyncPattern=true, Action="http://tempuri.org/TaskStructureService/GetProblemSet", ReplyAction="http://tempuri.org/TaskStructureService/GetProblemSetResponse")]
  2801. [WebGet()]
  2802. IAsyncResult BeginGetProblemSet(AsyncCallback callback, object asyncState);
  2803. /// <summary>
  2804. /// Completes the asynchronous operation begun by 'BeginGetProblemSet'.
  2805. /// </summary>
  2806. /// <param name="result">The IAsyncResult returned from 'BeginGetProblemSet'.</param>
  2807. /// <returns>The 'QueryResult' returned from the 'GetProblemSet' operation.</returns>
  2808. QueryResult<Problem> EndGetProblemSet(IAsyncResult result);
  2809. /// <summary>
  2810. /// Asynchronously invokes the 'GetProblemSetByGroupId' operation.
  2811. /// </summary>
  2812. /// <param name="id">The value for the 'id' parameter of this action.</param>
  2813. /// <param name="callback">Callback to invoke on completion.</param>
  2814. /// <param name="asyncState">Optional state object.</param>
  2815. /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
  2816. [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/TaskStructureService/GetProblemSetByGroupIdDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
  2817. [OperationContract(AsyncPattern=true, Action="http://tempuri.org/TaskStructureService/GetProblemSetByGroupId", ReplyAction="http://tempuri.org/TaskStructureService/GetProblemSetByGroupIdResponse")]
  2818. [WebGet()]
  2819. IAsyncResult BeginGetProblemSetByGroupId(int id, AsyncCallback callback, object asyncState);
  2820. /// <summary>
  2821. /// Completes the asynchronous operation begun by 'BeginGetProblemSetByGroupId'.
  2822. /// </summary>
  2823. /// <param name="result">The IAsyncResult returned from 'BeginGetProblemSetByGroupId'.</param>
  2824. /// <returns>The 'QueryResult' returned from the 'GetProblemSetByGroupId' operation.</returns>
  2825. QueryResult<Problem> EndGetProblemSetByGroupId(IAsyncResult result);
  2826. /// <summary>
  2827. /// Asynchronously invokes the 'GetSubmissionSet' operation.
  2828. /// </summary>
  2829. /// <param name="callback">Callback to invoke on completion.</param>
  2830. /// <param name="asyncState">Optional state object.</param>
  2831. /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
  2832. [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/TaskStructureService/GetSubmissionSetDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
  2833. [OperationContract(AsyncPattern=true, Action="http://tempuri.org/TaskStructureService/GetSubmissionSet", ReplyAction="http://tempuri.org/TaskStructureService/GetSubmissionSetResponse")]
  2834. [WebGet()]
  2835. IAsyncResult BeginGetSubmissionSet(AsyncCallback callback, object asyncState);
  2836. /// <summary>
  2837. /// Completes the asynchronous operation begun by 'BeginGetSubmissionSet'.
  2838. /// </summary>
  2839. /// <param name="result">The IAsyncResult returned from 'BeginGetSubmissionSet'.</param>
  2840. /// <returns>The 'QueryResult' returned from the 'GetSubmissionSet' operation.</returns>
  2841. QueryResult<Submission> EndGetSubmissionSet(IAsyncResult result);
  2842. /// <summary>
  2843. /// Asynchronously invokes the 'GetUsers' operation.
  2844. /// </summary>
  2845. /// <param name="callback">Callback to invoke on completion.</param>
  2846. /// <param name="asyncState">Optional state object.</param>
  2847. /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
  2848. [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/TaskStructureService/GetUsersDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
  2849. [OperationContract(AsyncPattern=true, Action="http://tempuri.org/TaskStructureService/GetUsers", ReplyAction="http://tempuri.org/TaskStructureService/GetUsersResponse")]
  2850. [WebGet()]
  2851. IAsyncResult BeginGetUsers(AsyncCallback callback, object asyncState);
  2852. /// <summary>
  2853. /// Completes the asynchronous operation begun by 'BeginGetUsers'.
  2854. /// </summary>
  2855. /// <param name="result">The IAsyncResult returned from 'BeginGetUsers'.</param>
  2856. /// <returns>The 'QueryResult' returned from the 'GetUsers' operation.</returns>
  2857. QueryResult<User> EndGetUsers(IAsyncResult result);
  2858. /// <summary>
  2859. /// Asynchronously invokes the 'SubmitChanges' operation.
  2860. /// </summary>
  2861. /// <param name="changeSet">The change-set to submit.</param>
  2862. /// <param name="callback">Callback to invoke on completion.</param>
  2863. /// <param name="asyncState">Optional state object.</param>
  2864. /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
  2865. [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/TaskStructureService/SubmitChangesDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
  2866. [OperationContract(AsyncPattern=true, Action="http://tempuri.org/TaskStructureService/SubmitChanges", ReplyAction="http://tempuri.org/TaskStructureService/SubmitChangesResponse")]
  2867. IAsyncResult BeginSubmitChanges(IEnumerable<ChangeSetEntry> changeSet, AsyncCallback callback, object asyncState);
  2868. /// <summary>
  2869. /// Completes the asynchronous operation begun by 'BeginSubmitChanges'.
  2870. /// </summary>
  2871. /// <param name="result">The IAsyncResult returned from 'BeginSubmitChanges'.</param>
  2872. /// <returns>The collection of change-set entry elements returned from 'SubmitChanges'.</returns>
  2873. IEnumerable<ChangeSetEntry> EndSubmitChanges(IAsyncResult result);
  2874. }
  2875. internal sealed class TaskStructureContextEntityContainer : EntityContainer
  2876. {
  2877. public TaskStructureContextEntityContainer()
  2878. {
  2879. this.CreateEntitySet<Assignment>(EntitySetOperations.All);
  2880. this.CreateEntitySet<Course>(EntitySetOperations.All);
  2881. this.CreateEntitySet<Group>(EntitySetOperations.All);
  2882. this.CreateEntitySet<Membership>(EntitySetOperations.All);
  2883. this.CreateEntitySet<Participation>(EntitySetOperations.All);
  2884. this.CreateEntitySet<Problem>(EntitySetOperations.All);
  2885. this.CreateEntitySet<ProblemGroup>(EntitySetOperations.All);
  2886. this.CreateEntitySet<Submission>(EntitySetOperations.All);
  2887. this.CreateEntitySet<User>(EntitySetOperations.All);
  2888. }
  2889. }
  2890. }
  2891. }
  2892. namespace glados.Web.Services.Entities
  2893. {
  2894. using System;
  2895. using System.Collections.Generic;
  2896. using System.ComponentModel;
  2897. using System.ComponentModel.DataAnnotations;
  2898. using System.Linq;
  2899. using System.Runtime.Serialization;
  2900. using System.ServiceModel.DomainServices;
  2901. using System.ServiceModel.DomainServices.Client;
  2902. using System.ServiceModel.DomainServices.Client.ApplicationServices;
  2903. using System.Xml.Serialization;
  2904. using Glados.TestingModule.Interfaces;
  2905. /// <summary>
  2906. /// The 'ProblemDetails' class.
  2907. /// </summary>
  2908. [DataContract(Namespace="http://schemas.datacontract.org/2004/07/glados.Web.Services.Entities")]
  2909. [XmlRoot(ElementName="task")]
  2910. public sealed partial class ProblemDetails : ComplexObject
  2911. {
  2912. private string[] _compilers;
  2913. private int _id;
  2914. private string _name;
  2915. private string _statementPath;
  2916. private TestingInformation _testingInformation;
  2917. #region Extensibility Method Definitions
  2918. /// <summary>
  2919. /// This method is invoked from the constructor once initialization is complete and
  2920. /// can be used for further object setup.
  2921. /// </summary>
  2922. partial void OnCreated();
  2923. partial void OnCompilersChanging(string[] value);
  2924. partial void OnCompilersChanged();
  2925. partial void OnIdChanging(int value);
  2926. partial void OnIdChanged();
  2927. partial void OnNameChanging(string value);
  2928. partial void OnNameChanged();
  2929. partial void OnStatementPathChanging(string value);
  2930. partial void OnStatementPathChanged();
  2931. partial void OnTestingInformationChanging(TestingInformation value);
  2932. partial void OnTestingInformationChanged();
  2933. #endregion
  2934. /// <summary>
  2935. /// Initializes a new instance of the <see cref="ProblemDetails"/> class.
  2936. /// </summary>
  2937. public ProblemDetails()
  2938. {
  2939. this.OnCreated();
  2940. }
  2941. /// <summary>
  2942. /// Gets or sets the 'Compilers' value.
  2943. /// </summary>
  2944. [DataMember()]
  2945. [XmlIgnore()]
  2946. public string[] Compilers
  2947. {
  2948. get
  2949. {
  2950. return this._compilers;
  2951. }
  2952. set
  2953. {
  2954. if ((this._compilers != value))
  2955. {
  2956. this.OnCompilersChanging(value);
  2957. this.RaiseDataMemberChanging("Compilers");
  2958. this.ValidateProperty("Compilers", value);
  2959. this._compilers = value;
  2960. this.RaiseDataMemberChanged("Compilers");
  2961. this.OnCompilersChanged();
  2962. }
  2963. }
  2964. }
  2965. /// <summary>
  2966. /// Gets or sets the 'Id' value.
  2967. /// </summary>
  2968. [DataMember()]
  2969. [XmlIgnore()]
  2970. public int Id
  2971. {
  2972. get
  2973. {
  2974. return this._id;
  2975. }
  2976. set
  2977. {
  2978. if ((this._id != value))
  2979. {
  2980. this.OnIdChanging(value);
  2981. this.RaiseDataMemberChanging("Id");
  2982. this.ValidateProperty("Id", value);
  2983. this._id = value;
  2984. this.RaiseDataMemberChanged("Id");
  2985. this.OnIdChanged();
  2986. }
  2987. }
  2988. }
  2989. /// <summary>
  2990. /// Gets or sets the 'Name' value.
  2991. /// </summary>
  2992. [DataMember()]
  2993. [XmlElement(ElementName="name")]
  2994. public string Name
  2995. {
  2996. get
  2997. {
  2998. return this._name;
  2999. }
  3000. set
  3001. {
  3002. if ((this._name != value))
  3003. {
  3004. this.OnNameChanging(value);
  3005. this.RaiseDataMemberChanging("Name");
  3006. this.ValidateProperty("Name", value);
  3007. this._name = value;
  3008. this.RaiseDataMemberChanged("Name");
  3009. this.OnNameChanged();
  3010. }
  3011. }
  3012. }
  3013. /// <summary>
  3014. /// Gets or sets the 'StatementPath' value.
  3015. /// </summary>
  3016. [DataMember()]
  3017. [XmlIgnore()]
  3018. public string StatementPath
  3019. {
  3020. get
  3021. {
  3022. return this._statementPath;
  3023. }
  3024. set
  3025. {
  3026. if ((this._statementPath != value))
  3027. {
  3028. this.OnStatementPathChanging(value);
  3029. this.RaiseDataMemberChanging("StatementPath");
  3030. this.ValidateProperty("StatementPath", value);
  3031. this._statementPath = value;
  3032. this.RaiseDataMemberChanged("StatementPath");
  3033. this.OnStatementPathChanged();
  3034. }
  3035. }
  3036. }
  3037. /// <summary>
  3038. /// Gets or sets the 'TestingInformation' value.
  3039. /// </summary>
  3040. [DataMember()]
  3041. [Display(AutoGenerateField=false)]
  3042. [XmlElement(ElementName="testingInfo")]
  3043. public TestingInformation TestingInformation
  3044. {
  3045. get
  3046. {
  3047. return this._testingInformation;
  3048. }
  3049. set
  3050. {
  3051. if ((this._testingInformation != value))
  3052. {
  3053. this.OnTestingInformationChanging(value);
  3054. this.RaiseDataMemberChanging("TestingInformation");
  3055. this.ValidateProperty("TestingInformation", value);
  3056. this._testingInformation = value;
  3057. this.RaiseDataMemberChanged("TestingInformation");
  3058. this.OnTestingInformationChanged();
  3059. }
  3060. }
  3061. }
  3062. }
  3063. /// <summary>
  3064. /// The 'TaskIOFile' class.
  3065. /// </summary>
  3066. [DataContract(Namespace="http://schemas.datacontract.org/2004/07/glados.Web.Services.Entities")]
  3067. public sealed partial class TaskIOFile : ComplexObject
  3068. {
  3069. private string _name;
  3070. private string _type;
  3071. #region Extensibility Method Definitions
  3072. /// <summary>
  3073. /// This method is invoked from the constructor once initialization is complete and
  3074. /// can be used for further object setup.
  3075. /// </summary>
  3076. partial void OnCreated();
  3077. partial void OnNameChanging(string value);
  3078. partial void OnNameChanged();
  3079. partial void OnTypeChanging(string value);
  3080. partial void OnTypeChanged();
  3081. #endregion
  3082. /// <summary>
  3083. /// Initializes a new instance of the <see cref="TaskIOFile"/> class.
  3084. /// </summary>
  3085. public TaskIOFile()
  3086. {
  3087. this.OnCreated();
  3088. }
  3089. /// <summary>
  3090. /// Gets or sets the 'Name' value.
  3091. /// </summary>
  3092. [DataMember()]
  3093. [XmlText()]
  3094. public string Name
  3095. {
  3096. get
  3097. {
  3098. return this._name;
  3099. }
  3100. set
  3101. {
  3102. if ((this._name != value))
  3103. {
  3104. this.OnNameChanging(value);
  3105. this.RaiseDataMemberChanging("Name");
  3106. this.ValidateProperty("Name", value);
  3107. this._name = value;
  3108. this.RaiseDataMemberChanged("Name");
  3109. this.OnNameChanged();
  3110. }
  3111. }
  3112. }
  3113. /// <summary>
  3114. /// Gets or sets the 'Type' value.
  3115. /// </summary>
  3116. [DataMember()]
  3117. [XmlAttribute(AttributeName="type")]
  3118. public string Type
  3119. {
  3120. get
  3121. {
  3122. return this._type;
  3123. }
  3124. set
  3125. {
  3126. if ((this._type != value))
  3127. {
  3128. this.OnTypeChanging(value);
  3129. this.RaiseDataMemberChanging("Type");
  3130. this.ValidateProperty("Type", value);
  3131. this._type = value;
  3132. this.RaiseDataMemberChanged("Type");
  3133. this.OnTypeChanged();
  3134. }
  3135. }
  3136. }
  3137. }
  3138. /// <summary>
  3139. /// The 'TestDescriptor' class.
  3140. /// </summary>
  3141. [DataContract(Namespace="http://schemas.datacontract.org/2004/07/glados.Web.Services.Entities")]
  3142. public sealed partial class TestDescriptor : ComplexObject
  3143. {
  3144. private int _id;
  3145. private int _memoryLimitMb;
  3146. private float _timeLimitSec;
  3147. #region Extensibility Method Definitions
  3148. /// <summary>
  3149. /// This method is invoked from the constructor once initialization is complete and
  3150. /// can be used for further object setup.
  3151. /// </summary>
  3152. partial void OnCreated();
  3153. partial void OnIdChanging(int value);
  3154. partial void OnIdChanged();
  3155. partial void OnMemoryLimitMbChanging(int value);
  3156. partial void OnMemoryLimitMbChanged();
  3157. partial void OnTimeLimitSecChanging(float value);
  3158. partial void OnTimeLimitSecChanged();
  3159. #endregion
  3160. /// <summary>
  3161. /// Initializes a new instance of the <see cref="TestDescriptor"/> class.
  3162. /// </summary>
  3163. public TestDescriptor()
  3164. {
  3165. this.OnCreated();
  3166. }
  3167. /// <summary>
  3168. /// Gets or sets the 'Id' value.
  3169. /// </summary>
  3170. [DataMember()]
  3171. [XmlAttribute(AttributeName="id")]
  3172. public int Id
  3173. {
  3174. get
  3175. {
  3176. return this._id;
  3177. }
  3178. set
  3179. {
  3180. if ((this._id != value))
  3181. {
  3182. this.OnIdChanging(value);
  3183. this.RaiseDataMemberChanging("Id");
  3184. this.ValidateProperty("Id", value);
  3185. this._id = value;
  3186. this.RaiseDataMemberChanged("Id");
  3187. this.OnIdChanged();
  3188. }
  3189. }
  3190. }
  3191. /// <summary>
  3192. /// Gets or sets the 'MemoryLimitMb' value.
  3193. /// </summary>
  3194. [DataMember()]
  3195. [XmlAttribute(AttributeName="memoryLimit")]
  3196. public int MemoryLimitMb
  3197. {
  3198. get
  3199. {
  3200. return this._memoryLimitMb;
  3201. }
  3202. set
  3203. {
  3204. if ((this._memoryLimitMb != value))
  3205. {
  3206. this.OnMemoryLimitMbChanging(value);
  3207. this.RaiseDataMemberChanging("MemoryLimitMb");
  3208. this.ValidateProperty("MemoryLimitMb", value);
  3209. this._memoryLimitMb = value;
  3210. this.RaiseDataMemberChanged("MemoryLimitMb");
  3211. this.OnMemoryLimitMbChanged();
  3212. }
  3213. }
  3214. }
  3215. /// <summary>
  3216. /// Gets or sets the 'TimeLimitSec' value.
  3217. /// </summary>
  3218. [DataMember()]
  3219. [XmlAttribute(AttributeName="timeLimit")]
  3220. public float TimeLimitSec
  3221. {
  3222. get
  3223. {
  3224. return this._timeLimitSec;
  3225. }
  3226. set
  3227. {
  3228. if ((this._timeLimitSec != value))
  3229. {
  3230. this.OnTimeLimitSecChanging(value);
  3231. this.RaiseDataMemberChanging("TimeLimitSec");
  3232. this.ValidateProperty("TimeLimitSec", value);
  3233. this._timeLimitSec = value;
  3234. this.RaiseDataMemberChanged("TimeLimitSec");
  3235. this.OnTimeLimitSecChanged();
  3236. }
  3237. }
  3238. }
  3239. }
  3240. /// <summary>
  3241. /// The 'TestingInformation' class.
  3242. /// </summary>
  3243. [DataContract(Namespace="http://schemas.datacontract.org/2004/07/glados.Web.Services.Entities")]
  3244. public sealed partial class TestingInformation : ComplexObject
  3245. {
  3246. private TaskIOFile[] _ioFiles;
  3247. private TestDescriptor[] _tests;
  3248. #region Extensibility Method Definitions
  3249. /// <summary>
  3250. /// This method is invoked from the constructor once initialization is complete and
  3251. /// can be used for further object setup.
  3252. /// </summary>
  3253. partial void OnCreated();
  3254. partial void OnIOFilesChanging(TaskIOFile[] value);
  3255. partial void OnIOFilesChanged();
  3256. partial void OnTestsChanging(TestDescriptor[] value);
  3257. partial void OnTestsChanged();
  3258. #endregion
  3259. /// <summary>
  3260. /// Initializes a new instance of the <see cref="TestingInformation"/> class.
  3261. /// </summary>
  3262. public TestingInformation()
  3263. {
  3264. this.OnCreated();
  3265. }
  3266. /// <summary>
  3267. /// Gets or sets the 'IOFiles' value.
  3268. /// </summary>
  3269. [DataMember()]
  3270. [Display(AutoGenerateField=false)]
  3271. [XmlArray(ElementName="files")]
  3272. [XmlArrayItem(ElementName="file")]
  3273. public TaskIOFile[] IOFiles
  3274. {
  3275. get
  3276. {
  3277. return this._ioFiles;
  3278. }
  3279. set
  3280. {
  3281. if ((this._ioFiles != value))
  3282. {
  3283. this.OnIOFilesChanging(value);
  3284. this.RaiseDataMemberChanging("IOFiles");
  3285. this.ValidateProperty("IOFiles", value);
  3286. this._ioFiles = value;
  3287. this.RaiseDataMemberChanged("IOFiles");
  3288. this.OnIOFilesChanged();
  3289. }
  3290. }
  3291. }
  3292. /// <summary>
  3293. /// Gets or sets the 'Tests' value.
  3294. /// </summary>
  3295. [DataMember()]
  3296. [Display(AutoGenerateField=false)]
  3297. [XmlArray(ElementName="tests")]
  3298. [XmlArrayItem(ElementName="test")]
  3299. public TestDescriptor[] Tests
  3300. {
  3301. get
  3302. {
  3303. return this._tests;
  3304. }
  3305. set
  3306. {
  3307. if ((this._tests != value))
  3308. {
  3309. this.OnTestsChanging(value);
  3310. this.RaiseDataMemberChanging("Tests");
  3311. this.ValidateProperty("Tests", value);
  3312. this._tests = value;
  3313. this.RaiseDataMemberChanged("Tests");
  3314. this.OnTestsChanged();
  3315. }
  3316. }
  3317. }
  3318. }
  3319. /// <summary>
  3320. /// The 'TestingMachineEntity' entity class.
  3321. /// </summary>
  3322. [DataContract(Namespace="http://schemas.datacontract.org/2004/07/glados.Web.Services.Entities")]
  3323. public sealed partial class TestingMachineEntity : Entity
  3324. {
  3325. private string _name;
  3326. private ServerStatus _status;
  3327. #region Extensibility Method Definitions
  3328. /// <summary>
  3329. /// This method is invoked from the constructor once initialization is complete and
  3330. /// can be used for further object setup.
  3331. /// </summary>
  3332. partial void OnCreated();
  3333. partial void OnNameChanging(string value);
  3334. partial void OnNameChanged();
  3335. partial void OnStatusChanging(ServerStatus value);
  3336. partial void OnStatusChanged();
  3337. #endregion
  3338. /// <summary>
  3339. /// Initializes a new instance of the <see cref="TestingMachineEntity"/> class.
  3340. /// </summary>
  3341. public TestingMachineEntity()
  3342. {
  3343. this.OnCreated();
  3344. }
  3345. /// <summary>
  3346. /// Gets or sets the 'Name' value.
  3347. /// </summary>
  3348. [DataMember()]
  3349. [Editable(false, AllowInitialValue=true)]
  3350. [Key()]
  3351. [RoundtripOriginal()]
  3352. public string Name
  3353. {
  3354. get
  3355. {
  3356. return this._name;
  3357. }
  3358. set
  3359. {
  3360. if ((this._name != value))
  3361. {
  3362. this.OnNameChanging(value);
  3363. this.ValidateProperty("Name", value);
  3364. this._name = value;
  3365. this.RaisePropertyChanged("Name");
  3366. this.OnNameChanged();
  3367. }
  3368. }
  3369. }
  3370. /// <summary>
  3371. /// Gets or sets the 'Status' value.
  3372. /// </summary>
  3373. [DataMember()]
  3374. public ServerStatus Status
  3375. {
  3376. get
  3377. {
  3378. return this._status;
  3379. }
  3380. set
  3381. {
  3382. if ((this._status != value))
  3383. {
  3384. this.OnStatusChanging(value);
  3385. this.RaiseDataMemberChanging("Status");
  3386. this.ValidateProperty("Status", value);
  3387. this._status = value;
  3388. this.RaiseDataMemberChanged("Status");
  3389. this.OnStatusChanged();
  3390. }
  3391. }
  3392. }
  3393. /// <summary>
  3394. /// Computes a value from the key fields that uniquely identifies this entity instance.
  3395. /// </summary>
  3396. /// <returns>An object instance that uniquely identifies this entity instance.</returns>
  3397. public override object GetIdentity()
  3398. {
  3399. return this._name;
  3400. }
  3401. }
  3402. }
  3403. namespace glados.Web.Services.RIAServices
  3404. {
  3405. using System;
  3406. using System.Collections.Generic;
  3407. using System.ComponentModel;
  3408. using System.ComponentModel.DataAnnotations;
  3409. using System.Linq;
  3410. using System.ServiceModel;
  3411. using System.ServiceModel.DomainServices;
  3412. using System.ServiceModel.DomainServices.Client;
  3413. using System.ServiceModel.DomainServices.Client.ApplicationServices;
  3414. using glados.Web.Services.Entities;
  3415. /// <summary>
  3416. /// The DomainContext corresponding to the 'CompetitionAdminService' DomainService.
  3417. /// </summary>
  3418. public sealed partial class CompetitionAdminContext : DomainContext
  3419. {
  3420. #region Extensibility Method Definitions
  3421. /// <summary>
  3422. /// This method is invoked from the constructor once initialization is complete and
  3423. /// can be used for further object setup.
  3424. /// </summary>
  3425. partial void OnCreated();
  3426. #endregion
  3427. /// <summary>
  3428. /// Initializes a new instance of the <see cref="CompetitionAdminContext"/> class.
  3429. /// </summary>
  3430. public CompetitionAdminContext() :
  3431. this(new WebDomainClient<ICompetitionAdminServiceContract>(new Uri("glados-Web-Services-RIAServices-CompetitionAdminService.svc", UriKind.Relative)))
  3432. {
  3433. }
  3434. /// <summary>
  3435. /// Initializes a new instance of the <see cref="CompetitionAdminContext"/> class with the specified service URI.
  3436. /// </summary>
  3437. /// <param name="serviceUri">The CompetitionAdminService service URI.</param>
  3438. public CompetitionAdminContext(Uri serviceUri) :
  3439. this(new WebDomainClient<ICompetitionAdminServiceContract>(serviceUri))
  3440. {
  3441. }
  3442. /// <summary>
  3443. /// Initializes a new instance of the <see cref="CompetitionAdminContext"/> class with the specified <paramref name="domainClient"/>.
  3444. /// </summary>
  3445. /// <param name="domainClient">The DomainClient instance to use for this DomainContext.</param>
  3446. public CompetitionAdminContext(DomainClient domainClient) :
  3447. base(domainClient)
  3448. {
  3449. this.OnCreated();
  3450. }
  3451. /// <summary>
  3452. /// Asynchronously invokes the 'CreateCompetition' method of the DomainService.
  3453. /// </summary>
  3454. /// <param name="name">The value for the 'name' parameter of this action.</param>
  3455. /// <param name="typeName">The value for the 'typeName' parameter of this action.</param>
  3456. /// <param name="callback">Callback to invoke when the operation completes.</param>
  3457. /// <param name="userState">Value to pass to the callback. It can be <c>null</c>.</param>
  3458. /// <returns>An operation instance that can be used to manage the asynchronous request.</returns>
  3459. public InvokeOperation<int> CreateCompetition(string name, string typeName, Action<InvokeOperation<int>> callback, object userState)
  3460. {
  3461. Dictionary<string, object> parameters = new Dictionary<string, object>();
  3462. parameters.Add("name", name);
  3463. parameters.Add("typeName", typeName);
  3464. this.ValidateMethod("CreateCompetition", parameters);
  3465. return ((InvokeOperation<int>)(this.InvokeOperation("CreateCompetition", typeof(int), parameters, true, callback, userState)));
  3466. }
  3467. /// <summary>
  3468. /// Asynchronously invokes the 'CreateCompetition' method of the DomainService.
  3469. /// </summary>
  3470. /// <param name="name">The value for the 'name' parameter of this action.</param>
  3471. /// <param name="typeName">The value for the 'typeName' parameter of this action.</param>
  3472. /// <returns>An operation instance that can be used to manage the asynchronous request.</returns>
  3473. public InvokeOperation<int> CreateCompetition(string name, string typeName)
  3474. {
  3475. Dictionary<string, object> parameters = new Dictionary<string, object>();
  3476. parameters.Add("name", name);
  3477. parameters.Add("typeName", typeName);
  3478. this.ValidateMethod("CreateCompetition", parameters);
  3479. return ((InvokeOperation<int>)(this.InvokeOperation("CreateCompetition", typeof(int), parameters, true, null, null)));
  3480. }
  3481. /// <summary>
  3482. /// Asynchronously invokes the 'DeleteCompetition' method of the DomainService.
  3483. /// </summary>
  3484. /// <param name="id">The value for the 'id' parameter of this action.</param>
  3485. /// <param name="callback">Callback to invoke when the operation completes.</param>
  3486. /// <param name="userState">Value to pass to the callback. It can be <c>null</c>.</param>
  3487. /// <returns>An operation instance that can be used to manage the asynchronous request.</returns>
  3488. public InvokeOperation DeleteCompetition(int id, Action<InvokeOperation> callback, object userState)
  3489. {
  3490. Dictionary<string, object> parameters = new Dictionary<string, object>();
  3491. parameters.Add("id", id);
  3492. this.ValidateMethod("DeleteCompetition", parameters);
  3493. return this.InvokeOperation("DeleteCompetition", typeof(void), parameters, true, callback, userState);
  3494. }
  3495. /// <summary>
  3496. /// Asynchronously invokes the 'DeleteCompetition' method of the DomainService.
  3497. /// </summary>
  3498. /// <param name="id">The value for the 'id' parameter of this action.</param>
  3499. /// <returns>An operation instance that can be used to manage the asynchronous request.</returns>
  3500. public InvokeOperation DeleteCompetition(int id)
  3501. {
  3502. Dictionary<string, object> parameters = new Dictionary<string, object>();
  3503. parameters.Add("id", id);
  3504. this.ValidateMethod("DeleteCompetition", parameters);
  3505. return this.InvokeOperation("DeleteCompetition", typeof(void), parameters, true, null, null);
  3506. }
  3507. /// <summary>
  3508. /// Asynchronously invokes the 'GetCompetitionMainPage' method of the DomainService.
  3509. /// </summary>
  3510. /// <param name="id">The value for the 'id' parameter of this action.</param>
  3511. /// <param name="callback">Callback to invoke when the operation completes.</param>
  3512. /// <param name="userState">Value to pass to the callback. It can be <c>null</c>.</param>
  3513. /// <returns>An operation instance that can be used to manage the asynchronous request.</returns>
  3514. public InvokeOperation<Uri> GetCompetitionMainPage(int id, Action<InvokeOperation<Uri>> callback, object userState)
  3515. {
  3516. Dictionary<string, object> parameters = new Dictionary<string, object>();
  3517. parameters.Add("id", id);
  3518. this.ValidateMethod("GetCompetitionMainPage", parameters);
  3519. return ((InvokeOperation<Uri>)(this.InvokeOperation("GetCompetitionMainPage", typeof(Uri), parameters, true, callback, userState)));
  3520. }
  3521. /// <summary>
  3522. /// Asynchronously invokes the 'GetCompetitionMainPage' method of the DomainService.
  3523. /// </summary>
  3524. /// <param name="id">The value for the 'id' parameter of this action.</param>
  3525. /// <returns>An operation instance that can be used to manage the asynchronous request.</returns>
  3526. public InvokeOperation<Uri> GetCompetitionMainPage(int id)
  3527. {
  3528. Dictionary<string, object> parameters = new Dictionary<string, object>();
  3529. parameters.Add("id", id);
  3530. this.ValidateMethod("GetCompetitionMainPage", parameters);
  3531. return ((InvokeOperation<Uri>)(this.InvokeOperation("GetCompetitionMainPage", typeof(Uri), parameters, true, null, null)));
  3532. }
  3533. /// <summary>
  3534. /// Asynchronously invokes the 'GetCompetitionTypeList' method of the DomainService.
  3535. /// </summary>
  3536. /// <param name="callback">Callback to invoke when the operation completes.</param>
  3537. /// <param name="userState">Value to pass to the callback. It can be <c>null</c>.</param>
  3538. /// <returns>An operation instance that can be used to manage the asynchronous request.</returns>
  3539. public InvokeOperation<IEnumerable<string>> GetCompetitionTypeList(Action<InvokeOperation<IEnumerable<string>>> callback, object userState)
  3540. {
  3541. this.ValidateMethod("GetCompetitionTypeList", null);
  3542. return ((InvokeOperation<IEnumerable<string>>)(this.InvokeOperation("GetCompetitionTypeList", typeof(IEnumerable<string>), null, true, callback, userState)));
  3543. }
  3544. /// <summary>
  3545. /// Asynchronously invokes the 'GetCompetitionTypeList' method of the DomainService.
  3546. /// </summary>
  3547. /// <returns>An operation instance that can be used to manage the asynchronous request.</returns>
  3548. public InvokeOperation<IEnumerable<string>> GetCompetitionTypeList()
  3549. {
  3550. this.ValidateMethod("GetCompetitionTypeList", null);
  3551. return ((InvokeOperation<IEnumerable<string>>)(this.InvokeOperation("GetCompetitionTypeList", typeof(IEnumerable<string>), null, true, null, null)));
  3552. }
  3553. /// <summary>
  3554. /// Creates a new EntityContainer for this DomainContext's EntitySets.
  3555. /// </summary>
  3556. /// <returns>A new container instance.</returns>
  3557. protected override EntityContainer CreateEntityContainer()
  3558. {
  3559. return new CompetitionAdminContextEntityContainer();
  3560. }
  3561. /// <summary>
  3562. /// Service contract for the 'CompetitionAdminService' DomainService.
  3563. /// </summary>
  3564. [ServiceContract()]
  3565. public interface ICompetitionAdminServiceContract
  3566. {
  3567. /// <summary>
  3568. /// Asynchronously invokes the 'CreateCompetition' operation.
  3569. /// </summary>
  3570. /// <param name="name">The value for the 'name' parameter of this action.</param>
  3571. /// <param name="typeName">The value for the 'typeName' parameter of this action.</param>
  3572. /// <param name="callback">Callback to invoke on completion.</param>
  3573. /// <param name="asyncState">Optional state object.</param>
  3574. /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
  3575. [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/CompetitionAdminService/CreateCompetitionDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
  3576. [OperationContract(AsyncPattern=true, Action="http://tempuri.org/CompetitionAdminService/CreateCompetition", ReplyAction="http://tempuri.org/CompetitionAdminService/CreateCompetitionResponse")]
  3577. IAsyncResult BeginCreateCompetition(string name, string typeName, AsyncCallback callback, object asyncState);
  3578. /// <summary>
  3579. /// Completes the asynchronous operation begun by 'BeginCreateCompetition'.
  3580. /// </summary>
  3581. /// <param name="result">The IAsyncResult returned from 'BeginCreateCompetition'.</param>
  3582. /// <returns>The 'Int32' returned from the 'CreateCompetition' operation.</returns>
  3583. int EndCreateCompetition(IAsyncResult result);
  3584. /// <summary>
  3585. /// Asynchronously invokes the 'DeleteCompetition' operation.
  3586. /// </summary>
  3587. /// <param name="id">The value for the 'id' parameter of this action.</param>
  3588. /// <param name="callback">Callback to invoke on completion.</param>
  3589. /// <param name="asyncState">Optional state object.</param>
  3590. /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
  3591. [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/CompetitionAdminService/DeleteCompetitionDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
  3592. [OperationContract(AsyncPattern=true, Action="http://tempuri.org/CompetitionAdminService/DeleteCompetition", ReplyAction="http://tempuri.org/CompetitionAdminService/DeleteCompetitionResponse")]
  3593. IAsyncResult BeginDeleteCompetition(int id, AsyncCallback callback, object asyncState);
  3594. /// <summary>
  3595. /// Completes the asynchronous operation begun by 'BeginDeleteCompetition'.
  3596. /// </summary>
  3597. /// <param name="result">The IAsyncResult returned from 'BeginDeleteCompetition'.</param>
  3598. void EndDeleteCompetition(IAsyncResult result);
  3599. /// <summary>
  3600. /// Asynchronously invokes the 'GetCompetitionMainPage' operation.
  3601. /// </summary>
  3602. /// <param name="id">The value for the 'id' parameter of this action.</param>
  3603. /// <param name="callback">Callback to invoke on completion.</param>
  3604. /// <param name="asyncState">Optional state object.</param>
  3605. /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
  3606. [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/CompetitionAdminService/GetCompetitionMainPageDomainServiceFau" +
  3607. "lt", Name="DomainServiceFault", Namespace="DomainServices")]
  3608. [OperationContract(AsyncPattern=true, Action="http://tempuri.org/CompetitionAdminService/GetCompetitionMainPage", ReplyAction="http://tempuri.org/CompetitionAdminService/GetCompetitionMainPageResponse")]
  3609. IAsyncResult BeginGetCompetitionMainPage(int id, AsyncCallback callback, object asyncState);
  3610. /// <summary>
  3611. /// Completes the asynchronous operation begun by 'BeginGetCompetitionMainPage'.
  3612. /// </summary>
  3613. /// <param name="result">The IAsyncResult returned from 'BeginGetCompetitionMainPage'.</param>
  3614. /// <returns>The 'Uri' returned from the 'GetCompetitionMainPage' operation.</returns>
  3615. Uri EndGetCompetitionMainPage(IAsyncResult result);
  3616. /// <summary>
  3617. /// Asynchronously invokes the 'GetCompetitionTypeList' operation.
  3618. /// </summary>
  3619. /// <param name="callback">Callback to invoke on completion.</param>
  3620. /// <param name="asyncState">Optional state object.</param>
  3621. /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
  3622. [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/CompetitionAdminService/GetCompetitionTypeListDomainServiceFau" +
  3623. "lt", Name="DomainServiceFault", Namespace="DomainServices")]
  3624. [OperationContract(AsyncPattern=true, Action="http://tempuri.org/CompetitionAdminService/GetCompetitionTypeList", ReplyAction="http://tempuri.org/CompetitionAdminService/GetCompetitionTypeListResponse")]
  3625. IAsyncResult BeginGetCompetitionTypeList(AsyncCallback callback, object asyncState);
  3626. /// <summary>
  3627. /// Completes the asynchronous operation begun by 'BeginGetCompetitionTypeList'.
  3628. /// </summary>
  3629. /// <param name="result">The IAsyncResult returned from 'BeginGetCompetitionTypeList'.</param>
  3630. /// <returns>The 'IEnumerable`1' returned from the 'GetCompetitionTypeList' operation.</returns>
  3631. IEnumerable<string> EndGetCompetitionTypeList(IAsyncResult result);
  3632. }
  3633. internal sealed class CompetitionAdminContextEntityContainer : EntityContainer
  3634. {
  3635. public CompetitionAdminContextEntityContainer()
  3636. {
  3637. }
  3638. }
  3639. }
  3640. /// <summary>
  3641. /// The DomainContext corresponding to the 'ParticipationService' DomainService.
  3642. /// </summary>
  3643. public sealed partial class ParticipationContext : DomainContext
  3644. {
  3645. #region Extensibility Method Definitions
  3646. /// <summary>
  3647. /// This method is invoked from the constructor once initialization is complete and
  3648. /// can be used for further object setup.
  3649. /// </summary>
  3650. partial void OnCreated();
  3651. #endregion
  3652. /// <summary>
  3653. /// Initializes a new instance of the <see cref="ParticipationContext"/> class.
  3654. /// </summary>
  3655. public ParticipationContext() :
  3656. this(new WebDomainClient<IParticipationServiceContract>(new Uri("glados-Web-Services-RIAServices-ParticipationService.svc", UriKind.Relative)))
  3657. {
  3658. }
  3659. /// <summary>
  3660. /// Initializes a new instance of the <see cref="ParticipationContext"/> class with the specified service URI.
  3661. /// </summary>
  3662. /// <param name="serviceUri">The ParticipationService service URI.</param>
  3663. public ParticipationContext(Uri serviceUri) :
  3664. this(new WebDomainClient<IParticipationServiceContract>(serviceUri))
  3665. {
  3666. }
  3667. /// <summary>
  3668. /// Initializes a new instance of the <see cref="ParticipationContext"/> class with the specified <paramref name="domainClient"/>.
  3669. /// </summary>
  3670. /// <param name="domainClient">The DomainClient instance to use for this DomainContext.</param>
  3671. public ParticipationContext(DomainClient domainClient) :
  3672. base(domainClient)
  3673. {
  3674. this.OnCreated();
  3675. }
  3676. /// <summary>
  3677. /// Asynchronously invokes the 'GetProblemByAssignmentId' method of the DomainService.
  3678. /// </summary>
  3679. /// <param name="assignmentId">The value for the 'assignmentId' parameter of this action.</param>
  3680. /// <param name="callback">Callback to invoke when the operation completes.</param>
  3681. /// <param name="userState">Value to pass to the callback. It can be <c>null</c>.</param>
  3682. /// <returns>An operation instance that can be used to manage the asynchronous request.</returns>
  3683. public InvokeOperation<ProblemDetails> GetProblemByAssignmentId(int assignmentId, Action<InvokeOperation<ProblemDetails>> callback, object userState)
  3684. {
  3685. Dictionary<string, object> parameters = new Dictionary<string, object>();
  3686. parameters.Add("assignmentId", assignmentId);
  3687. this.ValidateMethod("GetProblemByAssignmentId", parameters);
  3688. return ((InvokeOperation<ProblemDetails>)(this.InvokeOperation("GetProblemByAssignmentId", typeof(ProblemDetails), parameters, true, callback, userState)));
  3689. }
  3690. /// <summary>
  3691. /// Asynchronously invokes the 'GetProblemByAssignmentId' method of the DomainService.
  3692. /// </summary>
  3693. /// <param name="assignmentId">The value for the 'assignmentId' parameter of this action.</param>
  3694. /// <returns>An operation instance that can be used to manage the asynchronous request.</returns>
  3695. public InvokeOperation<ProblemDetails> GetProblemByAssignmentId(int assignmentId)
  3696. {
  3697. Dictionary<string, object> parameters = new Dictionary<string, object>();
  3698. parameters.Add("assignmentId", assignmentId);
  3699. this.ValidateMethod("GetProblemByAssignmentId", parameters);
  3700. return ((InvokeOperation<ProblemDetails>)(this.InvokeOperation("GetProblemByAssignmentId", typeof(ProblemDetails), parameters, true, null, null)));
  3701. }
  3702. /// <summary>
  3703. /// Asynchronously invokes the 'GetProblemDetails' method of the DomainService.
  3704. /// </summary>
  3705. /// <param name="problemId">The value for the 'problemId' parameter of this action.</param>
  3706. /// <param name="callback">Callback to invoke when the operation completes.</param>
  3707. /// <param name="userState">Value to pass to the callback. It can be <c>null</c>.</param>
  3708. /// <returns>An operation instance that can be used to manage the asynchronous request.</returns>
  3709. public InvokeOperation<ProblemDetails> GetProblemDetails(int problemId, Action<InvokeOperation<ProblemDetails>> callback, object userState)
  3710. {
  3711. Dictionary<string, object> parameters = new Dictionary<string, object>();
  3712. parameters.Add("problemId", problemId);
  3713. this.ValidateMethod("GetProblemDetails", parameters);
  3714. return ((InvokeOperation<ProblemDetails>)(this.InvokeOperation("GetProblemDetails", typeof(ProblemDetails), parameters, true, callback, userState)));
  3715. }
  3716. /// <summary>
  3717. /// Asynchronously invokes the 'GetProblemDetails' method of the DomainService.
  3718. /// </summary>
  3719. /// <param name="problemId">The value for the 'problemId' parameter of this action.</param>
  3720. /// <returns>An operation instance that can be used to manage the asynchronous request.</returns>
  3721. public InvokeOperation<ProblemDetails> GetProblemDetails(int problemId)
  3722. {
  3723. Dictionary<string, object> parameters = new Dictionary<string, object>();
  3724. parameters.Add("problemId", problemId);
  3725. this.ValidateMethod("GetProblemDetails", parameters);
  3726. return ((InvokeOperation<ProblemDetails>)(this.InvokeOperation("GetProblemDetails", typeof(ProblemDetails), parameters, true, null, null)));
  3727. }
  3728. /// <summary>
  3729. /// Asynchronously invokes the 'SubmitSolution' method of the DomainService.
  3730. /// </summary>
  3731. /// <param name="assignmentId">The value for the 'assignmentId' parameter of this action.</param>
  3732. /// <param name="compilerName">The value for the 'compilerName' parameter of this action.</param>
  3733. /// <param name="source">The value for the 'source' parameter of this action.</param>
  3734. /// <param name="callback">Callback to invoke when the operation completes.</param>
  3735. /// <param name="userState">Value to pass to the callback. It can be <c>null</c>.</param>
  3736. /// <returns>An operation instance that can be used to manage the asynchronous request.</returns>
  3737. public InvokeOperation<int> SubmitSolution(int assignmentId, string compilerName, byte[] source, Action<InvokeOperation<int>> callback, object userState)
  3738. {
  3739. Dictionary<string, object> parameters = new Dictionary<string, object>();
  3740. parameters.Add("assignmentId", assignmentId);
  3741. parameters.Add("compilerName", compilerName);
  3742. parameters.Add("source", source);
  3743. this.ValidateMethod("SubmitSolution", parameters);
  3744. return ((InvokeOperation<int>)(this.InvokeOperation("SubmitSolution", typeof(int), parameters, true, callback, userState)));
  3745. }
  3746. /// <summary>
  3747. /// Asynchronously invokes the 'SubmitSolution' method of the DomainService.
  3748. /// </summary>
  3749. /// <param name="assignmentId">The value for the 'assignmentId' parameter of this action.</param>
  3750. /// <param name="compilerName">The value for the 'compilerName' parameter of this action.</param>
  3751. /// <param name="source">The value for the 'source' parameter of this action.</param>
  3752. /// <returns>An operation instance that can be used to manage the asynchronous request.</returns>
  3753. public InvokeOperation<int> SubmitSolution(int assignmentId, string compilerName, byte[] source)
  3754. {
  3755. Dictionary<string, object> parameters = new Dictionary<string, object>();
  3756. parameters.Add("assignmentId", assignmentId);
  3757. parameters.Add("compilerName", compilerName);
  3758. parameters.Add("source", source);
  3759. this.ValidateMethod("SubmitSolution", parameters);
  3760. return ((InvokeOperation<int>)(this.InvokeOperation("SubmitSolution", typeof(int), parameters, true, null, null)));
  3761. }
  3762. /// <summary>
  3763. /// Creates a new EntityContainer for this DomainContext's EntitySets.
  3764. /// </summary>
  3765. /// <returns>A new container instance.</returns>
  3766. protected override EntityContainer CreateEntityContainer()
  3767. {
  3768. return new ParticipationContextEntityContainer();
  3769. }
  3770. /// <summary>
  3771. /// Service contract for the 'ParticipationService' DomainService.
  3772. /// </summary>
  3773. [ServiceContract()]
  3774. public interface IParticipationServiceContract
  3775. {
  3776. /// <summary>
  3777. /// Asynchronously invokes the 'GetProblemByAssignmentId' operation.
  3778. /// </summary>
  3779. /// <param name="assignmentId">The value for the 'assignmentId' parameter of this action.</param>
  3780. /// <param name="callback">Callback to invoke on completion.</param>
  3781. /// <param name="asyncState">Optional state object.</param>
  3782. /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
  3783. [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/ParticipationService/GetProblemByAssignmentIdDomainServiceFaul" +
  3784. "t", Name="DomainServiceFault", Namespace="DomainServices")]
  3785. [OperationContract(AsyncPattern=true, Action="http://tempuri.org/ParticipationService/GetProblemByAssignmentId", ReplyAction="http://tempuri.org/ParticipationService/GetProblemByAssignmentIdResponse")]
  3786. IAsyncResult BeginGetProblemByAssignmentId(int assignmentId, AsyncCallback callback, object asyncState);
  3787. /// <summary>
  3788. /// Completes the asynchronous operation begun by 'BeginGetProblemByAssignmentId'.
  3789. /// </summary>
  3790. /// <param name="result">The IAsyncResult returned from 'BeginGetProblemByAssignmentId'.</param>
  3791. /// <returns>The 'ProblemDetails' returned from the 'GetProblemByAssignmentId' operation.</returns>
  3792. ProblemDetails EndGetProblemByAssignmentId(IAsyncResult result);
  3793. /// <summary>
  3794. /// Asynchronously invokes the 'GetProblemDetails' operation.
  3795. /// </summary>
  3796. /// <param name="problemId">The value for the 'problemId' parameter of this action.</param>
  3797. /// <param name="callback">Callback to invoke on completion.</param>
  3798. /// <param name="asyncState">Optional state object.</param>
  3799. /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
  3800. [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/ParticipationService/GetProblemDetailsDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
  3801. [OperationContract(AsyncPattern=true, Action="http://tempuri.org/ParticipationService/GetProblemDetails", ReplyAction="http://tempuri.org/ParticipationService/GetProblemDetailsResponse")]
  3802. IAsyncResult BeginGetProblemDetails(int problemId, AsyncCallback callback, object asyncState);
  3803. /// <summary>
  3804. /// Completes the asynchronous operation begun by 'BeginGetProblemDetails'.
  3805. /// </summary>
  3806. /// <param name="result">The IAsyncResult returned from 'BeginGetProblemDetails'.</param>
  3807. /// <returns>The 'ProblemDetails' returned from the 'GetProblemDetails' operation.</returns>
  3808. ProblemDetails EndGetProblemDetails(IAsyncResult result);
  3809. /// <summary>
  3810. /// Asynchronously invokes the 'SubmitSolution' operation.
  3811. /// </summary>
  3812. /// <param name="assignmentId">The value for the 'assignmentId' parameter of this action.</param>
  3813. /// <param name="compilerName">The value for the 'compilerName' parameter of this action.</param>
  3814. /// <param name="source">The value for the 'source' parameter of this action.</param>
  3815. /// <param name="callback">Callback to invoke on completion.</param>
  3816. /// <param name="asyncState">Optional state object.</param>
  3817. /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
  3818. [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/ParticipationService/SubmitSolutionDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
  3819. [OperationContract(AsyncPattern=true, Action="http://tempuri.org/ParticipationService/SubmitSolution", ReplyAction="http://tempuri.org/ParticipationService/SubmitSolutionResponse")]
  3820. IAsyncResult BeginSubmitSolution(int assignmentId, string compilerName, byte[] source, AsyncCallback callback, object asyncState);
  3821. /// <summary>
  3822. /// Completes the asynchronous operation begun by 'BeginSubmitSolution'.
  3823. /// </summary>
  3824. /// <param name="result">The IAsyncResult returned from 'BeginSubmitSolution'.</param>
  3825. /// <returns>The 'Int32' returned from the 'SubmitSolution' operation.</returns>
  3826. int EndSubmitSolution(IAsyncResult result);
  3827. }
  3828. internal sealed class ParticipationContextEntityContainer : EntityContainer
  3829. {
  3830. public ParticipationContextEntityContainer()
  3831. {
  3832. }
  3833. }
  3834. }
  3835. }