PageRenderTime 74ms CodeModel.GetById 26ms RepoModel.GetById 0ms app.codeStats 0ms

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

https://bitbucket.org/s_vladimir/tsys
Unknown | 5031 lines | 4498 code | 533 blank | 0 comment | 0 complexity | 21741f582b7bb75c5bab9751fba75f60 MD5 | raw file
  1. //------------------------------------------------------------------------------
  2. // <auto-generated>
  3. // This code was generated by a tool.
  4. // Runtime Version:4.0.30319.237
  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.Logic
  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.Runtime.Serialization;
  2264. using System.ServiceModel.DomainServices;
  2265. using System.ServiceModel.DomainServices.Client;
  2266. using System.ServiceModel.DomainServices.Client.ApplicationServices;
  2267. /// <summary>
  2268. /// The 'CourseTopic' class.
  2269. /// </summary>
  2270. [DataContract(Namespace="http://schemas.datacontract.org/2004/07/glados.Web.Logic")]
  2271. public sealed partial class CourseTopic : ComplexObject
  2272. {
  2273. #region Extensibility Method Definitions
  2274. /// <summary>
  2275. /// This method is invoked from the constructor once initialization is complete and
  2276. /// can be used for further object setup.
  2277. /// </summary>
  2278. partial void OnCreated();
  2279. #endregion
  2280. /// <summary>
  2281. /// Initializes a new instance of the <see cref="CourseTopic"/> class.
  2282. /// </summary>
  2283. public CourseTopic()
  2284. {
  2285. this.OnCreated();
  2286. }
  2287. }
  2288. }
  2289. namespace glados.Web.Logic.Base
  2290. {
  2291. using System;
  2292. using System.Collections.Generic;
  2293. using System.ComponentModel;
  2294. using System.ComponentModel.DataAnnotations;
  2295. using System.Linq;
  2296. using System.Runtime.Serialization;
  2297. using System.ServiceModel.DomainServices;
  2298. using System.ServiceModel.DomainServices.Client;
  2299. using System.ServiceModel.DomainServices.Client.ApplicationServices;
  2300. /// <summary>
  2301. /// The 'ParticipantState' class.
  2302. /// </summary>
  2303. [DataContract(Namespace="http://schemas.datacontract.org/2004/07/glados.Web.Logic.Base")]
  2304. public sealed partial class ParticipantState : ComplexObject
  2305. {
  2306. #region Extensibility Method Definitions
  2307. /// <summary>
  2308. /// This method is invoked from the constructor once initialization is complete and
  2309. /// can be used for further object setup.
  2310. /// </summary>
  2311. partial void OnCreated();
  2312. #endregion
  2313. /// <summary>
  2314. /// Initializes a new instance of the <see cref="ParticipantState"/> class.
  2315. /// </summary>
  2316. public ParticipantState()
  2317. {
  2318. this.OnCreated();
  2319. }
  2320. }
  2321. }
  2322. namespace glados.Web.Services
  2323. {
  2324. using System;
  2325. using System.Collections.Generic;
  2326. using System.ComponentModel;
  2327. using System.ComponentModel.DataAnnotations;
  2328. using System.Linq;
  2329. using System.ServiceModel;
  2330. using System.ServiceModel.DomainServices;
  2331. using System.ServiceModel.DomainServices.Client;
  2332. using System.ServiceModel.DomainServices.Client.ApplicationServices;
  2333. using System.ServiceModel.Web;
  2334. using glados.Web;
  2335. using glados.Web.Services.Entities;
  2336. /// <summary>
  2337. /// The DomainContext corresponding to the 'StatusService' DomainService.
  2338. /// </summary>
  2339. public sealed partial class StatusContext : DomainContext
  2340. {
  2341. #region Extensibility Method Definitions
  2342. /// <summary>
  2343. /// This method is invoked from the constructor once initialization is complete and
  2344. /// can be used for further object setup.
  2345. /// </summary>
  2346. partial void OnCreated();
  2347. #endregion
  2348. /// <summary>
  2349. /// Initializes a new instance of the <see cref="StatusContext"/> class.
  2350. /// </summary>
  2351. public StatusContext() :
  2352. this(new WebDomainClient<IStatusServiceContract>(new Uri("glados-Web-Services-StatusService.svc", UriKind.Relative)))
  2353. {
  2354. }
  2355. /// <summary>
  2356. /// Initializes a new instance of the <see cref="StatusContext"/> class with the specified service URI.
  2357. /// </summary>
  2358. /// <param name="serviceUri">The StatusService service URI.</param>
  2359. public StatusContext(Uri serviceUri) :
  2360. this(new WebDomainClient<IStatusServiceContract>(serviceUri))
  2361. {
  2362. }
  2363. /// <summary>
  2364. /// Initializes a new instance of the <see cref="StatusContext"/> class with the specified <paramref name="domainClient"/>.
  2365. /// </summary>
  2366. /// <param name="domainClient">The DomainClient instance to use for this DomainContext.</param>
  2367. public StatusContext(DomainClient domainClient) :
  2368. base(domainClient)
  2369. {
  2370. this.OnCreated();
  2371. }
  2372. /// <summary>
  2373. /// Gets the set of <see cref="TestingMachineEntity"/> entity instances that have been loaded into this <see cref="StatusContext"/> instance.
  2374. /// </summary>
  2375. public EntitySet<TestingMachineEntity> TestingMachineEntities
  2376. {
  2377. get
  2378. {
  2379. return base.EntityContainer.GetEntitySet<TestingMachineEntity>();
  2380. }
  2381. }
  2382. /// <summary>
  2383. /// Gets an EntityQuery instance that can be used to load <see cref="TestingMachineEntity"/> entity instances using the 'GetTesterStatus' query.
  2384. /// </summary>
  2385. /// <returns>An EntityQuery that can be loaded to retrieve <see cref="TestingMachineEntity"/> entity instances.</returns>
  2386. public EntityQuery<TestingMachineEntity> GetTesterStatusQuery()
  2387. {
  2388. this.ValidateMethod("GetTesterStatusQuery", null);
  2389. return base.CreateQuery<TestingMachineEntity>("GetTesterStatus", null, false, true);
  2390. }
  2391. /// <summary>
  2392. /// Asynchronously invokes the 'ReloadProblemsIntoDb' method of the DomainService.
  2393. /// </summary>
  2394. /// <param name="callback">Callback to invoke when the operation completes.</param>
  2395. /// <param name="userState">Value to pass to the callback. It can be <c>null</c>.</param>
  2396. /// <returns>An operation instance that can be used to manage the asynchronous request.</returns>
  2397. public InvokeOperation ReloadProblemsIntoDb(Action<InvokeOperation> callback, object userState)
  2398. {
  2399. this.ValidateMethod("ReloadProblemsIntoDb", null);
  2400. return this.InvokeOperation("ReloadProblemsIntoDb", typeof(void), null, true, callback, userState);
  2401. }
  2402. /// <summary>
  2403. /// Asynchronously invokes the 'ReloadProblemsIntoDb' method of the DomainService.
  2404. /// </summary>
  2405. /// <returns>An operation instance that can be used to manage the asynchronous request.</returns>
  2406. public InvokeOperation ReloadProblemsIntoDb()
  2407. {
  2408. this.ValidateMethod("ReloadProblemsIntoDb", null);
  2409. return this.InvokeOperation("ReloadProblemsIntoDb", typeof(void), null, true, null, null);
  2410. }
  2411. /// <summary>
  2412. /// Asynchronously invokes the 'RetestSubmission' method of the DomainService.
  2413. /// </summary>
  2414. /// <param name="id">The value for the 'id' parameter of this action.</param>
  2415. /// <param name="callback">Callback to invoke when the operation completes.</param>
  2416. /// <param name="userState">Value to pass to the callback. It can be <c>null</c>.</param>
  2417. /// <returns>An operation instance that can be used to manage the asynchronous request.</returns>
  2418. public InvokeOperation RetestSubmission(int id, Action<InvokeOperation> callback, object userState)
  2419. {
  2420. Dictionary<string, object> parameters = new Dictionary<string, object>();
  2421. parameters.Add("id", id);
  2422. this.ValidateMethod("RetestSubmission", parameters);
  2423. return this.InvokeOperation("RetestSubmission", typeof(void), parameters, true, callback, userState);
  2424. }
  2425. /// <summary>
  2426. /// Asynchronously invokes the 'RetestSubmission' method of the DomainService.
  2427. /// </summary>
  2428. /// <param name="id">The value for the 'id' parameter of this action.</param>
  2429. /// <returns>An operation instance that can be used to manage the asynchronous request.</returns>
  2430. public InvokeOperation RetestSubmission(int id)
  2431. {
  2432. Dictionary<string, object> parameters = new Dictionary<string, object>();
  2433. parameters.Add("id", id);
  2434. this.ValidateMethod("RetestSubmission", parameters);
  2435. return this.InvokeOperation("RetestSubmission", typeof(void), parameters, true, null, null);
  2436. }
  2437. /// <summary>
  2438. /// Creates a new EntityContainer for this DomainContext's EntitySets.
  2439. /// </summary>
  2440. /// <returns>A new container instance.</returns>
  2441. protected override EntityContainer CreateEntityContainer()
  2442. {
  2443. return new StatusContextEntityContainer();
  2444. }
  2445. /// <summary>
  2446. /// Service contract for the 'StatusService' DomainService.
  2447. /// </summary>
  2448. [ServiceContract()]
  2449. public interface IStatusServiceContract
  2450. {
  2451. /// <summary>
  2452. /// Asynchronously invokes the 'GetTesterStatus' operation.
  2453. /// </summary>
  2454. /// <param name="callback">Callback to invoke on completion.</param>
  2455. /// <param name="asyncState">Optional state object.</param>
  2456. /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
  2457. [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/StatusService/GetTesterStatusDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
  2458. [OperationContract(AsyncPattern=true, Action="http://tempuri.org/StatusService/GetTesterStatus", ReplyAction="http://tempuri.org/StatusService/GetTesterStatusResponse")]
  2459. [WebGet()]
  2460. IAsyncResult BeginGetTesterStatus(AsyncCallback callback, object asyncState);
  2461. /// <summary>
  2462. /// Completes the asynchronous operation begun by 'BeginGetTesterStatus'.
  2463. /// </summary>
  2464. /// <param name="result">The IAsyncResult returned from 'BeginGetTesterStatus'.</param>
  2465. /// <returns>The 'QueryResult' returned from the 'GetTesterStatus' operation.</returns>
  2466. QueryResult<TestingMachineEntity> EndGetTesterStatus(IAsyncResult result);
  2467. /// <summary>
  2468. /// Asynchronously invokes the 'ReloadProblemsIntoDb' operation.
  2469. /// </summary>
  2470. /// <param name="callback">Callback to invoke on completion.</param>
  2471. /// <param name="asyncState">Optional state object.</param>
  2472. /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
  2473. [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/StatusService/ReloadProblemsIntoDbDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
  2474. [OperationContract(AsyncPattern=true, Action="http://tempuri.org/StatusService/ReloadProblemsIntoDb", ReplyAction="http://tempuri.org/StatusService/ReloadProblemsIntoDbResponse")]
  2475. IAsyncResult BeginReloadProblemsIntoDb(AsyncCallback callback, object asyncState);
  2476. /// <summary>
  2477. /// Completes the asynchronous operation begun by 'BeginReloadProblemsIntoDb'.
  2478. /// </summary>
  2479. /// <param name="result">The IAsyncResult returned from 'BeginReloadProblemsIntoDb'.</param>
  2480. void EndReloadProblemsIntoDb(IAsyncResult result);
  2481. /// <summary>
  2482. /// Asynchronously invokes the 'RetestSubmission' operation.
  2483. /// </summary>
  2484. /// <param name="id">The value for the 'id' parameter of this action.</param>
  2485. /// <param name="callback">Callback to invoke on completion.</param>
  2486. /// <param name="asyncState">Optional state object.</param>
  2487. /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
  2488. [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/StatusService/RetestSubmissionDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
  2489. [OperationContract(AsyncPattern=true, Action="http://tempuri.org/StatusService/RetestSubmission", ReplyAction="http://tempuri.org/StatusService/RetestSubmissionResponse")]
  2490. IAsyncResult BeginRetestSubmission(int id, AsyncCallback callback, object asyncState);
  2491. /// <summary>
  2492. /// Completes the asynchronous operation begun by 'BeginRetestSubmission'.
  2493. /// </summary>
  2494. /// <param name="result">The IAsyncResult returned from 'BeginRetestSubmission'.</param>
  2495. void EndRetestSubmission(IAsyncResult result);
  2496. }
  2497. internal sealed class StatusContextEntityContainer : EntityContainer
  2498. {
  2499. public StatusContextEntityContainer()
  2500. {
  2501. this.CreateEntitySet<TestingMachineEntity>(EntitySetOperations.None);
  2502. }
  2503. }
  2504. }
  2505. /// <summary>
  2506. /// The DomainContext corresponding to the 'TaskStructureService' DomainService.
  2507. /// </summary>
  2508. public sealed partial class TaskStructureContext : DomainContext
  2509. {
  2510. #region Extensibility Method Definitions
  2511. /// <summary>
  2512. /// This method is invoked from the constructor once initialization is complete and
  2513. /// can be used for further object setup.
  2514. /// </summary>
  2515. partial void OnCreated();
  2516. #endregion
  2517. /// <summary>
  2518. /// Initializes a new instance of the <see cref="TaskStructureContext"/> class.
  2519. /// </summary>
  2520. public TaskStructureContext() :
  2521. this(new WebDomainClient<ITaskStructureServiceContract>(new Uri("glados-Web-Services-TaskStructureService.svc", UriKind.Relative)))
  2522. {
  2523. }
  2524. /// <summary>
  2525. /// Initializes a new instance of the <see cref="TaskStructureContext"/> class with the specified service URI.
  2526. /// </summary>
  2527. /// <param name="serviceUri">The TaskStructureService service URI.</param>
  2528. public TaskStructureContext(Uri serviceUri) :
  2529. this(new WebDomainClient<ITaskStructureServiceContract>(serviceUri))
  2530. {
  2531. }
  2532. /// <summary>
  2533. /// Initializes a new instance of the <see cref="TaskStructureContext"/> class with the specified <paramref name="domainClient"/>.
  2534. /// </summary>
  2535. /// <param name="domainClient">The DomainClient instance to use for this DomainContext.</param>
  2536. public TaskStructureContext(DomainClient domainClient) :
  2537. base(domainClient)
  2538. {
  2539. this.OnCreated();
  2540. }
  2541. /// <summary>
  2542. /// Gets the set of <see cref="Assignment"/> entity instances that have been loaded into this <see cref="TaskStructureContext"/> instance.
  2543. /// </summary>
  2544. public EntitySet<Assignment> Assignments
  2545. {
  2546. get
  2547. {
  2548. return base.EntityContainer.GetEntitySet<Assignment>();
  2549. }
  2550. }
  2551. /// <summary>
  2552. /// Gets the set of <see cref="Course"/> entity instances that have been loaded into this <see cref="TaskStructureContext"/> instance.
  2553. /// </summary>
  2554. public EntitySet<Course> Courses
  2555. {
  2556. get
  2557. {
  2558. return base.EntityContainer.GetEntitySet<Course>();
  2559. }
  2560. }
  2561. /// <summary>
  2562. /// Gets the set of <see cref="Group"/> entity instances that have been loaded into this <see cref="TaskStructureContext"/> instance.
  2563. /// </summary>
  2564. public EntitySet<Group> Groups
  2565. {
  2566. get
  2567. {
  2568. return base.EntityContainer.GetEntitySet<Group>();
  2569. }
  2570. }
  2571. /// <summary>
  2572. /// Gets the set of <see cref="Membership"/> entity instances that have been loaded into this <see cref="TaskStructureContext"/> instance.
  2573. /// </summary>
  2574. public EntitySet<Membership> Memberships
  2575. {
  2576. get
  2577. {
  2578. return base.EntityContainer.GetEntitySet<Membership>();
  2579. }
  2580. }
  2581. /// <summary>
  2582. /// Gets the set of <see cref="Participation"/> entity instances that have been loaded into this <see cref="TaskStructureContext"/> instance.
  2583. /// </summary>
  2584. public EntitySet<Participation> Participations
  2585. {
  2586. get
  2587. {
  2588. return base.EntityContainer.GetEntitySet<Participation>();
  2589. }
  2590. }
  2591. /// <summary>
  2592. /// Gets the set of <see cref="ProblemGroup"/> entity instances that have been loaded into this <see cref="TaskStructureContext"/> instance.
  2593. /// </summary>
  2594. public EntitySet<ProblemGroup> ProblemGroups
  2595. {
  2596. get
  2597. {
  2598. return base.EntityContainer.GetEntitySet<ProblemGroup>();
  2599. }
  2600. }
  2601. /// <summary>
  2602. /// Gets the set of <see cref="Problem"/> entity instances that have been loaded into this <see cref="TaskStructureContext"/> instance.
  2603. /// </summary>
  2604. public EntitySet<Problem> Problems
  2605. {
  2606. get
  2607. {
  2608. return base.EntityContainer.GetEntitySet<Problem>();
  2609. }
  2610. }
  2611. /// <summary>
  2612. /// Gets the set of <see cref="Submission"/> entity instances that have been loaded into this <see cref="TaskStructureContext"/> instance.
  2613. /// </summary>
  2614. public EntitySet<Submission> Submissions
  2615. {
  2616. get
  2617. {
  2618. return base.EntityContainer.GetEntitySet<Submission>();
  2619. }
  2620. }
  2621. /// <summary>
  2622. /// Gets the set of <see cref="User"/> entity instances that have been loaded into this <see cref="TaskStructureContext"/> instance.
  2623. /// </summary>
  2624. public EntitySet<User> Users
  2625. {
  2626. get
  2627. {
  2628. return base.EntityContainer.GetEntitySet<User>();
  2629. }
  2630. }
  2631. /// <summary>
  2632. /// Gets an EntityQuery instance that can be used to load <see cref="Assignment"/> entity instances using the 'GetAssignmentSet' query.
  2633. /// </summary>
  2634. /// <returns>An EntityQuery that can be loaded to retrieve <see cref="Assignment"/> entity instances.</returns>
  2635. public EntityQuery<Assignment> GetAssignmentSetQuery()
  2636. {
  2637. this.ValidateMethod("GetAssignmentSetQuery", null);
  2638. return base.CreateQuery<Assignment>("GetAssignmentSet", null, false, true);
  2639. }
  2640. /// <summary>
  2641. /// Gets an EntityQuery instance that can be used to load <see cref="Assignment"/> entity instances using the 'GetAssignmentsForMe' query.
  2642. /// </summary>
  2643. /// <returns>An EntityQuery that can be loaded to retrieve <see cref="Assignment"/> entity instances.</returns>
  2644. public EntityQuery<Assignment> GetAssignmentsForMeQuery()
  2645. {
  2646. this.ValidateMethod("GetAssignmentsForMeQuery", null);
  2647. return base.CreateQuery<Assignment>("GetAssignmentsForMe", null, false, true);
  2648. }
  2649. /// <summary>
  2650. /// Gets an EntityQuery instance that can be used to load <see cref="Course"/> entity instances using the 'GetCourseSet' query.
  2651. /// </summary>
  2652. /// <returns>An EntityQuery that can be loaded to retrieve <see cref="Course"/> entity instances.</returns>
  2653. public EntityQuery<Course> GetCourseSetQuery()
  2654. {
  2655. this.ValidateMethod("GetCourseSetQuery", null);
  2656. return base.CreateQuery<Course>("GetCourseSet", null, false, true);
  2657. }
  2658. /// <summary>
  2659. /// Gets an EntityQuery instance that can be used to load <see cref="Group"/> entity instances using the 'GetGroupSet' query.
  2660. /// </summary>
  2661. /// <returns>An EntityQuery that can be loaded to retrieve <see cref="Group"/> entity instances.</returns>
  2662. public EntityQuery<Group> GetGroupSetQuery()
  2663. {
  2664. this.ValidateMethod("GetGroupSetQuery", null);
  2665. return base.CreateQuery<Group>("GetGroupSet", null, false, true);
  2666. }
  2667. /// <summary>
  2668. /// Gets an EntityQuery instance that can be used to load <see cref="Membership"/> entity instances using the 'GetMembershipSet' query.
  2669. /// </summary>
  2670. /// <returns>An EntityQuery that can be loaded to retrieve <see cref="Membership"/> entity instances.</returns>
  2671. public EntityQuery<Membership> GetMembershipSetQuery()
  2672. {
  2673. this.ValidateMethod("GetMembershipSetQuery", null);
  2674. return base.CreateQuery<Membership>("GetMembershipSet", null, false, true);
  2675. }
  2676. /// <summary>
  2677. /// Gets an EntityQuery instance that can be used to load <see cref="Participation"/> entity instances using the 'GetParticipationSet' query.
  2678. /// </summary>
  2679. /// <returns>An EntityQuery that can be loaded to retrieve <see cref="Participation"/> entity instances.</returns>
  2680. public EntityQuery<Participation> GetParticipationSetQuery()
  2681. {
  2682. this.ValidateMethod("GetParticipationSetQuery", null);
  2683. return base.CreateQuery<Participation>("GetParticipationSet", null, false, true);
  2684. }
  2685. /// <summary>
  2686. /// Gets an EntityQuery instance that can be used to load <see cref="ProblemGroup"/> entity instances using the 'GetProblemGroupSet' query.
  2687. /// </summary>
  2688. /// <returns>An EntityQuery that can be loaded to retrieve <see cref="ProblemGroup"/> entity instances.</returns>
  2689. public EntityQuery<ProblemGroup> GetProblemGroupSetQuery()
  2690. {
  2691. this.ValidateMethod("GetProblemGroupSetQuery", null);
  2692. return base.CreateQuery<ProblemGroup>("GetProblemGroupSet", null, false, true);
  2693. }
  2694. /// <summary>
  2695. /// Gets an EntityQuery instance that can be used to load <see cref="Problem"/> entity instances using the 'GetProblemSet' query.
  2696. /// </summary>
  2697. /// <returns>An EntityQuery that can be loaded to retrieve <see cref="Problem"/> entity instances.</returns>
  2698. public EntityQuery<Problem> GetProblemSetQuery()
  2699. {
  2700. this.ValidateMethod("GetProblemSetQuery", null);
  2701. return base.CreateQuery<Problem>("GetProblemSet", null, false, true);
  2702. }
  2703. /// <summary>
  2704. /// Gets an EntityQuery instance that can be used to load <see cref="Problem"/> entity instances using the 'GetProblemSetByGroupId' query.
  2705. /// </summary>
  2706. /// <param name="id">The value for the 'id' parameter of the query.</param>
  2707. /// <returns>An EntityQuery that can be loaded to retrieve <see cref="Problem"/> entity instances.</returns>
  2708. public EntityQuery<Problem> GetProblemSetByGroupIdQuery(int id)
  2709. {
  2710. Dictionary<string, object> parameters = new Dictionary<string, object>();
  2711. parameters.Add("id", id);
  2712. this.ValidateMethod("GetProblemSetByGroupIdQuery", parameters);
  2713. return base.CreateQuery<Problem>("GetProblemSetByGroupId", parameters, false, true);
  2714. }
  2715. /// <summary>
  2716. /// Gets an EntityQuery instance that can be used to load <see cref="Submission"/> entity instances using the 'GetSubmissionSet' query.
  2717. /// </summary>
  2718. /// <returns>An EntityQuery that can be loaded to retrieve <see cref="Submission"/> entity instances.</returns>
  2719. public EntityQuery<Submission> GetSubmissionSetQuery()
  2720. {
  2721. this.ValidateMethod("GetSubmissionSetQuery", null);
  2722. return base.CreateQuery<Submission>("GetSubmissionSet", null, false, true);
  2723. }
  2724. /// <summary>
  2725. /// Gets an EntityQuery instance that can be used to load <see cref="User"/> entity instances using the 'GetUsers' query.
  2726. /// </summary>
  2727. /// <returns>An EntityQuery that can be loaded to retrieve <see cref="User"/> entity instances.</returns>
  2728. public EntityQuery<User> GetUsersQuery()
  2729. {
  2730. this.ValidateMethod("GetUsersQuery", null);
  2731. return base.CreateQuery<User>("GetUsers", null, false, true);
  2732. }
  2733. /// <summary>
  2734. /// Creates a new EntityContainer for this DomainContext's EntitySets.
  2735. /// </summary>
  2736. /// <returns>A new container instance.</returns>
  2737. protected override EntityContainer CreateEntityContainer()
  2738. {
  2739. return new TaskStructureContextEntityContainer();
  2740. }
  2741. /// <summary>
  2742. /// Service contract for the 'TaskStructureService' DomainService.
  2743. /// </summary>
  2744. [ServiceContract()]
  2745. public interface ITaskStructureServiceContract
  2746. {
  2747. /// <summary>
  2748. /// Asynchronously invokes the 'GetAssignmentSet' operation.
  2749. /// </summary>
  2750. /// <param name="callback">Callback to invoke on completion.</param>
  2751. /// <param name="asyncState">Optional state object.</param>
  2752. /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
  2753. [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/TaskStructureService/GetAssignmentSetDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
  2754. [OperationContract(AsyncPattern=true, Action="http://tempuri.org/TaskStructureService/GetAssignmentSet", ReplyAction="http://tempuri.org/TaskStructureService/GetAssignmentSetResponse")]
  2755. [WebGet()]
  2756. IAsyncResult BeginGetAssignmentSet(AsyncCallback callback, object asyncState);
  2757. /// <summary>
  2758. /// Completes the asynchronous operation begun by 'BeginGetAssignmentSet'.
  2759. /// </summary>
  2760. /// <param name="result">The IAsyncResult returned from 'BeginGetAssignmentSet'.</param>
  2761. /// <returns>The 'QueryResult' returned from the 'GetAssignmentSet' operation.</returns>
  2762. QueryResult<Assignment> EndGetAssignmentSet(IAsyncResult result);
  2763. /// <summary>
  2764. /// Asynchronously invokes the 'GetAssignmentsForMe' operation.
  2765. /// </summary>
  2766. /// <param name="callback">Callback to invoke on completion.</param>
  2767. /// <param name="asyncState">Optional state object.</param>
  2768. /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
  2769. [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/TaskStructureService/GetAssignmentsForMeDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
  2770. [OperationContract(AsyncPattern=true, Action="http://tempuri.org/TaskStructureService/GetAssignmentsForMe", ReplyAction="http://tempuri.org/TaskStructureService/GetAssignmentsForMeResponse")]
  2771. [WebGet()]
  2772. IAsyncResult BeginGetAssignmentsForMe(AsyncCallback callback, object asyncState);
  2773. /// <summary>
  2774. /// Completes the asynchronous operation begun by 'BeginGetAssignmentsForMe'.
  2775. /// </summary>
  2776. /// <param name="result">The IAsyncResult returned from 'BeginGetAssignmentsForMe'.</param>
  2777. /// <returns>The 'QueryResult' returned from the 'GetAssignmentsForMe' operation.</returns>
  2778. QueryResult<Assignment> EndGetAssignmentsForMe(IAsyncResult result);
  2779. /// <summary>
  2780. /// Asynchronously invokes the 'GetCourseSet' operation.
  2781. /// </summary>
  2782. /// <param name="callback">Callback to invoke on completion.</param>
  2783. /// <param name="asyncState">Optional state object.</param>
  2784. /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
  2785. [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/TaskStructureService/GetCourseSetDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
  2786. [OperationContract(AsyncPattern=true, Action="http://tempuri.org/TaskStructureService/GetCourseSet", ReplyAction="http://tempuri.org/TaskStructureService/GetCourseSetResponse")]
  2787. [WebGet()]
  2788. IAsyncResult BeginGetCourseSet(AsyncCallback callback, object asyncState);
  2789. /// <summary>
  2790. /// Completes the asynchronous operation begun by 'BeginGetCourseSet'.
  2791. /// </summary>
  2792. /// <param name="result">The IAsyncResult returned from 'BeginGetCourseSet'.</param>
  2793. /// <returns>The 'QueryResult' returned from the 'GetCourseSet' operation.</returns>
  2794. QueryResult<Course> EndGetCourseSet(IAsyncResult result);
  2795. /// <summary>
  2796. /// Asynchronously invokes the 'GetGroupSet' operation.
  2797. /// </summary>
  2798. /// <param name="callback">Callback to invoke on completion.</param>
  2799. /// <param name="asyncState">Optional state object.</param>
  2800. /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
  2801. [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/TaskStructureService/GetGroupSetDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
  2802. [OperationContract(AsyncPattern=true, Action="http://tempuri.org/TaskStructureService/GetGroupSet", ReplyAction="http://tempuri.org/TaskStructureService/GetGroupSetResponse")]
  2803. [WebGet()]
  2804. IAsyncResult BeginGetGroupSet(AsyncCallback callback, object asyncState);
  2805. /// <summary>
  2806. /// Completes the asynchronous operation begun by 'BeginGetGroupSet'.
  2807. /// </summary>
  2808. /// <param name="result">The IAsyncResult returned from 'BeginGetGroupSet'.</param>
  2809. /// <returns>The 'QueryResult' returned from the 'GetGroupSet' operation.</returns>
  2810. QueryResult<Group> EndGetGroupSet(IAsyncResult result);
  2811. /// <summary>
  2812. /// Asynchronously invokes the 'GetMembershipSet' operation.
  2813. /// </summary>
  2814. /// <param name="callback">Callback to invoke on completion.</param>
  2815. /// <param name="asyncState">Optional state object.</param>
  2816. /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
  2817. [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/TaskStructureService/GetMembershipSetDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
  2818. [OperationContract(AsyncPattern=true, Action="http://tempuri.org/TaskStructureService/GetMembershipSet", ReplyAction="http://tempuri.org/TaskStructureService/GetMembershipSetResponse")]
  2819. [WebGet()]
  2820. IAsyncResult BeginGetMembershipSet(AsyncCallback callback, object asyncState);
  2821. /// <summary>
  2822. /// Completes the asynchronous operation begun by 'BeginGetMembershipSet'.
  2823. /// </summary>
  2824. /// <param name="result">The IAsyncResult returned from 'BeginGetMembershipSet'.</param>
  2825. /// <returns>The 'QueryResult' returned from the 'GetMembershipSet' operation.</returns>
  2826. QueryResult<Membership> EndGetMembershipSet(IAsyncResult result);
  2827. /// <summary>
  2828. /// Asynchronously invokes the 'GetParticipationSet' operation.
  2829. /// </summary>
  2830. /// <param name="callback">Callback to invoke on completion.</param>
  2831. /// <param name="asyncState">Optional state object.</param>
  2832. /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
  2833. [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/TaskStructureService/GetParticipationSetDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
  2834. [OperationContract(AsyncPattern=true, Action="http://tempuri.org/TaskStructureService/GetParticipationSet", ReplyAction="http://tempuri.org/TaskStructureService/GetParticipationSetResponse")]
  2835. [WebGet()]
  2836. IAsyncResult BeginGetParticipationSet(AsyncCallback callback, object asyncState);
  2837. /// <summary>
  2838. /// Completes the asynchronous operation begun by 'BeginGetParticipationSet'.
  2839. /// </summary>
  2840. /// <param name="result">The IAsyncResult returned from 'BeginGetParticipationSet'.</param>
  2841. /// <returns>The 'QueryResult' returned from the 'GetParticipationSet' operation.</returns>
  2842. QueryResult<Participation> EndGetParticipationSet(IAsyncResult result);
  2843. /// <summary>
  2844. /// Asynchronously invokes the 'GetProblemGroupSet' operation.
  2845. /// </summary>
  2846. /// <param name="callback">Callback to invoke on completion.</param>
  2847. /// <param name="asyncState">Optional state object.</param>
  2848. /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
  2849. [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/TaskStructureService/GetProblemGroupSetDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
  2850. [OperationContract(AsyncPattern=true, Action="http://tempuri.org/TaskStructureService/GetProblemGroupSet", ReplyAction="http://tempuri.org/TaskStructureService/GetProblemGroupSetResponse")]
  2851. [WebGet()]
  2852. IAsyncResult BeginGetProblemGroupSet(AsyncCallback callback, object asyncState);
  2853. /// <summary>
  2854. /// Completes the asynchronous operation begun by 'BeginGetProblemGroupSet'.
  2855. /// </summary>
  2856. /// <param name="result">The IAsyncResult returned from 'BeginGetProblemGroupSet'.</param>
  2857. /// <returns>The 'QueryResult' returned from the 'GetProblemGroupSet' operation.</returns>
  2858. QueryResult<ProblemGroup> EndGetProblemGroupSet(IAsyncResult result);
  2859. /// <summary>
  2860. /// Asynchronously invokes the 'GetProblemSet' operation.
  2861. /// </summary>
  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/GetProblemSetDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
  2866. [OperationContract(AsyncPattern=true, Action="http://tempuri.org/TaskStructureService/GetProblemSet", ReplyAction="http://tempuri.org/TaskStructureService/GetProblemSetResponse")]
  2867. [WebGet()]
  2868. IAsyncResult BeginGetProblemSet(AsyncCallback callback, object asyncState);
  2869. /// <summary>
  2870. /// Completes the asynchronous operation begun by 'BeginGetProblemSet'.
  2871. /// </summary>
  2872. /// <param name="result">The IAsyncResult returned from 'BeginGetProblemSet'.</param>
  2873. /// <returns>The 'QueryResult' returned from the 'GetProblemSet' operation.</returns>
  2874. QueryResult<Problem> EndGetProblemSet(IAsyncResult result);
  2875. /// <summary>
  2876. /// Asynchronously invokes the 'GetProblemSetByGroupId' operation.
  2877. /// </summary>
  2878. /// <param name="id">The value for the 'id' parameter of this action.</param>
  2879. /// <param name="callback">Callback to invoke on completion.</param>
  2880. /// <param name="asyncState">Optional state object.</param>
  2881. /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
  2882. [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/TaskStructureService/GetProblemSetByGroupIdDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
  2883. [OperationContract(AsyncPattern=true, Action="http://tempuri.org/TaskStructureService/GetProblemSetByGroupId", ReplyAction="http://tempuri.org/TaskStructureService/GetProblemSetByGroupIdResponse")]
  2884. [WebGet()]
  2885. IAsyncResult BeginGetProblemSetByGroupId(int id, AsyncCallback callback, object asyncState);
  2886. /// <summary>
  2887. /// Completes the asynchronous operation begun by 'BeginGetProblemSetByGroupId'.
  2888. /// </summary>
  2889. /// <param name="result">The IAsyncResult returned from 'BeginGetProblemSetByGroupId'.</param>
  2890. /// <returns>The 'QueryResult' returned from the 'GetProblemSetByGroupId' operation.</returns>
  2891. QueryResult<Problem> EndGetProblemSetByGroupId(IAsyncResult result);
  2892. /// <summary>
  2893. /// Asynchronously invokes the 'GetSubmissionSet' operation.
  2894. /// </summary>
  2895. /// <param name="callback">Callback to invoke on completion.</param>
  2896. /// <param name="asyncState">Optional state object.</param>
  2897. /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
  2898. [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/TaskStructureService/GetSubmissionSetDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
  2899. [OperationContract(AsyncPattern=true, Action="http://tempuri.org/TaskStructureService/GetSubmissionSet", ReplyAction="http://tempuri.org/TaskStructureService/GetSubmissionSetResponse")]
  2900. [WebGet()]
  2901. IAsyncResult BeginGetSubmissionSet(AsyncCallback callback, object asyncState);
  2902. /// <summary>
  2903. /// Completes the asynchronous operation begun by 'BeginGetSubmissionSet'.
  2904. /// </summary>
  2905. /// <param name="result">The IAsyncResult returned from 'BeginGetSubmissionSet'.</param>
  2906. /// <returns>The 'QueryResult' returned from the 'GetSubmissionSet' operation.</returns>
  2907. QueryResult<Submission> EndGetSubmissionSet(IAsyncResult result);
  2908. /// <summary>
  2909. /// Asynchronously invokes the 'GetUsers' operation.
  2910. /// </summary>
  2911. /// <param name="callback">Callback to invoke on completion.</param>
  2912. /// <param name="asyncState">Optional state object.</param>
  2913. /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
  2914. [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/TaskStructureService/GetUsersDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
  2915. [OperationContract(AsyncPattern=true, Action="http://tempuri.org/TaskStructureService/GetUsers", ReplyAction="http://tempuri.org/TaskStructureService/GetUsersResponse")]
  2916. [WebGet()]
  2917. IAsyncResult BeginGetUsers(AsyncCallback callback, object asyncState);
  2918. /// <summary>
  2919. /// Completes the asynchronous operation begun by 'BeginGetUsers'.
  2920. /// </summary>
  2921. /// <param name="result">The IAsyncResult returned from 'BeginGetUsers'.</param>
  2922. /// <returns>The 'QueryResult' returned from the 'GetUsers' operation.</returns>
  2923. QueryResult<User> EndGetUsers(IAsyncResult result);
  2924. /// <summary>
  2925. /// Asynchronously invokes the 'SubmitChanges' operation.
  2926. /// </summary>
  2927. /// <param name="changeSet">The change-set to submit.</param>
  2928. /// <param name="callback">Callback to invoke on completion.</param>
  2929. /// <param name="asyncState">Optional state object.</param>
  2930. /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
  2931. [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/TaskStructureService/SubmitChangesDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
  2932. [OperationContract(AsyncPattern=true, Action="http://tempuri.org/TaskStructureService/SubmitChanges", ReplyAction="http://tempuri.org/TaskStructureService/SubmitChangesResponse")]
  2933. IAsyncResult BeginSubmitChanges(IEnumerable<ChangeSetEntry> changeSet, AsyncCallback callback, object asyncState);
  2934. /// <summary>
  2935. /// Completes the asynchronous operation begun by 'BeginSubmitChanges'.
  2936. /// </summary>
  2937. /// <param name="result">The IAsyncResult returned from 'BeginSubmitChanges'.</param>
  2938. /// <returns>The collection of change-set entry elements returned from 'SubmitChanges'.</returns>
  2939. IEnumerable<ChangeSetEntry> EndSubmitChanges(IAsyncResult result);
  2940. }
  2941. internal sealed class TaskStructureContextEntityContainer : EntityContainer
  2942. {
  2943. public TaskStructureContextEntityContainer()
  2944. {
  2945. this.CreateEntitySet<Assignment>(EntitySetOperations.All);
  2946. this.CreateEntitySet<Course>(EntitySetOperations.All);
  2947. this.CreateEntitySet<Group>(EntitySetOperations.All);
  2948. this.CreateEntitySet<Membership>(EntitySetOperations.All);
  2949. this.CreateEntitySet<Participation>(EntitySetOperations.All);
  2950. this.CreateEntitySet<Problem>(EntitySetOperations.All);
  2951. this.CreateEntitySet<ProblemGroup>(EntitySetOperations.All);
  2952. this.CreateEntitySet<Submission>(EntitySetOperations.All);
  2953. this.CreateEntitySet<User>(EntitySetOperations.All);
  2954. }
  2955. }
  2956. }
  2957. }
  2958. namespace glados.Web.Services.Entities
  2959. {
  2960. using System;
  2961. using System.Collections.Generic;
  2962. using System.ComponentModel;
  2963. using System.ComponentModel.DataAnnotations;
  2964. using System.Linq;
  2965. using System.Runtime.Serialization;
  2966. using System.ServiceModel.DomainServices;
  2967. using System.ServiceModel.DomainServices.Client;
  2968. using System.ServiceModel.DomainServices.Client.ApplicationServices;
  2969. using System.Xml.Serialization;
  2970. using Glados.TestingModule.Interfaces;
  2971. using glados.Web.Logic;
  2972. /// <summary>
  2973. /// The 'AssignmentState' class.
  2974. /// </summary>
  2975. [DataContract(Namespace="http://schemas.datacontract.org/2004/07/glados.Web.Services.Entities")]
  2976. public sealed partial class AssignmentState : ComplexObject
  2977. {
  2978. private string _state;
  2979. private string _task;
  2980. private string _topic;
  2981. #region Extensibility Method Definitions
  2982. /// <summary>
  2983. /// This method is invoked from the constructor once initialization is complete and
  2984. /// can be used for further object setup.
  2985. /// </summary>
  2986. partial void OnCreated();
  2987. partial void OnStateChanging(string value);
  2988. partial void OnStateChanged();
  2989. partial void OnTaskChanging(string value);
  2990. partial void OnTaskChanged();
  2991. partial void OnTopicChanging(string value);
  2992. partial void OnTopicChanged();
  2993. #endregion
  2994. /// <summary>
  2995. /// Initializes a new instance of the <see cref="AssignmentState"/> class.
  2996. /// </summary>
  2997. public AssignmentState()
  2998. {
  2999. this.OnCreated();
  3000. }
  3001. /// <summary>
  3002. /// Gets or sets the 'State' value.
  3003. /// </summary>
  3004. [DataMember()]
  3005. public string State
  3006. {
  3007. get
  3008. {
  3009. return this._state;
  3010. }
  3011. set
  3012. {
  3013. if ((this._state != value))
  3014. {
  3015. this.OnStateChanging(value);
  3016. this.RaiseDataMemberChanging("State");
  3017. this.ValidateProperty("State", value);
  3018. this._state = value;
  3019. this.RaiseDataMemberChanged("State");
  3020. this.OnStateChanged();
  3021. }
  3022. }
  3023. }
  3024. /// <summary>
  3025. /// Gets or sets the 'Task' value.
  3026. /// </summary>
  3027. [DataMember()]
  3028. public string Task
  3029. {
  3030. get
  3031. {
  3032. return this._task;
  3033. }
  3034. set
  3035. {
  3036. if ((this._task != value))
  3037. {
  3038. this.OnTaskChanging(value);
  3039. this.RaiseDataMemberChanging("Task");
  3040. this.ValidateProperty("Task", value);
  3041. this._task = value;
  3042. this.RaiseDataMemberChanged("Task");
  3043. this.OnTaskChanged();
  3044. }
  3045. }
  3046. }
  3047. /// <summary>
  3048. /// Gets or sets the 'Topic' value.
  3049. /// </summary>
  3050. [DataMember()]
  3051. public string Topic
  3052. {
  3053. get
  3054. {
  3055. return this._topic;
  3056. }
  3057. set
  3058. {
  3059. if ((this._topic != value))
  3060. {
  3061. this.OnTopicChanging(value);
  3062. this.RaiseDataMemberChanging("Topic");
  3063. this.ValidateProperty("Topic", value);
  3064. this._topic = value;
  3065. this.RaiseDataMemberChanged("Topic");
  3066. this.OnTopicChanged();
  3067. }
  3068. }
  3069. }
  3070. }
  3071. /// <summary>
  3072. /// The 'CourseDashboardInfo' class.
  3073. /// </summary>
  3074. [DataContract(Namespace="http://schemas.datacontract.org/2004/07/glados.Web.Services.Entities")]
  3075. public sealed partial class CourseDashboardInfo : ComplexObject
  3076. {
  3077. private CourseParticipantClientState[] _participants;
  3078. private CourseTopic[] _topics;
  3079. #region Extensibility Method Definitions
  3080. /// <summary>
  3081. /// This method is invoked from the constructor once initialization is complete and
  3082. /// can be used for further object setup.
  3083. /// </summary>
  3084. partial void OnCreated();
  3085. partial void OnParticipantsChanging(CourseParticipantClientState[] value);
  3086. partial void OnParticipantsChanged();
  3087. partial void OnTopicsChanging(CourseTopic[] value);
  3088. partial void OnTopicsChanged();
  3089. #endregion
  3090. /// <summary>
  3091. /// Initializes a new instance of the <see cref="CourseDashboardInfo"/> class.
  3092. /// </summary>
  3093. public CourseDashboardInfo()
  3094. {
  3095. this.OnCreated();
  3096. }
  3097. /// <summary>
  3098. /// Gets or sets the 'Participants' value.
  3099. /// </summary>
  3100. [DataMember()]
  3101. [Display(AutoGenerateField=false)]
  3102. public CourseParticipantClientState[] Participants
  3103. {
  3104. get
  3105. {
  3106. return this._participants;
  3107. }
  3108. set
  3109. {
  3110. if ((this._participants != value))
  3111. {
  3112. this.OnParticipantsChanging(value);
  3113. this.RaiseDataMemberChanging("Participants");
  3114. this.ValidateProperty("Participants", value);
  3115. this._participants = value;
  3116. this.RaiseDataMemberChanged("Participants");
  3117. this.OnParticipantsChanged();
  3118. }
  3119. }
  3120. }
  3121. /// <summary>
  3122. /// Gets or sets the 'Topics' value.
  3123. /// </summary>
  3124. [DataMember()]
  3125. [Display(AutoGenerateField=false)]
  3126. public CourseTopic[] Topics
  3127. {
  3128. get
  3129. {
  3130. return this._topics;
  3131. }
  3132. set
  3133. {
  3134. if ((this._topics != value))
  3135. {
  3136. this.OnTopicsChanging(value);
  3137. this.RaiseDataMemberChanging("Topics");
  3138. this.ValidateProperty("Topics", value);
  3139. this._topics = value;
  3140. this.RaiseDataMemberChanged("Topics");
  3141. this.OnTopicsChanged();
  3142. }
  3143. }
  3144. }
  3145. }
  3146. /// <summary>
  3147. /// The 'CourseParticipantClientState' class.
  3148. /// </summary>
  3149. [DataContract(Namespace="http://schemas.datacontract.org/2004/07/glados.Web.Services.Entities")]
  3150. public sealed partial class CourseParticipantClientState : ComplexObject
  3151. {
  3152. private AssignmentState[] _assignments;
  3153. private int _id;
  3154. private string _name;
  3155. #region Extensibility Method Definitions
  3156. /// <summary>
  3157. /// This method is invoked from the constructor once initialization is complete and
  3158. /// can be used for further object setup.
  3159. /// </summary>
  3160. partial void OnCreated();
  3161. partial void OnAssignmentsChanging(AssignmentState[] value);
  3162. partial void OnAssignmentsChanged();
  3163. partial void OnIdChanging(int value);
  3164. partial void OnIdChanged();
  3165. partial void OnNameChanging(string value);
  3166. partial void OnNameChanged();
  3167. #endregion
  3168. /// <summary>
  3169. /// Initializes a new instance of the <see cref="CourseParticipantClientState"/> class.
  3170. /// </summary>
  3171. public CourseParticipantClientState()
  3172. {
  3173. this.OnCreated();
  3174. }
  3175. /// <summary>
  3176. /// Gets or sets the 'Assignments' value.
  3177. /// </summary>
  3178. [DataMember()]
  3179. [Display(AutoGenerateField=false)]
  3180. public AssignmentState[] Assignments
  3181. {
  3182. get
  3183. {
  3184. return this._assignments;
  3185. }
  3186. set
  3187. {
  3188. if ((this._assignments != value))
  3189. {
  3190. this.OnAssignmentsChanging(value);
  3191. this.RaiseDataMemberChanging("Assignments");
  3192. this.ValidateProperty("Assignments", value);
  3193. this._assignments = value;
  3194. this.RaiseDataMemberChanged("Assignments");
  3195. this.OnAssignmentsChanged();
  3196. }
  3197. }
  3198. }
  3199. /// <summary>
  3200. /// Gets or sets the 'Id' value.
  3201. /// </summary>
  3202. [DataMember()]
  3203. public int Id
  3204. {
  3205. get
  3206. {
  3207. return this._id;
  3208. }
  3209. set
  3210. {
  3211. if ((this._id != value))
  3212. {
  3213. this.OnIdChanging(value);
  3214. this.RaiseDataMemberChanging("Id");
  3215. this.ValidateProperty("Id", value);
  3216. this._id = value;
  3217. this.RaiseDataMemberChanged("Id");
  3218. this.OnIdChanged();
  3219. }
  3220. }
  3221. }
  3222. /// <summary>
  3223. /// Gets or sets the 'Name' value.
  3224. /// </summary>
  3225. [DataMember()]
  3226. public string Name
  3227. {
  3228. get
  3229. {
  3230. return this._name;
  3231. }
  3232. set
  3233. {
  3234. if ((this._name != value))
  3235. {
  3236. this.OnNameChanging(value);
  3237. this.RaiseDataMemberChanging("Name");
  3238. this.ValidateProperty("Name", value);
  3239. this._name = value;
  3240. this.RaiseDataMemberChanged("Name");
  3241. this.OnNameChanged();
  3242. }
  3243. }
  3244. }
  3245. }
  3246. /// <summary>
  3247. /// The 'ParticipantAssignment' class.
  3248. /// </summary>
  3249. [DataContract(Namespace="http://schemas.datacontract.org/2004/07/glados.Web.Services.Entities")]
  3250. public sealed partial class ParticipantAssignment : ComplexObject
  3251. {
  3252. private bool _assigned;
  3253. private int _participantId;
  3254. private string _participantName;
  3255. #region Extensibility Method Definitions
  3256. /// <summary>
  3257. /// This method is invoked from the constructor once initialization is complete and
  3258. /// can be used for further object setup.
  3259. /// </summary>
  3260. partial void OnCreated();
  3261. partial void OnAssignedChanging(bool value);
  3262. partial void OnAssignedChanged();
  3263. partial void OnParticipantIdChanging(int value);
  3264. partial void OnParticipantIdChanged();
  3265. partial void OnParticipantNameChanging(string value);
  3266. partial void OnParticipantNameChanged();
  3267. #endregion
  3268. /// <summary>
  3269. /// Initializes a new instance of the <see cref="ParticipantAssignment"/> class.
  3270. /// </summary>
  3271. public ParticipantAssignment()
  3272. {
  3273. this.OnCreated();
  3274. }
  3275. /// <summary>
  3276. /// Gets or sets the 'Assigned' value.
  3277. /// </summary>
  3278. [DataMember()]
  3279. public bool Assigned
  3280. {
  3281. get
  3282. {
  3283. return this._assigned;
  3284. }
  3285. set
  3286. {
  3287. if ((this._assigned != value))
  3288. {
  3289. this.OnAssignedChanging(value);
  3290. this.RaiseDataMemberChanging("Assigned");
  3291. this.ValidateProperty("Assigned", value);
  3292. this._assigned = value;
  3293. this.RaiseDataMemberChanged("Assigned");
  3294. this.OnAssignedChanged();
  3295. }
  3296. }
  3297. }
  3298. /// <summary>
  3299. /// Gets or sets the 'ParticipantId' value.
  3300. /// </summary>
  3301. [DataMember()]
  3302. public int ParticipantId
  3303. {
  3304. get
  3305. {
  3306. return this._participantId;
  3307. }
  3308. set
  3309. {
  3310. if ((this._participantId != value))
  3311. {
  3312. this.OnParticipantIdChanging(value);
  3313. this.RaiseDataMemberChanging("ParticipantId");
  3314. this.ValidateProperty("ParticipantId", value);
  3315. this._participantId = value;
  3316. this.RaiseDataMemberChanged("ParticipantId");
  3317. this.OnParticipantIdChanged();
  3318. }
  3319. }
  3320. }
  3321. /// <summary>
  3322. /// Gets or sets the 'ParticipantName' value.
  3323. /// </summary>
  3324. [DataMember()]
  3325. public string ParticipantName
  3326. {
  3327. get
  3328. {
  3329. return this._participantName;
  3330. }
  3331. set
  3332. {
  3333. if ((this._participantName != value))
  3334. {
  3335. this.OnParticipantNameChanging(value);
  3336. this.RaiseDataMemberChanging("ParticipantName");
  3337. this.ValidateProperty("ParticipantName", value);
  3338. this._participantName = value;
  3339. this.RaiseDataMemberChanged("ParticipantName");
  3340. this.OnParticipantNameChanged();
  3341. }
  3342. }
  3343. }
  3344. }
  3345. /// <summary>
  3346. /// The 'ProblemDetails' class.
  3347. /// </summary>
  3348. [DataContract(Namespace="http://schemas.datacontract.org/2004/07/glados.Web.Services.Entities")]
  3349. [XmlRoot(ElementName="task")]
  3350. public sealed partial class ProblemDetails : ComplexObject
  3351. {
  3352. private string[] _compilers;
  3353. private int _id;
  3354. private string _name;
  3355. private string _statementPath;
  3356. private TestingInformation _testingInformation;
  3357. #region Extensibility Method Definitions
  3358. /// <summary>
  3359. /// This method is invoked from the constructor once initialization is complete and
  3360. /// can be used for further object setup.
  3361. /// </summary>
  3362. partial void OnCreated();
  3363. partial void OnCompilersChanging(string[] value);
  3364. partial void OnCompilersChanged();
  3365. partial void OnIdChanging(int value);
  3366. partial void OnIdChanged();
  3367. partial void OnNameChanging(string value);
  3368. partial void OnNameChanged();
  3369. partial void OnStatementPathChanging(string value);
  3370. partial void OnStatementPathChanged();
  3371. partial void OnTestingInformationChanging(TestingInformation value);
  3372. partial void OnTestingInformationChanged();
  3373. #endregion
  3374. /// <summary>
  3375. /// Initializes a new instance of the <see cref="ProblemDetails"/> class.
  3376. /// </summary>
  3377. public ProblemDetails()
  3378. {
  3379. this.OnCreated();
  3380. }
  3381. /// <summary>
  3382. /// Gets or sets the 'Compilers' value.
  3383. /// </summary>
  3384. [DataMember()]
  3385. [XmlIgnore()]
  3386. public string[] Compilers
  3387. {
  3388. get
  3389. {
  3390. return this._compilers;
  3391. }
  3392. set
  3393. {
  3394. if ((this._compilers != value))
  3395. {
  3396. this.OnCompilersChanging(value);
  3397. this.RaiseDataMemberChanging("Compilers");
  3398. this.ValidateProperty("Compilers", value);
  3399. this._compilers = value;
  3400. this.RaiseDataMemberChanged("Compilers");
  3401. this.OnCompilersChanged();
  3402. }
  3403. }
  3404. }
  3405. /// <summary>
  3406. /// Gets or sets the 'Id' value.
  3407. /// </summary>
  3408. [DataMember()]
  3409. [XmlIgnore()]
  3410. public int Id
  3411. {
  3412. get
  3413. {
  3414. return this._id;
  3415. }
  3416. set
  3417. {
  3418. if ((this._id != value))
  3419. {
  3420. this.OnIdChanging(value);
  3421. this.RaiseDataMemberChanging("Id");
  3422. this.ValidateProperty("Id", value);
  3423. this._id = value;
  3424. this.RaiseDataMemberChanged("Id");
  3425. this.OnIdChanged();
  3426. }
  3427. }
  3428. }
  3429. /// <summary>
  3430. /// Gets or sets the 'Name' value.
  3431. /// </summary>
  3432. [DataMember()]
  3433. [XmlElement(ElementName="name")]
  3434. public string Name
  3435. {
  3436. get
  3437. {
  3438. return this._name;
  3439. }
  3440. set
  3441. {
  3442. if ((this._name != value))
  3443. {
  3444. this.OnNameChanging(value);
  3445. this.RaiseDataMemberChanging("Name");
  3446. this.ValidateProperty("Name", value);
  3447. this._name = value;
  3448. this.RaiseDataMemberChanged("Name");
  3449. this.OnNameChanged();
  3450. }
  3451. }
  3452. }
  3453. /// <summary>
  3454. /// Gets or sets the 'StatementPath' value.
  3455. /// </summary>
  3456. [DataMember()]
  3457. [XmlIgnore()]
  3458. public string StatementPath
  3459. {
  3460. get
  3461. {
  3462. return this._statementPath;
  3463. }
  3464. set
  3465. {
  3466. if ((this._statementPath != value))
  3467. {
  3468. this.OnStatementPathChanging(value);
  3469. this.RaiseDataMemberChanging("StatementPath");
  3470. this.ValidateProperty("StatementPath", value);
  3471. this._statementPath = value;
  3472. this.RaiseDataMemberChanged("StatementPath");
  3473. this.OnStatementPathChanged();
  3474. }
  3475. }
  3476. }
  3477. /// <summary>
  3478. /// Gets or sets the 'TestingInformation' value.
  3479. /// </summary>
  3480. [DataMember()]
  3481. [Display(AutoGenerateField=false)]
  3482. [XmlElement(ElementName="testingInfo")]
  3483. public TestingInformation TestingInformation
  3484. {
  3485. get
  3486. {
  3487. return this._testingInformation;
  3488. }
  3489. set
  3490. {
  3491. if ((this._testingInformation != value))
  3492. {
  3493. this.OnTestingInformationChanging(value);
  3494. this.RaiseDataMemberChanging("TestingInformation");
  3495. this.ValidateProperty("TestingInformation", value);
  3496. this._testingInformation = value;
  3497. this.RaiseDataMemberChanged("TestingInformation");
  3498. this.OnTestingInformationChanged();
  3499. }
  3500. }
  3501. }
  3502. }
  3503. /// <summary>
  3504. /// The 'TaskIOFile' class.
  3505. /// </summary>
  3506. [DataContract(Namespace="http://schemas.datacontract.org/2004/07/glados.Web.Services.Entities")]
  3507. public sealed partial class TaskIOFile : ComplexObject
  3508. {
  3509. private string _name;
  3510. private string _type;
  3511. #region Extensibility Method Definitions
  3512. /// <summary>
  3513. /// This method is invoked from the constructor once initialization is complete and
  3514. /// can be used for further object setup.
  3515. /// </summary>
  3516. partial void OnCreated();
  3517. partial void OnNameChanging(string value);
  3518. partial void OnNameChanged();
  3519. partial void OnTypeChanging(string value);
  3520. partial void OnTypeChanged();
  3521. #endregion
  3522. /// <summary>
  3523. /// Initializes a new instance of the <see cref="TaskIOFile"/> class.
  3524. /// </summary>
  3525. public TaskIOFile()
  3526. {
  3527. this.OnCreated();
  3528. }
  3529. /// <summary>
  3530. /// Gets or sets the 'Name' value.
  3531. /// </summary>
  3532. [DataMember()]
  3533. [XmlText()]
  3534. public string Name
  3535. {
  3536. get
  3537. {
  3538. return this._name;
  3539. }
  3540. set
  3541. {
  3542. if ((this._name != value))
  3543. {
  3544. this.OnNameChanging(value);
  3545. this.RaiseDataMemberChanging("Name");
  3546. this.ValidateProperty("Name", value);
  3547. this._name = value;
  3548. this.RaiseDataMemberChanged("Name");
  3549. this.OnNameChanged();
  3550. }
  3551. }
  3552. }
  3553. /// <summary>
  3554. /// Gets or sets the 'Type' value.
  3555. /// </summary>
  3556. [DataMember()]
  3557. [XmlAttribute(AttributeName="type")]
  3558. public string Type
  3559. {
  3560. get
  3561. {
  3562. return this._type;
  3563. }
  3564. set
  3565. {
  3566. if ((this._type != value))
  3567. {
  3568. this.OnTypeChanging(value);
  3569. this.RaiseDataMemberChanging("Type");
  3570. this.ValidateProperty("Type", value);
  3571. this._type = value;
  3572. this.RaiseDataMemberChanged("Type");
  3573. this.OnTypeChanged();
  3574. }
  3575. }
  3576. }
  3577. }
  3578. /// <summary>
  3579. /// The 'TestDescriptor' class.
  3580. /// </summary>
  3581. [DataContract(Namespace="http://schemas.datacontract.org/2004/07/glados.Web.Services.Entities")]
  3582. public sealed partial class TestDescriptor : ComplexObject
  3583. {
  3584. private int _id;
  3585. private int _memoryLimitMb;
  3586. private float _timeLimitSec;
  3587. #region Extensibility Method Definitions
  3588. /// <summary>
  3589. /// This method is invoked from the constructor once initialization is complete and
  3590. /// can be used for further object setup.
  3591. /// </summary>
  3592. partial void OnCreated();
  3593. partial void OnIdChanging(int value);
  3594. partial void OnIdChanged();
  3595. partial void OnMemoryLimitMbChanging(int value);
  3596. partial void OnMemoryLimitMbChanged();
  3597. partial void OnTimeLimitSecChanging(float value);
  3598. partial void OnTimeLimitSecChanged();
  3599. #endregion
  3600. /// <summary>
  3601. /// Initializes a new instance of the <see cref="TestDescriptor"/> class.
  3602. /// </summary>
  3603. public TestDescriptor()
  3604. {
  3605. this.OnCreated();
  3606. }
  3607. /// <summary>
  3608. /// Gets or sets the 'Id' value.
  3609. /// </summary>
  3610. [DataMember()]
  3611. [XmlAttribute(AttributeName="id")]
  3612. public int Id
  3613. {
  3614. get
  3615. {
  3616. return this._id;
  3617. }
  3618. set
  3619. {
  3620. if ((this._id != value))
  3621. {
  3622. this.OnIdChanging(value);
  3623. this.RaiseDataMemberChanging("Id");
  3624. this.ValidateProperty("Id", value);
  3625. this._id = value;
  3626. this.RaiseDataMemberChanged("Id");
  3627. this.OnIdChanged();
  3628. }
  3629. }
  3630. }
  3631. /// <summary>
  3632. /// Gets or sets the 'MemoryLimitMb' value.
  3633. /// </summary>
  3634. [DataMember()]
  3635. [XmlAttribute(AttributeName="memoryLimit")]
  3636. public int MemoryLimitMb
  3637. {
  3638. get
  3639. {
  3640. return this._memoryLimitMb;
  3641. }
  3642. set
  3643. {
  3644. if ((this._memoryLimitMb != value))
  3645. {
  3646. this.OnMemoryLimitMbChanging(value);
  3647. this.RaiseDataMemberChanging("MemoryLimitMb");
  3648. this.ValidateProperty("MemoryLimitMb", value);
  3649. this._memoryLimitMb = value;
  3650. this.RaiseDataMemberChanged("MemoryLimitMb");
  3651. this.OnMemoryLimitMbChanged();
  3652. }
  3653. }
  3654. }
  3655. /// <summary>
  3656. /// Gets or sets the 'TimeLimitSec' value.
  3657. /// </summary>
  3658. [DataMember()]
  3659. [XmlAttribute(AttributeName="timeLimit")]
  3660. public float TimeLimitSec
  3661. {
  3662. get
  3663. {
  3664. return this._timeLimitSec;
  3665. }
  3666. set
  3667. {
  3668. if ((this._timeLimitSec != value))
  3669. {
  3670. this.OnTimeLimitSecChanging(value);
  3671. this.RaiseDataMemberChanging("TimeLimitSec");
  3672. this.ValidateProperty("TimeLimitSec", value);
  3673. this._timeLimitSec = value;
  3674. this.RaiseDataMemberChanged("TimeLimitSec");
  3675. this.OnTimeLimitSecChanged();
  3676. }
  3677. }
  3678. }
  3679. }
  3680. /// <summary>
  3681. /// The 'TestingInformation' class.
  3682. /// </summary>
  3683. [DataContract(Namespace="http://schemas.datacontract.org/2004/07/glados.Web.Services.Entities")]
  3684. public sealed partial class TestingInformation : ComplexObject
  3685. {
  3686. private TaskIOFile[] _ioFiles;
  3687. private TestDescriptor[] _tests;
  3688. #region Extensibility Method Definitions
  3689. /// <summary>
  3690. /// This method is invoked from the constructor once initialization is complete and
  3691. /// can be used for further object setup.
  3692. /// </summary>
  3693. partial void OnCreated();
  3694. partial void OnIOFilesChanging(TaskIOFile[] value);
  3695. partial void OnIOFilesChanged();
  3696. partial void OnTestsChanging(TestDescriptor[] value);
  3697. partial void OnTestsChanged();
  3698. #endregion
  3699. /// <summary>
  3700. /// Initializes a new instance of the <see cref="TestingInformation"/> class.
  3701. /// </summary>
  3702. public TestingInformation()
  3703. {
  3704. this.OnCreated();
  3705. }
  3706. /// <summary>
  3707. /// Gets or sets the 'IOFiles' value.
  3708. /// </summary>
  3709. [DataMember()]
  3710. [Display(AutoGenerateField=false)]
  3711. [XmlArray(ElementName="files")]
  3712. [XmlArrayItem(ElementName="file")]
  3713. public TaskIOFile[] IOFiles
  3714. {
  3715. get
  3716. {
  3717. return this._ioFiles;
  3718. }
  3719. set
  3720. {
  3721. if ((this._ioFiles != value))
  3722. {
  3723. this.OnIOFilesChanging(value);
  3724. this.RaiseDataMemberChanging("IOFiles");
  3725. this.ValidateProperty("IOFiles", value);
  3726. this._ioFiles = value;
  3727. this.RaiseDataMemberChanged("IOFiles");
  3728. this.OnIOFilesChanged();
  3729. }
  3730. }
  3731. }
  3732. /// <summary>
  3733. /// Gets or sets the 'Tests' value.
  3734. /// </summary>
  3735. [DataMember()]
  3736. [Display(AutoGenerateField=false)]
  3737. [XmlArray(ElementName="tests")]
  3738. [XmlArrayItem(ElementName="test")]
  3739. public TestDescriptor[] Tests
  3740. {
  3741. get
  3742. {
  3743. return this._tests;
  3744. }
  3745. set
  3746. {
  3747. if ((this._tests != value))
  3748. {
  3749. this.OnTestsChanging(value);
  3750. this.RaiseDataMemberChanging("Tests");
  3751. this.ValidateProperty("Tests", value);
  3752. this._tests = value;
  3753. this.RaiseDataMemberChanged("Tests");
  3754. this.OnTestsChanged();
  3755. }
  3756. }
  3757. }
  3758. }
  3759. /// <summary>
  3760. /// The 'TestingMachineEntity' entity class.
  3761. /// </summary>
  3762. [DataContract(Namespace="http://schemas.datacontract.org/2004/07/glados.Web.Services.Entities")]
  3763. public sealed partial class TestingMachineEntity : Entity
  3764. {
  3765. private string _name;
  3766. private ServerStatus _status;
  3767. #region Extensibility Method Definitions
  3768. /// <summary>
  3769. /// This method is invoked from the constructor once initialization is complete and
  3770. /// can be used for further object setup.
  3771. /// </summary>
  3772. partial void OnCreated();
  3773. partial void OnNameChanging(string value);
  3774. partial void OnNameChanged();
  3775. partial void OnStatusChanging(ServerStatus value);
  3776. partial void OnStatusChanged();
  3777. #endregion
  3778. /// <summary>
  3779. /// Initializes a new instance of the <see cref="TestingMachineEntity"/> class.
  3780. /// </summary>
  3781. public TestingMachineEntity()
  3782. {
  3783. this.OnCreated();
  3784. }
  3785. /// <summary>
  3786. /// Gets or sets the 'Name' value.
  3787. /// </summary>
  3788. [DataMember()]
  3789. [Editable(false, AllowInitialValue=true)]
  3790. [Key()]
  3791. [RoundtripOriginal()]
  3792. public string Name
  3793. {
  3794. get
  3795. {
  3796. return this._name;
  3797. }
  3798. set
  3799. {
  3800. if ((this._name != value))
  3801. {
  3802. this.OnNameChanging(value);
  3803. this.ValidateProperty("Name", value);
  3804. this._name = value;
  3805. this.RaisePropertyChanged("Name");
  3806. this.OnNameChanged();
  3807. }
  3808. }
  3809. }
  3810. /// <summary>
  3811. /// Gets or sets the 'Status' value.
  3812. /// </summary>
  3813. [DataMember()]
  3814. public ServerStatus Status
  3815. {
  3816. get
  3817. {
  3818. return this._status;
  3819. }
  3820. set
  3821. {
  3822. if ((this._status != value))
  3823. {
  3824. this.OnStatusChanging(value);
  3825. this.RaiseDataMemberChanging("Status");
  3826. this.ValidateProperty("Status", value);
  3827. this._status = value;
  3828. this.RaiseDataMemberChanged("Status");
  3829. this.OnStatusChanged();
  3830. }
  3831. }
  3832. }
  3833. /// <summary>
  3834. /// Computes a value from the key fields that uniquely identifies this entity instance.
  3835. /// </summary>
  3836. /// <returns>An object instance that uniquely identifies this entity instance.</returns>
  3837. public override object GetIdentity()
  3838. {
  3839. return this._name;
  3840. }
  3841. }
  3842. }
  3843. namespace glados.Web.Services.RIAServices
  3844. {
  3845. using System;
  3846. using System.Collections.Generic;
  3847. using System.ComponentModel;
  3848. using System.ComponentModel.DataAnnotations;
  3849. using System.Linq;
  3850. using System.ServiceModel;
  3851. using System.ServiceModel.DomainServices;
  3852. using System.ServiceModel.DomainServices.Client;
  3853. using System.ServiceModel.DomainServices.Client.ApplicationServices;
  3854. using glados.Web.Logic.Base;
  3855. using glados.Web.Services.Entities;
  3856. /// <summary>
  3857. /// The DomainContext corresponding to the 'CompetitionAdminService' DomainService.
  3858. /// </summary>
  3859. public sealed partial class CompetitionAdminContext : DomainContext
  3860. {
  3861. #region Extensibility Method Definitions
  3862. /// <summary>
  3863. /// This method is invoked from the constructor once initialization is complete and
  3864. /// can be used for further object setup.
  3865. /// </summary>
  3866. partial void OnCreated();
  3867. #endregion
  3868. /// <summary>
  3869. /// Initializes a new instance of the <see cref="CompetitionAdminContext"/> class.
  3870. /// </summary>
  3871. public CompetitionAdminContext() :
  3872. this(new WebDomainClient<ICompetitionAdminServiceContract>(new Uri("glados-Web-Services-RIAServices-CompetitionAdminService.svc", UriKind.Relative)))
  3873. {
  3874. }
  3875. /// <summary>
  3876. /// Initializes a new instance of the <see cref="CompetitionAdminContext"/> class with the specified service URI.
  3877. /// </summary>
  3878. /// <param name="serviceUri">The CompetitionAdminService service URI.</param>
  3879. public CompetitionAdminContext(Uri serviceUri) :
  3880. this(new WebDomainClient<ICompetitionAdminServiceContract>(serviceUri))
  3881. {
  3882. }
  3883. /// <summary>
  3884. /// Initializes a new instance of the <see cref="CompetitionAdminContext"/> class with the specified <paramref name="domainClient"/>.
  3885. /// </summary>
  3886. /// <param name="domainClient">The DomainClient instance to use for this DomainContext.</param>
  3887. public CompetitionAdminContext(DomainClient domainClient) :
  3888. base(domainClient)
  3889. {
  3890. this.OnCreated();
  3891. }
  3892. /// <summary>
  3893. /// Asynchronously invokes the 'AssignTask' method of the DomainService.
  3894. /// </summary>
  3895. /// <param name="assignmentId">The value for the 'assignmentId' parameter of this action.</param>
  3896. /// <param name="problemId">The value for the 'problemId' parameter of this action.</param>
  3897. /// <param name="callback">Callback to invoke when the operation completes.</param>
  3898. /// <param name="userState">Value to pass to the callback. It can be <c>null</c>.</param>
  3899. /// <returns>An operation instance that can be used to manage the asynchronous request.</returns>
  3900. public InvokeOperation AssignTask(int assignmentId, int problemId, Action<InvokeOperation> callback, object userState)
  3901. {
  3902. Dictionary<string, object> parameters = new Dictionary<string, object>();
  3903. parameters.Add("assignmentId", assignmentId);
  3904. parameters.Add("problemId", problemId);
  3905. this.ValidateMethod("AssignTask", parameters);
  3906. return this.InvokeOperation("AssignTask", typeof(void), parameters, true, callback, userState);
  3907. }
  3908. /// <summary>
  3909. /// Asynchronously invokes the 'AssignTask' method of the DomainService.
  3910. /// </summary>
  3911. /// <param name="assignmentId">The value for the 'assignmentId' parameter of this action.</param>
  3912. /// <param name="problemId">The value for the 'problemId' parameter of this action.</param>
  3913. /// <returns>An operation instance that can be used to manage the asynchronous request.</returns>
  3914. public InvokeOperation AssignTask(int assignmentId, int problemId)
  3915. {
  3916. Dictionary<string, object> parameters = new Dictionary<string, object>();
  3917. parameters.Add("assignmentId", assignmentId);
  3918. parameters.Add("problemId", problemId);
  3919. this.ValidateMethod("AssignTask", parameters);
  3920. return this.InvokeOperation("AssignTask", typeof(void), parameters, true, null, null);
  3921. }
  3922. /// <summary>
  3923. /// Asynchronously invokes the 'CreateCompetition' method of the DomainService.
  3924. /// </summary>
  3925. /// <param name="name">The value for the 'name' parameter of this action.</param>
  3926. /// <param name="typeName">The value for the 'typeName' parameter of this action.</param>
  3927. /// <param name="callback">Callback to invoke when the operation completes.</param>
  3928. /// <param name="userState">Value to pass to the callback. It can be <c>null</c>.</param>
  3929. /// <returns>An operation instance that can be used to manage the asynchronous request.</returns>
  3930. public InvokeOperation<int> CreateCompetition(string name, string typeName, Action<InvokeOperation<int>> callback, object userState)
  3931. {
  3932. Dictionary<string, object> parameters = new Dictionary<string, object>();
  3933. parameters.Add("name", name);
  3934. parameters.Add("typeName", typeName);
  3935. this.ValidateMethod("CreateCompetition", parameters);
  3936. return ((InvokeOperation<int>)(this.InvokeOperation("CreateCompetition", typeof(int), parameters, true, callback, userState)));
  3937. }
  3938. /// <summary>
  3939. /// Asynchronously invokes the 'CreateCompetition' method of the DomainService.
  3940. /// </summary>
  3941. /// <param name="name">The value for the 'name' parameter of this action.</param>
  3942. /// <param name="typeName">The value for the 'typeName' parameter of this action.</param>
  3943. /// <returns>An operation instance that can be used to manage the asynchronous request.</returns>
  3944. public InvokeOperation<int> CreateCompetition(string name, string typeName)
  3945. {
  3946. Dictionary<string, object> parameters = new Dictionary<string, object>();
  3947. parameters.Add("name", name);
  3948. parameters.Add("typeName", typeName);
  3949. this.ValidateMethod("CreateCompetition", parameters);
  3950. return ((InvokeOperation<int>)(this.InvokeOperation("CreateCompetition", typeof(int), parameters, true, null, null)));
  3951. }
  3952. /// <summary>
  3953. /// Asynchronously invokes the 'DeleteCompetition' method of the DomainService.
  3954. /// </summary>
  3955. /// <param name="id">The value for the 'id' parameter of this action.</param>
  3956. /// <param name="callback">Callback to invoke when the operation completes.</param>
  3957. /// <param name="userState">Value to pass to the callback. It can be <c>null</c>.</param>
  3958. /// <returns>An operation instance that can be used to manage the asynchronous request.</returns>
  3959. public InvokeOperation DeleteCompetition(int id, Action<InvokeOperation> callback, object userState)
  3960. {
  3961. Dictionary<string, object> parameters = new Dictionary<string, object>();
  3962. parameters.Add("id", id);
  3963. this.ValidateMethod("DeleteCompetition", parameters);
  3964. return this.InvokeOperation("DeleteCompetition", typeof(void), parameters, true, callback, userState);
  3965. }
  3966. /// <summary>
  3967. /// Asynchronously invokes the 'DeleteCompetition' method of the DomainService.
  3968. /// </summary>
  3969. /// <param name="id">The value for the 'id' parameter of this action.</param>
  3970. /// <returns>An operation instance that can be used to manage the asynchronous request.</returns>
  3971. public InvokeOperation DeleteCompetition(int id)
  3972. {
  3973. Dictionary<string, object> parameters = new Dictionary<string, object>();
  3974. parameters.Add("id", id);
  3975. this.ValidateMethod("DeleteCompetition", parameters);
  3976. return this.InvokeOperation("DeleteCompetition", typeof(void), parameters, true, null, null);
  3977. }
  3978. /// <summary>
  3979. /// Asynchronously invokes the 'GetAssignmentsForCompetition' method of the DomainService.
  3980. /// </summary>
  3981. /// <param name="id">The value for the 'id' parameter of this action.</param>
  3982. /// <param name="callback">Callback to invoke when the operation completes.</param>
  3983. /// <param name="userState">Value to pass to the callback. It can be <c>null</c>.</param>
  3984. /// <returns>An operation instance that can be used to manage the asynchronous request.</returns>
  3985. public InvokeOperation<IEnumerable<ParticipantAssignment>> GetAssignmentsForCompetition(int id, Action<InvokeOperation<IEnumerable<ParticipantAssignment>>> callback, object userState)
  3986. {
  3987. Dictionary<string, object> parameters = new Dictionary<string, object>();
  3988. parameters.Add("id", id);
  3989. this.ValidateMethod("GetAssignmentsForCompetition", parameters);
  3990. return ((InvokeOperation<IEnumerable<ParticipantAssignment>>)(this.InvokeOperation("GetAssignmentsForCompetition", typeof(IEnumerable<ParticipantAssignment>), parameters, true, callback, userState)));
  3991. }
  3992. /// <summary>
  3993. /// Asynchronously invokes the 'GetAssignmentsForCompetition' method of the DomainService.
  3994. /// </summary>
  3995. /// <param name="id">The value for the 'id' parameter of this action.</param>
  3996. /// <returns>An operation instance that can be used to manage the asynchronous request.</returns>
  3997. public InvokeOperation<IEnumerable<ParticipantAssignment>> GetAssignmentsForCompetition(int id)
  3998. {
  3999. Dictionary<string, object> parameters = new Dictionary<string, object>();
  4000. parameters.Add("id", id);
  4001. this.ValidateMethod("GetAssignmentsForCompetition", parameters);
  4002. return ((InvokeOperation<IEnumerable<ParticipantAssignment>>)(this.InvokeOperation("GetAssignmentsForCompetition", typeof(IEnumerable<ParticipantAssignment>), parameters, true, null, null)));
  4003. }
  4004. /// <summary>
  4005. /// Asynchronously invokes the 'GetCompetitionMainPage' method of the DomainService.
  4006. /// </summary>
  4007. /// <param name="id">The value for the 'id' parameter of this action.</param>
  4008. /// <param name="callback">Callback to invoke when the operation completes.</param>
  4009. /// <param name="userState">Value to pass to the callback. It can be <c>null</c>.</param>
  4010. /// <returns>An operation instance that can be used to manage the asynchronous request.</returns>
  4011. public InvokeOperation<Uri> GetCompetitionMainPage(int id, Action<InvokeOperation<Uri>> callback, object userState)
  4012. {
  4013. Dictionary<string, object> parameters = new Dictionary<string, object>();
  4014. parameters.Add("id", id);
  4015. this.ValidateMethod("GetCompetitionMainPage", parameters);
  4016. return ((InvokeOperation<Uri>)(this.InvokeOperation("GetCompetitionMainPage", typeof(Uri), parameters, true, callback, userState)));
  4017. }
  4018. /// <summary>
  4019. /// Asynchronously invokes the 'GetCompetitionMainPage' method of the DomainService.
  4020. /// </summary>
  4021. /// <param name="id">The value for the 'id' parameter of this action.</param>
  4022. /// <returns>An operation instance that can be used to manage the asynchronous request.</returns>
  4023. public InvokeOperation<Uri> GetCompetitionMainPage(int id)
  4024. {
  4025. Dictionary<string, object> parameters = new Dictionary<string, object>();
  4026. parameters.Add("id", id);
  4027. this.ValidateMethod("GetCompetitionMainPage", parameters);
  4028. return ((InvokeOperation<Uri>)(this.InvokeOperation("GetCompetitionMainPage", typeof(Uri), parameters, true, null, null)));
  4029. }
  4030. /// <summary>
  4031. /// Asynchronously invokes the 'GetCompetitionTypeList' method of the DomainService.
  4032. /// </summary>
  4033. /// <param name="callback">Callback to invoke when the operation completes.</param>
  4034. /// <param name="userState">Value to pass to the callback. It can be <c>null</c>.</param>
  4035. /// <returns>An operation instance that can be used to manage the asynchronous request.</returns>
  4036. public InvokeOperation<IEnumerable<string>> GetCompetitionTypeList(Action<InvokeOperation<IEnumerable<string>>> callback, object userState)
  4037. {
  4038. this.ValidateMethod("GetCompetitionTypeList", null);
  4039. return ((InvokeOperation<IEnumerable<string>>)(this.InvokeOperation("GetCompetitionTypeList", typeof(IEnumerable<string>), null, true, callback, userState)));
  4040. }
  4041. /// <summary>
  4042. /// Asynchronously invokes the 'GetCompetitionTypeList' method of the DomainService.
  4043. /// </summary>
  4044. /// <returns>An operation instance that can be used to manage the asynchronous request.</returns>
  4045. public InvokeOperation<IEnumerable<string>> GetCompetitionTypeList()
  4046. {
  4047. this.ValidateMethod("GetCompetitionTypeList", null);
  4048. return ((InvokeOperation<IEnumerable<string>>)(this.InvokeOperation("GetCompetitionTypeList", typeof(IEnumerable<string>), null, true, null, null)));
  4049. }
  4050. /// <summary>
  4051. /// Asynchronously invokes the 'GetCourseParticipantStates' method of the DomainService.
  4052. /// </summary>
  4053. /// <param name="competitionId">The value for the 'competitionId' parameter of this action.</param>
  4054. /// <param name="callback">Callback to invoke when the operation completes.</param>
  4055. /// <param name="userState">Value to pass to the callback. It can be <c>null</c>.</param>
  4056. /// <returns>An operation instance that can be used to manage the asynchronous request.</returns>
  4057. public InvokeOperation<CourseDashboardInfo> GetCourseParticipantStates(int competitionId, Action<InvokeOperation<CourseDashboardInfo>> callback, object userState)
  4058. {
  4059. Dictionary<string, object> parameters = new Dictionary<string, object>();
  4060. parameters.Add("competitionId", competitionId);
  4061. this.ValidateMethod("GetCourseParticipantStates", parameters);
  4062. return ((InvokeOperation<CourseDashboardInfo>)(this.InvokeOperation("GetCourseParticipantStates", typeof(CourseDashboardInfo), parameters, true, callback, userState)));
  4063. }
  4064. /// <summary>
  4065. /// Asynchronously invokes the 'GetCourseParticipantStates' method of the DomainService.
  4066. /// </summary>
  4067. /// <param name="competitionId">The value for the 'competitionId' parameter of this action.</param>
  4068. /// <returns>An operation instance that can be used to manage the asynchronous request.</returns>
  4069. public InvokeOperation<CourseDashboardInfo> GetCourseParticipantStates(int competitionId)
  4070. {
  4071. Dictionary<string, object> parameters = new Dictionary<string, object>();
  4072. parameters.Add("competitionId", competitionId);
  4073. this.ValidateMethod("GetCourseParticipantStates", parameters);
  4074. return ((InvokeOperation<CourseDashboardInfo>)(this.InvokeOperation("GetCourseParticipantStates", typeof(CourseDashboardInfo), parameters, true, null, null)));
  4075. }
  4076. /// <summary>
  4077. /// Asynchronously invokes the 'SetAssignmentsForCompetition' method of the DomainService.
  4078. /// </summary>
  4079. /// <param name="id">The value for the 'id' parameter of this action.</param>
  4080. /// <param name="assignments">The value for the 'assignments' parameter of this action.</param>
  4081. /// <param name="callback">Callback to invoke when the operation completes.</param>
  4082. /// <param name="userState">Value to pass to the callback. It can be <c>null</c>.</param>
  4083. /// <returns>An operation instance that can be used to manage the asynchronous request.</returns>
  4084. public InvokeOperation SetAssignmentsForCompetition(int id, IEnumerable<ParticipantAssignment> assignments, Action<InvokeOperation> callback, object userState)
  4085. {
  4086. Dictionary<string, object> parameters = new Dictionary<string, object>();
  4087. parameters.Add("id", id);
  4088. parameters.Add("assignments", assignments);
  4089. this.ValidateMethod("SetAssignmentsForCompetition", parameters);
  4090. return this.InvokeOperation("SetAssignmentsForCompetition", typeof(void), parameters, true, callback, userState);
  4091. }
  4092. /// <summary>
  4093. /// Asynchronously invokes the 'SetAssignmentsForCompetition' method of the DomainService.
  4094. /// </summary>
  4095. /// <param name="id">The value for the 'id' parameter of this action.</param>
  4096. /// <param name="assignments">The value for the 'assignments' parameter of this action.</param>
  4097. /// <returns>An operation instance that can be used to manage the asynchronous request.</returns>
  4098. public InvokeOperation SetAssignmentsForCompetition(int id, IEnumerable<ParticipantAssignment> assignments)
  4099. {
  4100. Dictionary<string, object> parameters = new Dictionary<string, object>();
  4101. parameters.Add("id", id);
  4102. parameters.Add("assignments", assignments);
  4103. this.ValidateMethod("SetAssignmentsForCompetition", parameters);
  4104. return this.InvokeOperation("SetAssignmentsForCompetition", typeof(void), parameters, true, null, null);
  4105. }
  4106. /// <summary>
  4107. /// Creates a new EntityContainer for this DomainContext's EntitySets.
  4108. /// </summary>
  4109. /// <returns>A new container instance.</returns>
  4110. protected override EntityContainer CreateEntityContainer()
  4111. {
  4112. return new CompetitionAdminContextEntityContainer();
  4113. }
  4114. /// <summary>
  4115. /// Service contract for the 'CompetitionAdminService' DomainService.
  4116. /// </summary>
  4117. [ServiceContract()]
  4118. public interface ICompetitionAdminServiceContract
  4119. {
  4120. /// <summary>
  4121. /// Asynchronously invokes the 'AssignTask' operation.
  4122. /// </summary>
  4123. /// <param name="assignmentId">The value for the 'assignmentId' parameter of this action.</param>
  4124. /// <param name="problemId">The value for the 'problemId' parameter of this action.</param>
  4125. /// <param name="callback">Callback to invoke on completion.</param>
  4126. /// <param name="asyncState">Optional state object.</param>
  4127. /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
  4128. [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/CompetitionAdminService/AssignTaskDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
  4129. [OperationContract(AsyncPattern=true, Action="http://tempuri.org/CompetitionAdminService/AssignTask", ReplyAction="http://tempuri.org/CompetitionAdminService/AssignTaskResponse")]
  4130. IAsyncResult BeginAssignTask(int assignmentId, int problemId, AsyncCallback callback, object asyncState);
  4131. /// <summary>
  4132. /// Completes the asynchronous operation begun by 'BeginAssignTask'.
  4133. /// </summary>
  4134. /// <param name="result">The IAsyncResult returned from 'BeginAssignTask'.</param>
  4135. void EndAssignTask(IAsyncResult result);
  4136. /// <summary>
  4137. /// Asynchronously invokes the 'CreateCompetition' operation.
  4138. /// </summary>
  4139. /// <param name="name">The value for the 'name' parameter of this action.</param>
  4140. /// <param name="typeName">The value for the 'typeName' parameter of this action.</param>
  4141. /// <param name="callback">Callback to invoke on completion.</param>
  4142. /// <param name="asyncState">Optional state object.</param>
  4143. /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
  4144. [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/CompetitionAdminService/CreateCompetitionDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
  4145. [OperationContract(AsyncPattern=true, Action="http://tempuri.org/CompetitionAdminService/CreateCompetition", ReplyAction="http://tempuri.org/CompetitionAdminService/CreateCompetitionResponse")]
  4146. IAsyncResult BeginCreateCompetition(string name, string typeName, AsyncCallback callback, object asyncState);
  4147. /// <summary>
  4148. /// Completes the asynchronous operation begun by 'BeginCreateCompetition'.
  4149. /// </summary>
  4150. /// <param name="result">The IAsyncResult returned from 'BeginCreateCompetition'.</param>
  4151. /// <returns>The 'Int32' returned from the 'CreateCompetition' operation.</returns>
  4152. int EndCreateCompetition(IAsyncResult result);
  4153. /// <summary>
  4154. /// Asynchronously invokes the 'DeleteCompetition' operation.
  4155. /// </summary>
  4156. /// <param name="id">The value for the 'id' parameter of this action.</param>
  4157. /// <param name="callback">Callback to invoke on completion.</param>
  4158. /// <param name="asyncState">Optional state object.</param>
  4159. /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
  4160. [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/CompetitionAdminService/DeleteCompetitionDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
  4161. [OperationContract(AsyncPattern=true, Action="http://tempuri.org/CompetitionAdminService/DeleteCompetition", ReplyAction="http://tempuri.org/CompetitionAdminService/DeleteCompetitionResponse")]
  4162. IAsyncResult BeginDeleteCompetition(int id, AsyncCallback callback, object asyncState);
  4163. /// <summary>
  4164. /// Completes the asynchronous operation begun by 'BeginDeleteCompetition'.
  4165. /// </summary>
  4166. /// <param name="result">The IAsyncResult returned from 'BeginDeleteCompetition'.</param>
  4167. void EndDeleteCompetition(IAsyncResult result);
  4168. /// <summary>
  4169. /// Asynchronously invokes the 'GetAssignmentsForCompetition' operation.
  4170. /// </summary>
  4171. /// <param name="id">The value for the 'id' parameter of this action.</param>
  4172. /// <param name="callback">Callback to invoke on completion.</param>
  4173. /// <param name="asyncState">Optional state object.</param>
  4174. /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
  4175. [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/CompetitionAdminService/GetAssignmentsForCompetitionDomainServ" +
  4176. "iceFault", Name="DomainServiceFault", Namespace="DomainServices")]
  4177. [OperationContract(AsyncPattern=true, Action="http://tempuri.org/CompetitionAdminService/GetAssignmentsForCompetition", ReplyAction="http://tempuri.org/CompetitionAdminService/GetAssignmentsForCompetitionResponse")]
  4178. IAsyncResult BeginGetAssignmentsForCompetition(int id, AsyncCallback callback, object asyncState);
  4179. /// <summary>
  4180. /// Completes the asynchronous operation begun by 'BeginGetAssignmentsForCompetition'.
  4181. /// </summary>
  4182. /// <param name="result">The IAsyncResult returned from 'BeginGetAssignmentsForCompetition'.</param>
  4183. /// <returns>The 'IEnumerable`1' returned from the 'GetAssignmentsForCompetition' operation.</returns>
  4184. IEnumerable<ParticipantAssignment> EndGetAssignmentsForCompetition(IAsyncResult result);
  4185. /// <summary>
  4186. /// Asynchronously invokes the 'GetCompetitionMainPage' operation.
  4187. /// </summary>
  4188. /// <param name="id">The value for the 'id' parameter of this action.</param>
  4189. /// <param name="callback">Callback to invoke on completion.</param>
  4190. /// <param name="asyncState">Optional state object.</param>
  4191. /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
  4192. [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/CompetitionAdminService/GetCompetitionMainPageDomainServiceFau" +
  4193. "lt", Name="DomainServiceFault", Namespace="DomainServices")]
  4194. [OperationContract(AsyncPattern=true, Action="http://tempuri.org/CompetitionAdminService/GetCompetitionMainPage", ReplyAction="http://tempuri.org/CompetitionAdminService/GetCompetitionMainPageResponse")]
  4195. IAsyncResult BeginGetCompetitionMainPage(int id, AsyncCallback callback, object asyncState);
  4196. /// <summary>
  4197. /// Completes the asynchronous operation begun by 'BeginGetCompetitionMainPage'.
  4198. /// </summary>
  4199. /// <param name="result">The IAsyncResult returned from 'BeginGetCompetitionMainPage'.</param>
  4200. /// <returns>The 'Uri' returned from the 'GetCompetitionMainPage' operation.</returns>
  4201. Uri EndGetCompetitionMainPage(IAsyncResult result);
  4202. /// <summary>
  4203. /// Asynchronously invokes the 'GetCompetitionTypeList' operation.
  4204. /// </summary>
  4205. /// <param name="callback">Callback to invoke on completion.</param>
  4206. /// <param name="asyncState">Optional state object.</param>
  4207. /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
  4208. [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/CompetitionAdminService/GetCompetitionTypeListDomainServiceFau" +
  4209. "lt", Name="DomainServiceFault", Namespace="DomainServices")]
  4210. [OperationContract(AsyncPattern=true, Action="http://tempuri.org/CompetitionAdminService/GetCompetitionTypeList", ReplyAction="http://tempuri.org/CompetitionAdminService/GetCompetitionTypeListResponse")]
  4211. IAsyncResult BeginGetCompetitionTypeList(AsyncCallback callback, object asyncState);
  4212. /// <summary>
  4213. /// Completes the asynchronous operation begun by 'BeginGetCompetitionTypeList'.
  4214. /// </summary>
  4215. /// <param name="result">The IAsyncResult returned from 'BeginGetCompetitionTypeList'.</param>
  4216. /// <returns>The 'IEnumerable`1' returned from the 'GetCompetitionTypeList' operation.</returns>
  4217. IEnumerable<string> EndGetCompetitionTypeList(IAsyncResult result);
  4218. /// <summary>
  4219. /// Asynchronously invokes the 'GetCourseParticipantStates' operation.
  4220. /// </summary>
  4221. /// <param name="competitionId">The value for the 'competitionId' parameter of this action.</param>
  4222. /// <param name="callback">Callback to invoke on completion.</param>
  4223. /// <param name="asyncState">Optional state object.</param>
  4224. /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
  4225. [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/CompetitionAdminService/GetCourseParticipantStatesDomainServic" +
  4226. "eFault", Name="DomainServiceFault", Namespace="DomainServices")]
  4227. [OperationContract(AsyncPattern=true, Action="http://tempuri.org/CompetitionAdminService/GetCourseParticipantStates", ReplyAction="http://tempuri.org/CompetitionAdminService/GetCourseParticipantStatesResponse")]
  4228. IAsyncResult BeginGetCourseParticipantStates(int competitionId, AsyncCallback callback, object asyncState);
  4229. /// <summary>
  4230. /// Completes the asynchronous operation begun by 'BeginGetCourseParticipantStates'.
  4231. /// </summary>
  4232. /// <param name="result">The IAsyncResult returned from 'BeginGetCourseParticipantStates'.</param>
  4233. /// <returns>The 'CourseDashboardInfo' returned from the 'GetCourseParticipantStates' operation.</returns>
  4234. CourseDashboardInfo EndGetCourseParticipantStates(IAsyncResult result);
  4235. /// <summary>
  4236. /// Asynchronously invokes the 'SetAssignmentsForCompetition' operation.
  4237. /// </summary>
  4238. /// <param name="id">The value for the 'id' parameter of this action.</param>
  4239. /// <param name="assignments">The value for the 'assignments' parameter of this action.</param>
  4240. /// <param name="callback">Callback to invoke on completion.</param>
  4241. /// <param name="asyncState">Optional state object.</param>
  4242. /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
  4243. [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/CompetitionAdminService/SetAssignmentsForCompetitionDomainServ" +
  4244. "iceFault", Name="DomainServiceFault", Namespace="DomainServices")]
  4245. [OperationContract(AsyncPattern=true, Action="http://tempuri.org/CompetitionAdminService/SetAssignmentsForCompetition", ReplyAction="http://tempuri.org/CompetitionAdminService/SetAssignmentsForCompetitionResponse")]
  4246. IAsyncResult BeginSetAssignmentsForCompetition(int id, IEnumerable<ParticipantAssignment> assignments, AsyncCallback callback, object asyncState);
  4247. /// <summary>
  4248. /// Completes the asynchronous operation begun by 'BeginSetAssignmentsForCompetition'.
  4249. /// </summary>
  4250. /// <param name="result">The IAsyncResult returned from 'BeginSetAssignmentsForCompetition'.</param>
  4251. void EndSetAssignmentsForCompetition(IAsyncResult result);
  4252. }
  4253. internal sealed class CompetitionAdminContextEntityContainer : EntityContainer
  4254. {
  4255. public CompetitionAdminContextEntityContainer()
  4256. {
  4257. }
  4258. }
  4259. }
  4260. /// <summary>
  4261. /// The DomainContext corresponding to the 'ParticipationService' DomainService.
  4262. /// </summary>
  4263. public sealed partial class ParticipationContext : DomainContext
  4264. {
  4265. #region Extensibility Method Definitions
  4266. /// <summary>
  4267. /// This method is invoked from the constructor once initialization is complete and
  4268. /// can be used for further object setup.
  4269. /// </summary>
  4270. partial void OnCreated();
  4271. #endregion
  4272. /// <summary>
  4273. /// Initializes a new instance of the <see cref="ParticipationContext"/> class.
  4274. /// </summary>
  4275. public ParticipationContext() :
  4276. this(new WebDomainClient<IParticipationServiceContract>(new Uri("glados-Web-Services-RIAServices-ParticipationService.svc", UriKind.Relative)))
  4277. {
  4278. }
  4279. /// <summary>
  4280. /// Initializes a new instance of the <see cref="ParticipationContext"/> class with the specified service URI.
  4281. /// </summary>
  4282. /// <param name="serviceUri">The ParticipationService service URI.</param>
  4283. public ParticipationContext(Uri serviceUri) :
  4284. this(new WebDomainClient<IParticipationServiceContract>(serviceUri))
  4285. {
  4286. }
  4287. /// <summary>
  4288. /// Initializes a new instance of the <see cref="ParticipationContext"/> class with the specified <paramref name="domainClient"/>.
  4289. /// </summary>
  4290. /// <param name="domainClient">The DomainClient instance to use for this DomainContext.</param>
  4291. public ParticipationContext(DomainClient domainClient) :
  4292. base(domainClient)
  4293. {
  4294. this.OnCreated();
  4295. }
  4296. /// <summary>
  4297. /// Asynchronously invokes the 'GetParticipantsForCompetition' method of the DomainService.
  4298. /// </summary>
  4299. /// <param name="competitionId">The value for the 'competitionId' parameter of this action.</param>
  4300. /// <param name="callback">Callback to invoke when the operation completes.</param>
  4301. /// <param name="userState">Value to pass to the callback. It can be <c>null</c>.</param>
  4302. /// <returns>An operation instance that can be used to manage the asynchronous request.</returns>
  4303. public InvokeOperation<IEnumerable<ParticipantState>> GetParticipantsForCompetition(int competitionId, Action<InvokeOperation<IEnumerable<ParticipantState>>> callback, object userState)
  4304. {
  4305. Dictionary<string, object> parameters = new Dictionary<string, object>();
  4306. parameters.Add("competitionId", competitionId);
  4307. this.ValidateMethod("GetParticipantsForCompetition", parameters);
  4308. return ((InvokeOperation<IEnumerable<ParticipantState>>)(this.InvokeOperation("GetParticipantsForCompetition", typeof(IEnumerable<ParticipantState>), parameters, true, callback, userState)));
  4309. }
  4310. /// <summary>
  4311. /// Asynchronously invokes the 'GetParticipantsForCompetition' method of the DomainService.
  4312. /// </summary>
  4313. /// <param name="competitionId">The value for the 'competitionId' parameter of this action.</param>
  4314. /// <returns>An operation instance that can be used to manage the asynchronous request.</returns>
  4315. public InvokeOperation<IEnumerable<ParticipantState>> GetParticipantsForCompetition(int competitionId)
  4316. {
  4317. Dictionary<string, object> parameters = new Dictionary<string, object>();
  4318. parameters.Add("competitionId", competitionId);
  4319. this.ValidateMethod("GetParticipantsForCompetition", parameters);
  4320. return ((InvokeOperation<IEnumerable<ParticipantState>>)(this.InvokeOperation("GetParticipantsForCompetition", typeof(IEnumerable<ParticipantState>), parameters, true, null, null)));
  4321. }
  4322. /// <summary>
  4323. /// Asynchronously invokes the 'GetProblemByAssignmentId' method of the DomainService.
  4324. /// </summary>
  4325. /// <param name="assignmentId">The value for the 'assignmentId' parameter of this action.</param>
  4326. /// <param name="callback">Callback to invoke when the operation completes.</param>
  4327. /// <param name="userState">Value to pass to the callback. It can be <c>null</c>.</param>
  4328. /// <returns>An operation instance that can be used to manage the asynchronous request.</returns>
  4329. public InvokeOperation<ProblemDetails> GetProblemByAssignmentId(int assignmentId, Action<InvokeOperation<ProblemDetails>> callback, object userState)
  4330. {
  4331. Dictionary<string, object> parameters = new Dictionary<string, object>();
  4332. parameters.Add("assignmentId", assignmentId);
  4333. this.ValidateMethod("GetProblemByAssignmentId", parameters);
  4334. return ((InvokeOperation<ProblemDetails>)(this.InvokeOperation("GetProblemByAssignmentId", typeof(ProblemDetails), parameters, true, callback, userState)));
  4335. }
  4336. /// <summary>
  4337. /// Asynchronously invokes the 'GetProblemByAssignmentId' method of the DomainService.
  4338. /// </summary>
  4339. /// <param name="assignmentId">The value for the 'assignmentId' parameter of this action.</param>
  4340. /// <returns>An operation instance that can be used to manage the asynchronous request.</returns>
  4341. public InvokeOperation<ProblemDetails> GetProblemByAssignmentId(int assignmentId)
  4342. {
  4343. Dictionary<string, object> parameters = new Dictionary<string, object>();
  4344. parameters.Add("assignmentId", assignmentId);
  4345. this.ValidateMethod("GetProblemByAssignmentId", parameters);
  4346. return ((InvokeOperation<ProblemDetails>)(this.InvokeOperation("GetProblemByAssignmentId", typeof(ProblemDetails), parameters, true, null, null)));
  4347. }
  4348. /// <summary>
  4349. /// Asynchronously invokes the 'GetProblemDetails' method of the DomainService.
  4350. /// </summary>
  4351. /// <param name="problemId">The value for the 'problemId' parameter of this action.</param>
  4352. /// <param name="callback">Callback to invoke when the operation completes.</param>
  4353. /// <param name="userState">Value to pass to the callback. It can be <c>null</c>.</param>
  4354. /// <returns>An operation instance that can be used to manage the asynchronous request.</returns>
  4355. public InvokeOperation<ProblemDetails> GetProblemDetails(int problemId, Action<InvokeOperation<ProblemDetails>> callback, object userState)
  4356. {
  4357. Dictionary<string, object> parameters = new Dictionary<string, object>();
  4358. parameters.Add("problemId", problemId);
  4359. this.ValidateMethod("GetProblemDetails", parameters);
  4360. return ((InvokeOperation<ProblemDetails>)(this.InvokeOperation("GetProblemDetails", typeof(ProblemDetails), parameters, true, callback, userState)));
  4361. }
  4362. /// <summary>
  4363. /// Asynchronously invokes the 'GetProblemDetails' method of the DomainService.
  4364. /// </summary>
  4365. /// <param name="problemId">The value for the 'problemId' parameter of this action.</param>
  4366. /// <returns>An operation instance that can be used to manage the asynchronous request.</returns>
  4367. public InvokeOperation<ProblemDetails> GetProblemDetails(int problemId)
  4368. {
  4369. Dictionary<string, object> parameters = new Dictionary<string, object>();
  4370. parameters.Add("problemId", problemId);
  4371. this.ValidateMethod("GetProblemDetails", parameters);
  4372. return ((InvokeOperation<ProblemDetails>)(this.InvokeOperation("GetProblemDetails", typeof(ProblemDetails), parameters, true, null, null)));
  4373. }
  4374. /// <summary>
  4375. /// Asynchronously invokes the 'SubmitSolution' method of the DomainService.
  4376. /// </summary>
  4377. /// <param name="assignmentId">The value for the 'assignmentId' parameter of this action.</param>
  4378. /// <param name="compilerName">The value for the 'compilerName' parameter of this action.</param>
  4379. /// <param name="source">The value for the 'source' parameter of this action.</param>
  4380. /// <param name="callback">Callback to invoke when the operation completes.</param>
  4381. /// <param name="userState">Value to pass to the callback. It can be <c>null</c>.</param>
  4382. /// <returns>An operation instance that can be used to manage the asynchronous request.</returns>
  4383. public InvokeOperation<int> SubmitSolution(int assignmentId, string compilerName, byte[] source, Action<InvokeOperation<int>> callback, object userState)
  4384. {
  4385. Dictionary<string, object> parameters = new Dictionary<string, object>();
  4386. parameters.Add("assignmentId", assignmentId);
  4387. parameters.Add("compilerName", compilerName);
  4388. parameters.Add("source", source);
  4389. this.ValidateMethod("SubmitSolution", parameters);
  4390. return ((InvokeOperation<int>)(this.InvokeOperation("SubmitSolution", typeof(int), parameters, true, callback, userState)));
  4391. }
  4392. /// <summary>
  4393. /// Asynchronously invokes the 'SubmitSolution' method of the DomainService.
  4394. /// </summary>
  4395. /// <param name="assignmentId">The value for the 'assignmentId' parameter of this action.</param>
  4396. /// <param name="compilerName">The value for the 'compilerName' parameter of this action.</param>
  4397. /// <param name="source">The value for the 'source' parameter of this action.</param>
  4398. /// <returns>An operation instance that can be used to manage the asynchronous request.</returns>
  4399. public InvokeOperation<int> SubmitSolution(int assignmentId, string compilerName, byte[] source)
  4400. {
  4401. Dictionary<string, object> parameters = new Dictionary<string, object>();
  4402. parameters.Add("assignmentId", assignmentId);
  4403. parameters.Add("compilerName", compilerName);
  4404. parameters.Add("source", source);
  4405. this.ValidateMethod("SubmitSolution", parameters);
  4406. return ((InvokeOperation<int>)(this.InvokeOperation("SubmitSolution", typeof(int), parameters, true, null, null)));
  4407. }
  4408. /// <summary>
  4409. /// Creates a new EntityContainer for this DomainContext's EntitySets.
  4410. /// </summary>
  4411. /// <returns>A new container instance.</returns>
  4412. protected override EntityContainer CreateEntityContainer()
  4413. {
  4414. return new ParticipationContextEntityContainer();
  4415. }
  4416. /// <summary>
  4417. /// Service contract for the 'ParticipationService' DomainService.
  4418. /// </summary>
  4419. [ServiceContract()]
  4420. public interface IParticipationServiceContract
  4421. {
  4422. /// <summary>
  4423. /// Asynchronously invokes the 'GetParticipantsForCompetition' operation.
  4424. /// </summary>
  4425. /// <param name="competitionId">The value for the 'competitionId' parameter of this action.</param>
  4426. /// <param name="callback">Callback to invoke on completion.</param>
  4427. /// <param name="asyncState">Optional state object.</param>
  4428. /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
  4429. [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/ParticipationService/GetParticipantsForCompetitionDomainServic" +
  4430. "eFault", Name="DomainServiceFault", Namespace="DomainServices")]
  4431. [OperationContract(AsyncPattern=true, Action="http://tempuri.org/ParticipationService/GetParticipantsForCompetition", ReplyAction="http://tempuri.org/ParticipationService/GetParticipantsForCompetitionResponse")]
  4432. IAsyncResult BeginGetParticipantsForCompetition(int competitionId, AsyncCallback callback, object asyncState);
  4433. /// <summary>
  4434. /// Completes the asynchronous operation begun by 'BeginGetParticipantsForCompetition'.
  4435. /// </summary>
  4436. /// <param name="result">The IAsyncResult returned from 'BeginGetParticipantsForCompetition'.</param>
  4437. /// <returns>The 'IEnumerable`1' returned from the 'GetParticipantsForCompetition' operation.</returns>
  4438. IEnumerable<ParticipantState> EndGetParticipantsForCompetition(IAsyncResult result);
  4439. /// <summary>
  4440. /// Asynchronously invokes the 'GetProblemByAssignmentId' operation.
  4441. /// </summary>
  4442. /// <param name="assignmentId">The value for the 'assignmentId' parameter of this action.</param>
  4443. /// <param name="callback">Callback to invoke on completion.</param>
  4444. /// <param name="asyncState">Optional state object.</param>
  4445. /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
  4446. [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/ParticipationService/GetProblemByAssignmentIdDomainServiceFaul" +
  4447. "t", Name="DomainServiceFault", Namespace="DomainServices")]
  4448. [OperationContract(AsyncPattern=true, Action="http://tempuri.org/ParticipationService/GetProblemByAssignmentId", ReplyAction="http://tempuri.org/ParticipationService/GetProblemByAssignmentIdResponse")]
  4449. IAsyncResult BeginGetProblemByAssignmentId(int assignmentId, AsyncCallback callback, object asyncState);
  4450. /// <summary>
  4451. /// Completes the asynchronous operation begun by 'BeginGetProblemByAssignmentId'.
  4452. /// </summary>
  4453. /// <param name="result">The IAsyncResult returned from 'BeginGetProblemByAssignmentId'.</param>
  4454. /// <returns>The 'ProblemDetails' returned from the 'GetProblemByAssignmentId' operation.</returns>
  4455. ProblemDetails EndGetProblemByAssignmentId(IAsyncResult result);
  4456. /// <summary>
  4457. /// Asynchronously invokes the 'GetProblemDetails' operation.
  4458. /// </summary>
  4459. /// <param name="problemId">The value for the 'problemId' parameter of this action.</param>
  4460. /// <param name="callback">Callback to invoke on completion.</param>
  4461. /// <param name="asyncState">Optional state object.</param>
  4462. /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
  4463. [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/ParticipationService/GetProblemDetailsDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
  4464. [OperationContract(AsyncPattern=true, Action="http://tempuri.org/ParticipationService/GetProblemDetails", ReplyAction="http://tempuri.org/ParticipationService/GetProblemDetailsResponse")]
  4465. IAsyncResult BeginGetProblemDetails(int problemId, AsyncCallback callback, object asyncState);
  4466. /// <summary>
  4467. /// Completes the asynchronous operation begun by 'BeginGetProblemDetails'.
  4468. /// </summary>
  4469. /// <param name="result">The IAsyncResult returned from 'BeginGetProblemDetails'.</param>
  4470. /// <returns>The 'ProblemDetails' returned from the 'GetProblemDetails' operation.</returns>
  4471. ProblemDetails EndGetProblemDetails(IAsyncResult result);
  4472. /// <summary>
  4473. /// Asynchronously invokes the 'SubmitSolution' operation.
  4474. /// </summary>
  4475. /// <param name="assignmentId">The value for the 'assignmentId' parameter of this action.</param>
  4476. /// <param name="compilerName">The value for the 'compilerName' parameter of this action.</param>
  4477. /// <param name="source">The value for the 'source' parameter of this action.</param>
  4478. /// <param name="callback">Callback to invoke on completion.</param>
  4479. /// <param name="asyncState">Optional state object.</param>
  4480. /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
  4481. [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/ParticipationService/SubmitSolutionDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
  4482. [OperationContract(AsyncPattern=true, Action="http://tempuri.org/ParticipationService/SubmitSolution", ReplyAction="http://tempuri.org/ParticipationService/SubmitSolutionResponse")]
  4483. IAsyncResult BeginSubmitSolution(int assignmentId, string compilerName, byte[] source, AsyncCallback callback, object asyncState);
  4484. /// <summary>
  4485. /// Completes the asynchronous operation begun by 'BeginSubmitSolution'.
  4486. /// </summary>
  4487. /// <param name="result">The IAsyncResult returned from 'BeginSubmitSolution'.</param>
  4488. /// <returns>The 'Int32' returned from the 'SubmitSolution' operation.</returns>
  4489. int EndSubmitSolution(IAsyncResult result);
  4490. }
  4491. internal sealed class ParticipationContextEntityContainer : EntityContainer
  4492. {
  4493. public ParticipationContextEntityContainer()
  4494. {
  4495. }
  4496. }
  4497. }
  4498. }