PageRenderTime 84ms CodeModel.GetById 31ms RepoModel.GetById 1ms app.codeStats 0ms

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

https://bitbucket.org/s_vladimir/tsys
Unknown | 5494 lines | 4913 code | 581 blank | 0 comment | 0 complexity | d0a425f5f416f1df4fc33a82a4d51803 MD5 | raw file
  1. //------------------------------------------------------------------------------
  2. // <auto-generated>
  3. // This code was generated by a tool.
  4. <<<<<<< local
  5. // Runtime Version:4.0.30319.237
  6. =======
  7. // Runtime Version:4.0.30319.1
  8. >>>>>>> other
  9. //
  10. // Changes to this file may cause incorrect behavior and will be lost if
  11. // the code is regenerated.
  12. // </auto-generated>
  13. //------------------------------------------------------------------------------
  14. namespace glados
  15. {
  16. using System;
  17. using System.Collections.Generic;
  18. using System.ComponentModel;
  19. using System.ComponentModel.DataAnnotations;
  20. using System.Linq;
  21. using System.ServiceModel.DomainServices;
  22. using System.ServiceModel.DomainServices.Client;
  23. using System.ServiceModel.DomainServices.Client.ApplicationServices;
  24. using glados.Web;
  25. /// <summary>
  26. /// Context for the RIA application.
  27. /// </summary>
  28. /// <remarks>
  29. /// This context extends the base to make application services and types available
  30. /// for consumption from code and xaml.
  31. /// </remarks>
  32. public sealed partial class WebContext : WebContextBase
  33. {
  34. #region Extensibility Method Definitions
  35. /// <summary>
  36. /// This method is invoked from the constructor once initialization is complete and
  37. /// can be used for further object setup.
  38. /// </summary>
  39. partial void OnCreated();
  40. #endregion
  41. /// <summary>
  42. /// Initializes a new instance of the WebContext class.
  43. /// </summary>
  44. public WebContext()
  45. {
  46. this.OnCreated();
  47. }
  48. /// <summary>
  49. /// Gets the context that is registered as a lifetime object with the current application.
  50. /// </summary>
  51. /// <exception cref="InvalidOperationException"> is thrown if there is no current application,
  52. /// no contexts have been added, or more than one context has been added.
  53. /// </exception>
  54. /// <seealso cref="System.Windows.Application.ApplicationLifetimeObjects"/>
  55. public new static WebContext Current
  56. {
  57. get
  58. {
  59. return ((WebContext)(WebContextBase.Current));
  60. }
  61. }
  62. /// <summary>
  63. /// Gets a user representing the authenticated identity.
  64. /// </summary>
  65. public new AuthUser User
  66. {
  67. get
  68. {
  69. return ((AuthUser)(base.User));
  70. }
  71. }
  72. }
  73. }
  74. namespace Glados.TestingModule.Interfaces
  75. {
  76. using System;
  77. using System.Collections.Generic;
  78. using System.ComponentModel;
  79. using System.ComponentModel.DataAnnotations;
  80. using System.Linq;
  81. using System.ServiceModel.DomainServices;
  82. using System.ServiceModel.DomainServices.Client;
  83. using System.ServiceModel.DomainServices.Client.ApplicationServices;
  84. public enum ServerStatus
  85. {
  86. Idle = 0,
  87. Busy = 1,
  88. InternalError = 2,
  89. Unavailable = 3,
  90. Down = 4,
  91. }
  92. }
  93. namespace glados.Web
  94. {
  95. using System;
  96. using System.Collections.Generic;
  97. using System.ComponentModel;
  98. using System.ComponentModel.DataAnnotations;
  99. using System.Linq;
  100. using System.Runtime.Serialization;
  101. using System.ServiceModel;
  102. using System.ServiceModel.DomainServices;
  103. using System.ServiceModel.DomainServices.Client;
  104. using System.ServiceModel.DomainServices.Client.ApplicationServices;
  105. using System.ServiceModel.Web;
  106. using System.Xml.Serialization;
  107. /// <summary>
  108. /// The 'Assignment' entity class.
  109. /// </summary>
  110. [DataContract(Namespace="http://schemas.datacontract.org/2004/07/glados.Web")]
  111. public sealed partial class Assignment : Entity
  112. {
  113. private int _id;
  114. private EntityRef<Participation> _participation;
  115. private int _participationId;
  116. private EntityRef<Problem> _problem;
  117. private int _problemId;
  118. private byte[] _state;
  119. private EntityCollection<Submission> _submission;
  120. #region Extensibility Method Definitions
  121. /// <summary>
  122. /// This method is invoked from the constructor once initialization is complete and
  123. /// can be used for further object setup.
  124. /// </summary>
  125. partial void OnCreated();
  126. partial void OnIdChanging(int value);
  127. partial void OnIdChanged();
  128. partial void OnParticipationIdChanging(int value);
  129. partial void OnParticipationIdChanged();
  130. partial void OnProblemIdChanging(int value);
  131. partial void OnProblemIdChanged();
  132. partial void OnStateChanging(byte[] value);
  133. partial void OnStateChanged();
  134. #endregion
  135. /// <summary>
  136. /// Initializes a new instance of the <see cref="Assignment"/> class.
  137. /// </summary>
  138. public Assignment()
  139. {
  140. this.OnCreated();
  141. }
  142. /// <summary>
  143. /// Gets or sets the 'Id' value.
  144. /// </summary>
  145. [DataMember()]
  146. [Editable(false, AllowInitialValue=true)]
  147. [Key()]
  148. [RoundtripOriginal()]
  149. public int Id
  150. {
  151. get
  152. {
  153. return this._id;
  154. }
  155. set
  156. {
  157. if ((this._id != value))
  158. {
  159. this.OnIdChanging(value);
  160. this.ValidateProperty("Id", value);
  161. this._id = value;
  162. this.RaisePropertyChanged("Id");
  163. this.OnIdChanged();
  164. }
  165. }
  166. }
  167. /// <summary>
  168. /// Gets or sets the associated <see cref="Participation"/> entity.
  169. /// </summary>
  170. [Association("Participation_Assignment", "ParticipationId", "Id", IsForeignKey=true)]
  171. [XmlIgnore()]
  172. public Participation Participation
  173. {
  174. get
  175. {
  176. if ((this._participation == null))
  177. {
  178. this._participation = new EntityRef<Participation>(this, "Participation", this.FilterParticipation);
  179. }
  180. return this._participation.Entity;
  181. }
  182. set
  183. {
  184. Participation previous = this.Participation;
  185. if ((previous != value))
  186. {
  187. this.ValidateProperty("Participation", value);
  188. if ((previous != null))
  189. {
  190. this._participation.Entity = null;
  191. previous.Assignment.Remove(this);
  192. }
  193. if ((value != null))
  194. {
  195. this.ParticipationId = value.Id;
  196. }
  197. else
  198. {
  199. this.ParticipationId = default(int);
  200. }
  201. this._participation.Entity = value;
  202. if ((value != null))
  203. {
  204. value.Assignment.Add(this);
  205. }
  206. this.RaisePropertyChanged("Participation");
  207. }
  208. }
  209. }
  210. /// <summary>
  211. /// Gets or sets the 'ParticipationId' value.
  212. /// </summary>
  213. [DataMember()]
  214. [RoundtripOriginal()]
  215. public int ParticipationId
  216. {
  217. get
  218. {
  219. return this._participationId;
  220. }
  221. set
  222. {
  223. if ((this._participationId != value))
  224. {
  225. this.OnParticipationIdChanging(value);
  226. this.RaiseDataMemberChanging("ParticipationId");
  227. this.ValidateProperty("ParticipationId", value);
  228. this._participationId = value;
  229. this.RaiseDataMemberChanged("ParticipationId");
  230. this.OnParticipationIdChanged();
  231. }
  232. }
  233. }
  234. /// <summary>
  235. /// Gets or sets the associated <see cref="Problem"/> entity.
  236. /// </summary>
  237. [Association("Problem_Assignment", "ProblemId", "Id", IsForeignKey=true)]
  238. [XmlIgnore()]
  239. public Problem Problem
  240. {
  241. get
  242. {
  243. if ((this._problem == null))
  244. {
  245. this._problem = new EntityRef<Problem>(this, "Problem", this.FilterProblem);
  246. }
  247. return this._problem.Entity;
  248. }
  249. set
  250. {
  251. Problem previous = this.Problem;
  252. if ((previous != value))
  253. {
  254. this.ValidateProperty("Problem", value);
  255. if ((previous != null))
  256. {
  257. this._problem.Entity = null;
  258. previous.Assignment.Remove(this);
  259. }
  260. if ((value != null))
  261. {
  262. this.ProblemId = value.Id;
  263. }
  264. else
  265. {
  266. this.ProblemId = default(int);
  267. }
  268. this._problem.Entity = value;
  269. if ((value != null))
  270. {
  271. value.Assignment.Add(this);
  272. }
  273. this.RaisePropertyChanged("Problem");
  274. }
  275. }
  276. }
  277. /// <summary>
  278. /// Gets or sets the 'ProblemId' value.
  279. /// </summary>
  280. [DataMember()]
  281. [RoundtripOriginal()]
  282. public int ProblemId
  283. {
  284. get
  285. {
  286. return this._problemId;
  287. }
  288. set
  289. {
  290. if ((this._problemId != value))
  291. {
  292. this.OnProblemIdChanging(value);
  293. this.RaiseDataMemberChanging("ProblemId");
  294. this.ValidateProperty("ProblemId", value);
  295. this._problemId = value;
  296. this.RaiseDataMemberChanged("ProblemId");
  297. this.OnProblemIdChanged();
  298. }
  299. }
  300. }
  301. /// <summary>
  302. /// Gets or sets the 'State' value.
  303. /// </summary>
  304. [DataMember()]
  305. public byte[] State
  306. {
  307. get
  308. {
  309. return this._state;
  310. }
  311. set
  312. {
  313. if ((this._state != value))
  314. {
  315. this.OnStateChanging(value);
  316. this.RaiseDataMemberChanging("State");
  317. this.ValidateProperty("State", value);
  318. this._state = value;
  319. this.RaiseDataMemberChanged("State");
  320. this.OnStateChanged();
  321. }
  322. }
  323. }
  324. /// <summary>
  325. /// Gets the collection of associated <see cref="Submission"/> entity instances.
  326. /// </summary>
  327. [Association("Assignment_Submission", "Id", "AssignmentId")]
  328. [XmlIgnore()]
  329. public EntityCollection<Submission> Submission
  330. {
  331. get
  332. {
  333. if ((this._submission == null))
  334. {
  335. this._submission = new EntityCollection<Submission>(this, "Submission", this.FilterSubmission, this.AttachSubmission, this.DetachSubmission);
  336. }
  337. return this._submission;
  338. }
  339. }
  340. private bool FilterParticipation(Participation entity)
  341. {
  342. return (entity.Id == this.ParticipationId);
  343. }
  344. private bool FilterProblem(Problem entity)
  345. {
  346. return (entity.Id == this.ProblemId);
  347. }
  348. private void AttachSubmission(Submission entity)
  349. {
  350. entity.Assignment = this;
  351. }
  352. private void DetachSubmission(Submission entity)
  353. {
  354. entity.Assignment = null;
  355. }
  356. private bool FilterSubmission(Submission entity)
  357. {
  358. return (entity.AssignmentId == this.Id);
  359. }
  360. /// <summary>
  361. /// Computes a value from the key fields that uniquely identifies this entity instance.
  362. /// </summary>
  363. /// <returns>An object instance that uniquely identifies this entity instance.</returns>
  364. public override object GetIdentity()
  365. {
  366. return this._id;
  367. }
  368. }
  369. /// <summary>
  370. /// The DomainContext corresponding to the 'AuthenticationDomainService' DomainService.
  371. /// </summary>
  372. public sealed partial class AuthenticationDomainContext : global::System.ServiceModel.DomainServices.Client.ApplicationServices.AuthenticationDomainContextBase
  373. {
  374. #region Extensibility Method Definitions
  375. /// <summary>
  376. /// This method is invoked from the constructor once initialization is complete and
  377. /// can be used for further object setup.
  378. /// </summary>
  379. partial void OnCreated();
  380. #endregion
  381. /// <summary>
  382. /// Initializes a new instance of the <see cref="AuthenticationDomainContext"/> class.
  383. /// </summary>
  384. public AuthenticationDomainContext() :
  385. this(new WebDomainClient<IAuthenticationDomainServiceContract>(new Uri("glados-Web-AuthenticationDomainService.svc", UriKind.Relative)))
  386. {
  387. }
  388. /// <summary>
  389. /// Initializes a new instance of the <see cref="AuthenticationDomainContext"/> class with the specified service URI.
  390. /// </summary>
  391. /// <param name="serviceUri">The AuthenticationDomainService service URI.</param>
  392. public AuthenticationDomainContext(Uri serviceUri) :
  393. this(new WebDomainClient<IAuthenticationDomainServiceContract>(serviceUri))
  394. {
  395. }
  396. /// <summary>
  397. /// Initializes a new instance of the <see cref="AuthenticationDomainContext"/> class with the specified <paramref name="domainClient"/>.
  398. /// </summary>
  399. /// <param name="domainClient">The DomainClient instance to use for this DomainContext.</param>
  400. public AuthenticationDomainContext(DomainClient domainClient) :
  401. base(domainClient)
  402. {
  403. this.OnCreated();
  404. }
  405. /// <summary>
  406. /// Gets the set of <see cref="AuthUser"/> entity instances that have been loaded into this <see cref="AuthenticationDomainContext"/> instance.
  407. /// </summary>
  408. public EntitySet<AuthUser> AuthUsers
  409. {
  410. get
  411. {
  412. return base.EntityContainer.GetEntitySet<AuthUser>();
  413. }
  414. }
  415. /// <summary>
  416. /// Gets an EntityQuery instance that can be used to load <see cref="AuthUser"/> entity instances using the 'GetUser' query.
  417. /// </summary>
  418. /// <returns>An EntityQuery that can be loaded to retrieve <see cref="AuthUser"/> entity instances.</returns>
  419. public EntityQuery<AuthUser> GetUserQuery()
  420. {
  421. this.ValidateMethod("GetUserQuery", null);
  422. return base.CreateQuery<AuthUser>("GetUser", null, false, false);
  423. }
  424. /// <summary>
  425. /// Gets an EntityQuery instance that can be used to load <see cref="AuthUser"/> entity instances using the 'Login' query.
  426. /// </summary>
  427. /// <param name="userName">The value for the 'userName' parameter of the query.</param>
  428. /// <param name="password">The value for the 'password' parameter of the query.</param>
  429. /// <param name="isPersistent">The value for the 'isPersistent' parameter of the query.</param>
  430. /// <param name="customData">The value for the 'customData' parameter of the query.</param>
  431. /// <returns>An EntityQuery that can be loaded to retrieve <see cref="AuthUser"/> entity instances.</returns>
  432. public EntityQuery<AuthUser> LoginQuery(string userName, string password, bool isPersistent, string customData)
  433. {
  434. Dictionary<string, object> parameters = new Dictionary<string, object>();
  435. parameters.Add("userName", userName);
  436. parameters.Add("password", password);
  437. parameters.Add("isPersistent", isPersistent);
  438. parameters.Add("customData", customData);
  439. this.ValidateMethod("LoginQuery", parameters);
  440. return base.CreateQuery<AuthUser>("Login", parameters, true, false);
  441. }
  442. /// <summary>
  443. /// Gets an EntityQuery instance that can be used to load <see cref="AuthUser"/> entity instances using the 'Logout' query.
  444. /// </summary>
  445. /// <returns>An EntityQuery that can be loaded to retrieve <see cref="AuthUser"/> entity instances.</returns>
  446. public EntityQuery<AuthUser> LogoutQuery()
  447. {
  448. this.ValidateMethod("LogoutQuery", null);
  449. return base.CreateQuery<AuthUser>("Logout", null, true, false);
  450. }
  451. /// <summary>
  452. /// Creates a new EntityContainer for this DomainContext's EntitySets.
  453. /// </summary>
  454. /// <returns>A new container instance.</returns>
  455. protected override EntityContainer CreateEntityContainer()
  456. {
  457. return new AuthenticationDomainContextEntityContainer();
  458. }
  459. /// <summary>
  460. /// Service contract for the 'AuthenticationDomainService' DomainService.
  461. /// </summary>
  462. [ServiceContract()]
  463. public interface IAuthenticationDomainServiceContract
  464. {
  465. /// <summary>
  466. /// Asynchronously invokes the 'GetUser' operation.
  467. /// </summary>
  468. /// <param name="callback">Callback to invoke on completion.</param>
  469. /// <param name="asyncState">Optional state object.</param>
  470. /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
  471. [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/AuthenticationDomainService/GetUserDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
  472. [OperationContract(AsyncPattern=true, Action="http://tempuri.org/AuthenticationDomainService/GetUser", ReplyAction="http://tempuri.org/AuthenticationDomainService/GetUserResponse")]
  473. [WebGet()]
  474. IAsyncResult BeginGetUser(AsyncCallback callback, object asyncState);
  475. /// <summary>
  476. /// Completes the asynchronous operation begun by 'BeginGetUser'.
  477. /// </summary>
  478. /// <param name="result">The IAsyncResult returned from 'BeginGetUser'.</param>
  479. /// <returns>The 'QueryResult' returned from the 'GetUser' operation.</returns>
  480. QueryResult<AuthUser> EndGetUser(IAsyncResult result);
  481. /// <summary>
  482. /// Asynchronously invokes the 'Login' operation.
  483. /// </summary>
  484. /// <param name="userName">The value for the 'userName' parameter of this action.</param>
  485. /// <param name="password">The value for the 'password' parameter of this action.</param>
  486. /// <param name="isPersistent">The value for the 'isPersistent' parameter of this action.</param>
  487. /// <param name="customData">The value for the 'customData' parameter of this action.</param>
  488. /// <param name="callback">Callback to invoke on completion.</param>
  489. /// <param name="asyncState">Optional state object.</param>
  490. /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
  491. [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/AuthenticationDomainService/LoginDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
  492. [OperationContract(AsyncPattern=true, Action="http://tempuri.org/AuthenticationDomainService/Login", ReplyAction="http://tempuri.org/AuthenticationDomainService/LoginResponse")]
  493. IAsyncResult BeginLogin(string userName, string password, bool isPersistent, string customData, AsyncCallback callback, object asyncState);
  494. /// <summary>
  495. /// Completes the asynchronous operation begun by 'BeginLogin'.
  496. /// </summary>
  497. /// <param name="result">The IAsyncResult returned from 'BeginLogin'.</param>
  498. /// <returns>The 'QueryResult' returned from the 'Login' operation.</returns>
  499. QueryResult<AuthUser> EndLogin(IAsyncResult result);
  500. /// <summary>
  501. /// Asynchronously invokes the 'Logout' operation.
  502. /// </summary>
  503. /// <param name="callback">Callback to invoke on completion.</param>
  504. /// <param name="asyncState">Optional state object.</param>
  505. /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
  506. [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/AuthenticationDomainService/LogoutDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
  507. [OperationContract(AsyncPattern=true, Action="http://tempuri.org/AuthenticationDomainService/Logout", ReplyAction="http://tempuri.org/AuthenticationDomainService/LogoutResponse")]
  508. IAsyncResult BeginLogout(AsyncCallback callback, object asyncState);
  509. /// <summary>
  510. /// Completes the asynchronous operation begun by 'BeginLogout'.
  511. /// </summary>
  512. /// <param name="result">The IAsyncResult returned from 'BeginLogout'.</param>
  513. /// <returns>The 'QueryResult' returned from the 'Logout' operation.</returns>
  514. QueryResult<AuthUser> EndLogout(IAsyncResult result);
  515. /// <summary>
  516. /// Asynchronously invokes the 'SubmitChanges' operation.
  517. /// </summary>
  518. /// <param name="changeSet">The change-set to submit.</param>
  519. /// <param name="callback">Callback to invoke on completion.</param>
  520. /// <param name="asyncState">Optional state object.</param>
  521. /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
  522. [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/AuthenticationDomainService/SubmitChangesDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
  523. [OperationContract(AsyncPattern=true, Action="http://tempuri.org/AuthenticationDomainService/SubmitChanges", ReplyAction="http://tempuri.org/AuthenticationDomainService/SubmitChangesResponse")]
  524. IAsyncResult BeginSubmitChanges(IEnumerable<ChangeSetEntry> changeSet, AsyncCallback callback, object asyncState);
  525. /// <summary>
  526. /// Completes the asynchronous operation begun by 'BeginSubmitChanges'.
  527. /// </summary>
  528. /// <param name="result">The IAsyncResult returned from 'BeginSubmitChanges'.</param>
  529. /// <returns>The collection of change-set entry elements returned from 'SubmitChanges'.</returns>
  530. IEnumerable<ChangeSetEntry> EndSubmitChanges(IAsyncResult result);
  531. }
  532. internal sealed class AuthenticationDomainContextEntityContainer : EntityContainer
  533. {
  534. public AuthenticationDomainContextEntityContainer()
  535. {
  536. this.CreateEntitySet<AuthUser>(EntitySetOperations.Edit);
  537. }
  538. }
  539. }
  540. /// <summary>
  541. /// The 'AuthUser' entity class.
  542. /// </summary>
  543. [DataContract(Namespace="http://schemas.datacontract.org/2004/07/glados.Web")]
  544. public sealed partial class AuthUser : Entity, global::System.Security.Principal.IIdentity, global::System.Security.Principal.IPrincipal
  545. {
  546. private string _name = string.Empty;
  547. private IEnumerable<string> _roles;
  548. #region Extensibility Method Definitions
  549. /// <summary>
  550. /// This method is invoked from the constructor once initialization is complete and
  551. /// can be used for further object setup.
  552. /// </summary>
  553. partial void OnCreated();
  554. partial void OnNameChanging(string value);
  555. partial void OnNameChanged();
  556. partial void OnRolesChanging(IEnumerable<string> value);
  557. partial void OnRolesChanged();
  558. #endregion
  559. /// <summary>
  560. /// Initializes a new instance of the <see cref="AuthUser"/> class.
  561. /// </summary>
  562. public AuthUser()
  563. {
  564. this.OnCreated();
  565. }
  566. /// <summary>
  567. /// Gets or sets the 'Name' value.
  568. /// </summary>
  569. [DataMember()]
  570. [Editable(false, AllowInitialValue=true)]
  571. [Key()]
  572. [RoundtripOriginal()]
  573. public string Name
  574. {
  575. get
  576. {
  577. return this._name;
  578. }
  579. set
  580. {
  581. if ((this._name != value))
  582. {
  583. this.OnNameChanging(value);
  584. this.ValidateProperty("Name", value);
  585. this._name = value;
  586. this.RaisePropertyChanged("Name");
  587. this.OnNameChanged();
  588. this.RaisePropertyChanged("IsAuthenticated");
  589. }
  590. }
  591. }
  592. /// <summary>
  593. /// Gets or sets the 'Roles' value.
  594. /// </summary>
  595. [DataMember()]
  596. [Editable(false)]
  597. public IEnumerable<string> Roles
  598. {
  599. get
  600. {
  601. return this._roles;
  602. }
  603. set
  604. {
  605. if ((this._roles != value))
  606. {
  607. this.OnRolesChanging(value);
  608. this.ValidateProperty("Roles", value);
  609. this._roles = value;
  610. this.RaisePropertyChanged("Roles");
  611. this.OnRolesChanged();
  612. }
  613. }
  614. }
  615. string global::System.Security.Principal.IIdentity.AuthenticationType
  616. {
  617. get
  618. {
  619. return string.Empty;
  620. }
  621. }
  622. /// <summary>
  623. /// Gets a value indicating whether the identity is authenticated.
  624. /// </summary>
  625. /// <remarks>
  626. /// This value is <c>true</c> if <see cref="Name"/> is not <c>null</c> or empty.
  627. /// </remarks>
  628. public bool IsAuthenticated
  629. {
  630. get
  631. {
  632. return (true != string.IsNullOrEmpty(this.Name));
  633. }
  634. }
  635. string global::System.Security.Principal.IIdentity.Name
  636. {
  637. get
  638. {
  639. return this.Name;
  640. }
  641. }
  642. global::System.Security.Principal.IIdentity global::System.Security.Principal.IPrincipal.Identity
  643. {
  644. get
  645. {
  646. return this;
  647. }
  648. }
  649. /// <summary>
  650. /// Computes a value from the key fields that uniquely identifies this entity instance.
  651. /// </summary>
  652. /// <returns>An object instance that uniquely identifies this entity instance.</returns>
  653. public override object GetIdentity()
  654. {
  655. return this._name;
  656. }
  657. /// <summary>
  658. /// Return whether the principal is in the role.
  659. /// </summary>
  660. /// <remarks>
  661. /// Returns whether the specified role is contained in the roles.
  662. /// This implementation is case sensitive.
  663. /// </remarks>
  664. /// <param name="role">The name of the role for which to check membership.</param>
  665. /// <returns>Whether the principal is in the role.</returns>
  666. public bool IsInRole(string role)
  667. {
  668. if ((this.Roles == null))
  669. {
  670. return false;
  671. }
  672. return global::System.Linq.Enumerable.Contains(this.Roles, role);
  673. }
  674. }
  675. /// <summary>
  676. /// The 'Course' entity class.
  677. /// </summary>
  678. [DataContract(Namespace="http://schemas.datacontract.org/2004/07/glados.Web")]
  679. public sealed partial class Course : Entity
  680. {
  681. private int _id;
  682. private string _name;
  683. private EntityCollection<Participation> _participation;
  684. private byte[] _state;
  685. private string _type;
  686. #region Extensibility Method Definitions
  687. /// <summary>
  688. /// This method is invoked from the constructor once initialization is complete and
  689. /// can be used for further object setup.
  690. /// </summary>
  691. partial void OnCreated();
  692. partial void OnIdChanging(int value);
  693. partial void OnIdChanged();
  694. partial void OnNameChanging(string value);
  695. partial void OnNameChanged();
  696. partial void OnStateChanging(byte[] value);
  697. partial void OnStateChanged();
  698. partial void OnTypeChanging(string value);
  699. partial void OnTypeChanged();
  700. #endregion
  701. /// <summary>
  702. /// Initializes a new instance of the <see cref="Course"/> class.
  703. /// </summary>
  704. public Course()
  705. {
  706. this.OnCreated();
  707. }
  708. /// <summary>
  709. /// Gets or sets the 'Id' value.
  710. /// </summary>
  711. [DataMember()]
  712. [Editable(false, AllowInitialValue=true)]
  713. [Key()]
  714. [RoundtripOriginal()]
  715. public int Id
  716. {
  717. get
  718. {
  719. return this._id;
  720. }
  721. set
  722. {
  723. if ((this._id != value))
  724. {
  725. this.OnIdChanging(value);
  726. this.ValidateProperty("Id", value);
  727. this._id = value;
  728. this.RaisePropertyChanged("Id");
  729. this.OnIdChanged();
  730. }
  731. }
  732. }
  733. /// <summary>
  734. /// Gets or sets the 'Name' value.
  735. /// </summary>
  736. [DataMember()]
  737. [Required()]
  738. public string Name
  739. {
  740. get
  741. {
  742. return this._name;
  743. }
  744. set
  745. {
  746. if ((this._name != value))
  747. {
  748. this.OnNameChanging(value);
  749. this.RaiseDataMemberChanging("Name");
  750. this.ValidateProperty("Name", value);
  751. this._name = value;
  752. this.RaiseDataMemberChanged("Name");
  753. this.OnNameChanged();
  754. }
  755. }
  756. }
  757. /// <summary>
  758. /// Gets the collection of associated <see cref="Participation"/> entity instances.
  759. /// </summary>
  760. [Association("Course_Participation", "Id", "CourseId")]
  761. [XmlIgnore()]
  762. public EntityCollection<Participation> Participation
  763. {
  764. get
  765. {
  766. if ((this._participation == null))
  767. {
  768. this._participation = new EntityCollection<Participation>(this, "Participation", this.FilterParticipation, this.AttachParticipation, this.DetachParticipation);
  769. }
  770. return this._participation;
  771. }
  772. }
  773. /// <summary>
  774. /// Gets or sets the 'State' value.
  775. /// </summary>
  776. [DataMember()]
  777. public byte[] State
  778. {
  779. get
  780. {
  781. return this._state;
  782. }
  783. set
  784. {
  785. if ((this._state != value))
  786. {
  787. this.OnStateChanging(value);
  788. this.RaiseDataMemberChanging("State");
  789. this.ValidateProperty("State", value);
  790. this._state = value;
  791. this.RaiseDataMemberChanged("State");
  792. this.OnStateChanged();
  793. }
  794. }
  795. }
  796. /// <summary>
  797. /// Gets or sets the 'Type' value.
  798. /// </summary>
  799. [DataMember()]
  800. public string Type
  801. {
  802. get
  803. {
  804. return this._type;
  805. }
  806. set
  807. {
  808. if ((this._type != value))
  809. {
  810. this.OnTypeChanging(value);
  811. this.RaiseDataMemberChanging("Type");
  812. this.ValidateProperty("Type", value);
  813. this._type = value;
  814. this.RaiseDataMemberChanged("Type");
  815. this.OnTypeChanged();
  816. }
  817. }
  818. }
  819. private void AttachParticipation(Participation entity)
  820. {
  821. entity.Course = this;
  822. }
  823. private void DetachParticipation(Participation entity)
  824. {
  825. entity.Course = null;
  826. }
  827. private bool FilterParticipation(Participation entity)
  828. {
  829. return (entity.CourseId == this.Id);
  830. }
  831. /// <summary>
  832. /// Computes a value from the key fields that uniquely identifies this entity instance.
  833. /// </summary>
  834. /// <returns>An object instance that uniquely identifies this entity instance.</returns>
  835. public override object GetIdentity()
  836. {
  837. return this._id;
  838. }
  839. }
  840. /// <summary>
  841. /// The 'Group' entity class.
  842. /// </summary>
  843. [DataContract(Namespace="http://schemas.datacontract.org/2004/07/glados.Web")]
  844. public sealed partial class Group : Entity
  845. {
  846. private int _id;
  847. private EntityCollection<Membership> _membership;
  848. private string _name;
  849. #region Extensibility Method Definitions
  850. /// <summary>
  851. /// This method is invoked from the constructor once initialization is complete and
  852. /// can be used for further object setup.
  853. /// </summary>
  854. partial void OnCreated();
  855. partial void OnIdChanging(int value);
  856. partial void OnIdChanged();
  857. partial void OnNameChanging(string value);
  858. partial void OnNameChanged();
  859. #endregion
  860. /// <summary>
  861. /// Initializes a new instance of the <see cref="Group"/> class.
  862. /// </summary>
  863. public Group()
  864. {
  865. this.OnCreated();
  866. }
  867. /// <summary>
  868. /// Gets or sets the 'Id' value.
  869. /// </summary>
  870. [DataMember()]
  871. [Editable(false, AllowInitialValue=true)]
  872. [Key()]
  873. [RoundtripOriginal()]
  874. public int Id
  875. {
  876. get
  877. {
  878. return this._id;
  879. }
  880. set
  881. {
  882. if ((this._id != value))
  883. {
  884. this.OnIdChanging(value);
  885. this.ValidateProperty("Id", value);
  886. this._id = value;
  887. this.RaisePropertyChanged("Id");
  888. this.OnIdChanged();
  889. }
  890. }
  891. }
  892. /// <summary>
  893. /// Gets the collection of associated <see cref="Membership"/> entity instances.
  894. /// </summary>
  895. [Association("Group_Membership", "Id", "GroupId")]
  896. [XmlIgnore()]
  897. public EntityCollection<Membership> Membership
  898. {
  899. get
  900. {
  901. if ((this._membership == null))
  902. {
  903. this._membership = new EntityCollection<Membership>(this, "Membership", this.FilterMembership, this.AttachMembership, this.DetachMembership);
  904. }
  905. return this._membership;
  906. }
  907. }
  908. /// <summary>
  909. /// Gets or sets the 'Name' value.
  910. /// </summary>
  911. [DataMember()]
  912. [Required()]
  913. public string Name
  914. {
  915. get
  916. {
  917. return this._name;
  918. }
  919. set
  920. {
  921. if ((this._name != value))
  922. {
  923. this.OnNameChanging(value);
  924. this.RaiseDataMemberChanging("Name");
  925. this.ValidateProperty("Name", value);
  926. this._name = value;
  927. this.RaiseDataMemberChanged("Name");
  928. this.OnNameChanged();
  929. }
  930. }
  931. }
  932. private void AttachMembership(Membership entity)
  933. {
  934. entity.Group = this;
  935. }
  936. private void DetachMembership(Membership entity)
  937. {
  938. entity.Group = null;
  939. }
  940. private bool FilterMembership(Membership entity)
  941. {
  942. return (entity.GroupId == this.Id);
  943. }
  944. /// <summary>
  945. /// Computes a value from the key fields that uniquely identifies this entity instance.
  946. /// </summary>
  947. /// <returns>An object instance that uniquely identifies this entity instance.</returns>
  948. public override object GetIdentity()
  949. {
  950. return this._id;
  951. }
  952. }
  953. /// <summary>
  954. /// The 'Membership' entity class.
  955. /// </summary>
  956. [DataContract(Namespace="http://schemas.datacontract.org/2004/07/glados.Web")]
  957. public sealed partial class Membership : Entity
  958. {
  959. private EntityRef<Group> _group;
  960. private int _groupId;
  961. private int _id;
  962. private EntityRef<User> _user;
  963. private int _userId;
  964. #region Extensibility Method Definitions
  965. /// <summary>
  966. /// This method is invoked from the constructor once initialization is complete and
  967. /// can be used for further object setup.
  968. /// </summary>
  969. partial void OnCreated();
  970. partial void OnGroupIdChanging(int value);
  971. partial void OnGroupIdChanged();
  972. partial void OnIdChanging(int value);
  973. partial void OnIdChanged();
  974. partial void OnUserIdChanging(int value);
  975. partial void OnUserIdChanged();
  976. #endregion
  977. /// <summary>
  978. /// Initializes a new instance of the <see cref="Membership"/> class.
  979. /// </summary>
  980. public Membership()
  981. {
  982. this.OnCreated();
  983. }
  984. /// <summary>
  985. /// Gets or sets the associated <see cref="Group"/> entity.
  986. /// </summary>
  987. [Association("Group_Membership", "GroupId", "Id", IsForeignKey=true)]
  988. [XmlIgnore()]
  989. public Group Group
  990. {
  991. get
  992. {
  993. if ((this._group == null))
  994. {
  995. this._group = new EntityRef<Group>(this, "Group", this.FilterGroup);
  996. }
  997. return this._group.Entity;
  998. }
  999. set
  1000. {
  1001. Group previous = this.Group;
  1002. if ((previous != value))
  1003. {
  1004. this.ValidateProperty("Group", value);
  1005. if ((previous != null))
  1006. {
  1007. this._group.Entity = null;
  1008. previous.Membership.Remove(this);
  1009. }
  1010. if ((value != null))
  1011. {
  1012. this.GroupId = value.Id;
  1013. }
  1014. else
  1015. {
  1016. this.GroupId = default(int);
  1017. }
  1018. this._group.Entity = value;
  1019. if ((value != null))
  1020. {
  1021. value.Membership.Add(this);
  1022. }
  1023. this.RaisePropertyChanged("Group");
  1024. }
  1025. }
  1026. }
  1027. /// <summary>
  1028. /// Gets or sets the 'GroupId' value.
  1029. /// </summary>
  1030. [DataMember()]
  1031. [RoundtripOriginal()]
  1032. public int GroupId
  1033. {
  1034. get
  1035. {
  1036. return this._groupId;
  1037. }
  1038. set
  1039. {
  1040. if ((this._groupId != value))
  1041. {
  1042. this.OnGroupIdChanging(value);
  1043. this.RaiseDataMemberChanging("GroupId");
  1044. this.ValidateProperty("GroupId", value);
  1045. this._groupId = value;
  1046. this.RaiseDataMemberChanged("GroupId");
  1047. this.OnGroupIdChanged();
  1048. }
  1049. }
  1050. }
  1051. /// <summary>
  1052. /// Gets or sets the 'Id' value.
  1053. /// </summary>
  1054. [DataMember()]
  1055. [Editable(false, AllowInitialValue=true)]
  1056. [Key()]
  1057. [RoundtripOriginal()]
  1058. public int Id
  1059. {
  1060. get
  1061. {
  1062. return this._id;
  1063. }
  1064. set
  1065. {
  1066. if ((this._id != value))
  1067. {
  1068. this.OnIdChanging(value);
  1069. this.ValidateProperty("Id", value);
  1070. this._id = value;
  1071. this.RaisePropertyChanged("Id");
  1072. this.OnIdChanged();
  1073. }
  1074. }
  1075. }
  1076. /// <summary>
  1077. /// Gets or sets the associated <see cref="User"/> entity.
  1078. /// </summary>
  1079. [Association("User_Membership", "UserId", "Id", IsForeignKey=true)]
  1080. [XmlIgnore()]
  1081. public User User
  1082. {
  1083. get
  1084. {
  1085. if ((this._user == null))
  1086. {
  1087. this._user = new EntityRef<User>(this, "User", this.FilterUser);
  1088. }
  1089. return this._user.Entity;
  1090. }
  1091. set
  1092. {
  1093. User previous = this.User;
  1094. if ((previous != value))
  1095. {
  1096. this.ValidateProperty("User", value);
  1097. if ((previous != null))
  1098. {
  1099. this._user.Entity = null;
  1100. previous.Membership.Remove(this);
  1101. }
  1102. if ((value != null))
  1103. {
  1104. this.UserId = value.Id;
  1105. }
  1106. else
  1107. {
  1108. this.UserId = default(int);
  1109. }
  1110. this._user.Entity = value;
  1111. if ((value != null))
  1112. {
  1113. value.Membership.Add(this);
  1114. }
  1115. this.RaisePropertyChanged("User");
  1116. }
  1117. }
  1118. }
  1119. /// <summary>
  1120. /// Gets or sets the 'UserId' value.
  1121. /// </summary>
  1122. [DataMember()]
  1123. [RoundtripOriginal()]
  1124. public int UserId
  1125. {
  1126. get
  1127. {
  1128. return this._userId;
  1129. }
  1130. set
  1131. {
  1132. if ((this._userId != value))
  1133. {
  1134. this.OnUserIdChanging(value);
  1135. this.RaiseDataMemberChanging("UserId");
  1136. this.ValidateProperty("UserId", value);
  1137. this._userId = value;
  1138. this.RaiseDataMemberChanged("UserId");
  1139. this.OnUserIdChanged();
  1140. }
  1141. }
  1142. }
  1143. private bool FilterGroup(Group entity)
  1144. {
  1145. return (entity.Id == this.GroupId);
  1146. }
  1147. private bool FilterUser(User entity)
  1148. {
  1149. return (entity.Id == this.UserId);
  1150. }
  1151. /// <summary>
  1152. /// Computes a value from the key fields that uniquely identifies this entity instance.
  1153. /// </summary>
  1154. /// <returns>An object instance that uniquely identifies this entity instance.</returns>
  1155. public override object GetIdentity()
  1156. {
  1157. return this._id;
  1158. }
  1159. }
  1160. /// <summary>
  1161. /// The 'Message' entity class.
  1162. /// </summary>
  1163. [DataContract(Namespace="http://schemas.datacontract.org/2004/07/glados.Web")]
  1164. public sealed partial class Message : Entity
  1165. {
  1166. private int _id;
  1167. private int _receiverId;
  1168. private int _senderId;
  1169. private DateTime _sentTime;
  1170. private int _status;
  1171. private string _subject;
  1172. private string _text;
  1173. #region Extensibility Method Definitions
  1174. /// <summary>
  1175. /// This method is invoked from the constructor once initialization is complete and
  1176. /// can be used for further object setup.
  1177. /// </summary>
  1178. partial void OnCreated();
  1179. partial void OnIdChanging(int value);
  1180. partial void OnIdChanged();
  1181. partial void OnReceiverIdChanging(int value);
  1182. partial void OnReceiverIdChanged();
  1183. partial void OnSenderIdChanging(int value);
  1184. partial void OnSenderIdChanged();
  1185. partial void OnSentTimeChanging(DateTime value);
  1186. partial void OnSentTimeChanged();
  1187. partial void OnStatusChanging(int value);
  1188. partial void OnStatusChanged();
  1189. partial void OnSubjectChanging(string value);
  1190. partial void OnSubjectChanged();
  1191. partial void OnTextChanging(string value);
  1192. partial void OnTextChanged();
  1193. #endregion
  1194. /// <summary>
  1195. /// Initializes a new instance of the <see cref="Message"/> class.
  1196. /// </summary>
  1197. public Message()
  1198. {
  1199. this.OnCreated();
  1200. }
  1201. /// <summary>
  1202. /// Gets or sets the 'Id' value.
  1203. /// </summary>
  1204. // The following attributes were not generated:
  1205. //
  1206. // - The attribute 'System.ComponentModel.DataAnnotations.DatabaseGeneratedAttribute' is not visible in the client project 'glados.UI'. Are you missing an assembly reference?
  1207. // [DatabaseGeneratedAttribute(Identity)]
  1208. //
  1209. [DataMember()]
  1210. [Editable(false, AllowInitialValue=true)]
  1211. [Key()]
  1212. [RoundtripOriginal()]
  1213. public int Id
  1214. {
  1215. get
  1216. {
  1217. return this._id;
  1218. }
  1219. set
  1220. {
  1221. if ((this._id != value))
  1222. {
  1223. this.OnIdChanging(value);
  1224. this.ValidateProperty("Id", value);
  1225. this._id = value;
  1226. this.RaisePropertyChanged("Id");
  1227. this.OnIdChanged();
  1228. }
  1229. }
  1230. }
  1231. /// <summary>
  1232. /// Gets or sets the 'ReceiverId' value.
  1233. /// </summary>
  1234. [DataMember()]
  1235. [RoundtripOriginal()]
  1236. public int ReceiverId
  1237. {
  1238. get
  1239. {
  1240. return this._receiverId;
  1241. }
  1242. set
  1243. {
  1244. if ((this._receiverId != value))
  1245. {
  1246. this.OnReceiverIdChanging(value);
  1247. this.RaiseDataMemberChanging("ReceiverId");
  1248. this.ValidateProperty("ReceiverId", value);
  1249. this._receiverId = value;
  1250. this.RaiseDataMemberChanged("ReceiverId");
  1251. this.OnReceiverIdChanged();
  1252. }
  1253. }
  1254. }
  1255. /// <summary>
  1256. /// Gets or sets the 'SenderId' value.
  1257. /// </summary>
  1258. [DataMember()]
  1259. [RoundtripOriginal()]
  1260. public int SenderId
  1261. {
  1262. get
  1263. {
  1264. return this._senderId;
  1265. }
  1266. set
  1267. {
  1268. if ((this._senderId != value))
  1269. {
  1270. this.OnSenderIdChanging(value);
  1271. this.RaiseDataMemberChanging("SenderId");
  1272. this.ValidateProperty("SenderId", value);
  1273. this._senderId = value;
  1274. this.RaiseDataMemberChanged("SenderId");
  1275. this.OnSenderIdChanged();
  1276. }
  1277. }
  1278. }
  1279. /// <summary>
  1280. /// Gets or sets the 'SentTime' value.
  1281. /// </summary>
  1282. [DataMember()]
  1283. public DateTime SentTime
  1284. {
  1285. get
  1286. {
  1287. return this._sentTime;
  1288. }
  1289. set
  1290. {
  1291. if ((this._sentTime != value))
  1292. {
  1293. this.OnSentTimeChanging(value);
  1294. this.RaiseDataMemberChanging("SentTime");
  1295. this.ValidateProperty("SentTime", value);
  1296. this._sentTime = value;
  1297. this.RaiseDataMemberChanged("SentTime");
  1298. this.OnSentTimeChanged();
  1299. }
  1300. }
  1301. }
  1302. /// <summary>
  1303. /// Gets or sets the 'Status' value.
  1304. /// </summary>
  1305. [DataMember()]
  1306. public int Status
  1307. {
  1308. get
  1309. {
  1310. return this._status;
  1311. }
  1312. set
  1313. {
  1314. if ((this._status != value))
  1315. {
  1316. this.OnStatusChanging(value);
  1317. this.RaiseDataMemberChanging("Status");
  1318. this.ValidateProperty("Status", value);
  1319. this._status = value;
  1320. this.RaiseDataMemberChanged("Status");
  1321. this.OnStatusChanged();
  1322. }
  1323. }
  1324. }
  1325. /// <summary>
  1326. /// Gets or sets the 'Subject' value.
  1327. /// </summary>
  1328. [DataMember()]
  1329. [Required()]
  1330. public string Subject
  1331. {
  1332. get
  1333. {
  1334. return this._subject;
  1335. }
  1336. set
  1337. {
  1338. if ((this._subject != value))
  1339. {
  1340. this.OnSubjectChanging(value);
  1341. this.RaiseDataMemberChanging("Subject");
  1342. this.ValidateProperty("Subject", value);
  1343. this._subject = value;
  1344. this.RaiseDataMemberChanged("Subject");
  1345. this.OnSubjectChanged();
  1346. }
  1347. }
  1348. }
  1349. /// <summary>
  1350. /// Gets or sets the 'Text' value.
  1351. /// </summary>
  1352. [DataMember()]
  1353. [Required()]
  1354. public string Text
  1355. {
  1356. get
  1357. {
  1358. return this._text;
  1359. }
  1360. set
  1361. {
  1362. if ((this._text != value))
  1363. {
  1364. this.OnTextChanging(value);
  1365. this.RaiseDataMemberChanging("Text");
  1366. this.ValidateProperty("Text", value);
  1367. this._text = value;
  1368. this.RaiseDataMemberChanged("Text");
  1369. this.OnTextChanged();
  1370. }
  1371. }
  1372. }
  1373. /// <summary>
  1374. /// Computes a value from the key fields that uniquely identifies this entity instance.
  1375. /// </summary>
  1376. /// <returns>An object instance that uniquely identifies this entity instance.</returns>
  1377. public override object GetIdentity()
  1378. {
  1379. return this._id;
  1380. }
  1381. }
  1382. /// <summary>
  1383. /// The 'Participation' entity class.
  1384. /// </summary>
  1385. [DataContract(Namespace="http://schemas.datacontract.org/2004/07/glados.Web")]
  1386. public sealed partial class Participation : Entity
  1387. {
  1388. private EntityCollection<Assignment> _assignment;
  1389. private EntityRef<Course> _course;
  1390. private int _courseId;
  1391. private int _id;
  1392. private byte[] _state;
  1393. private EntityRef<User> _user;
  1394. private int _userId;
  1395. #region Extensibility Method Definitions
  1396. /// <summary>
  1397. /// This method is invoked from the constructor once initialization is complete and
  1398. /// can be used for further object setup.
  1399. /// </summary>
  1400. partial void OnCreated();
  1401. partial void OnCourseIdChanging(int value);
  1402. partial void OnCourseIdChanged();
  1403. partial void OnIdChanging(int value);
  1404. partial void OnIdChanged();
  1405. partial void OnStateChanging(byte[] value);
  1406. partial void OnStateChanged();
  1407. partial void OnUserIdChanging(int value);
  1408. partial void OnUserIdChanged();
  1409. #endregion
  1410. /// <summary>
  1411. /// Initializes a new instance of the <see cref="Participation"/> class.
  1412. /// </summary>
  1413. public Participation()
  1414. {
  1415. this.OnCreated();
  1416. }
  1417. /// <summary>
  1418. /// Gets the collection of associated <see cref="Assignment"/> entity instances.
  1419. /// </summary>
  1420. [Association("Participation_Assignment", "Id", "ParticipationId")]
  1421. [XmlIgnore()]
  1422. public EntityCollection<Assignment> Assignment
  1423. {
  1424. get
  1425. {
  1426. if ((this._assignment == null))
  1427. {
  1428. this._assignment = new EntityCollection<Assignment>(this, "Assignment", this.FilterAssignment, this.AttachAssignment, this.DetachAssignment);
  1429. }
  1430. return this._assignment;
  1431. }
  1432. }
  1433. /// <summary>
  1434. /// Gets or sets the associated <see cref="Course"/> entity.
  1435. /// </summary>
  1436. [Association("Course_Participation", "CourseId", "Id", IsForeignKey=true)]
  1437. [XmlIgnore()]
  1438. public Course Course
  1439. {
  1440. get
  1441. {
  1442. if ((this._course == null))
  1443. {
  1444. this._course = new EntityRef<Course>(this, "Course", this.FilterCourse);
  1445. }
  1446. return this._course.Entity;
  1447. }
  1448. set
  1449. {
  1450. Course previous = this.Course;
  1451. if ((previous != value))
  1452. {
  1453. this.ValidateProperty("Course", value);
  1454. if ((previous != null))
  1455. {
  1456. this._course.Entity = null;
  1457. previous.Participation.Remove(this);
  1458. }
  1459. if ((value != null))
  1460. {
  1461. this.CourseId = value.Id;
  1462. }
  1463. else
  1464. {
  1465. this.CourseId = default(int);
  1466. }
  1467. this._course.Entity = value;
  1468. if ((value != null))
  1469. {
  1470. value.Participation.Add(this);
  1471. }
  1472. this.RaisePropertyChanged("Course");
  1473. }
  1474. }
  1475. }
  1476. /// <summary>
  1477. /// Gets or sets the 'CourseId' value.
  1478. /// </summary>
  1479. [DataMember()]
  1480. [RoundtripOriginal()]
  1481. public int CourseId
  1482. {
  1483. get
  1484. {
  1485. return this._courseId;
  1486. }
  1487. set
  1488. {
  1489. if ((this._courseId != value))
  1490. {
  1491. this.OnCourseIdChanging(value);
  1492. this.RaiseDataMemberChanging("CourseId");
  1493. this.ValidateProperty("CourseId", value);
  1494. this._courseId = value;
  1495. this.RaiseDataMemberChanged("CourseId");
  1496. this.OnCourseIdChanged();
  1497. }
  1498. }
  1499. }
  1500. /// <summary>
  1501. /// Gets or sets the 'Id' value.
  1502. /// </summary>
  1503. [DataMember()]
  1504. [Editable(false, AllowInitialValue=true)]
  1505. [Key()]
  1506. [RoundtripOriginal()]
  1507. public int Id
  1508. {
  1509. get
  1510. {
  1511. return this._id;
  1512. }
  1513. set
  1514. {
  1515. if ((this._id != value))
  1516. {
  1517. this.OnIdChanging(value);
  1518. this.ValidateProperty("Id", value);
  1519. this._id = value;
  1520. this.RaisePropertyChanged("Id");
  1521. this.OnIdChanged();
  1522. }
  1523. }
  1524. }
  1525. /// <summary>
  1526. /// Gets or sets the 'State' value.
  1527. /// </summary>
  1528. [DataMember()]
  1529. public byte[] State
  1530. {
  1531. get
  1532. {
  1533. return this._state;
  1534. }
  1535. set
  1536. {
  1537. if ((this._state != value))
  1538. {
  1539. this.OnStateChanging(value);
  1540. this.RaiseDataMemberChanging("State");
  1541. this.ValidateProperty("State", value);
  1542. this._state = value;
  1543. this.RaiseDataMemberChanged("State");
  1544. this.OnStateChanged();
  1545. }
  1546. }
  1547. }
  1548. /// <summary>
  1549. /// Gets or sets the associated <see cref="User"/> entity.
  1550. /// </summary>
  1551. [Association("User_Participation", "UserId", "Id", IsForeignKey=true)]
  1552. [XmlIgnore()]
  1553. public User User
  1554. {
  1555. get
  1556. {
  1557. if ((this._user == null))
  1558. {
  1559. this._user = new EntityRef<User>(this, "User", this.FilterUser);
  1560. }
  1561. return this._user.Entity;
  1562. }
  1563. set
  1564. {
  1565. User previous = this.User;
  1566. if ((previous != value))
  1567. {
  1568. this.ValidateProperty("User", value);
  1569. if ((previous != null))
  1570. {
  1571. this._user.Entity = null;
  1572. previous.Participation.Remove(this);
  1573. }
  1574. if ((value != null))
  1575. {
  1576. this.UserId = value.Id;
  1577. }
  1578. else
  1579. {
  1580. this.UserId = default(int);
  1581. }
  1582. this._user.Entity = value;
  1583. if ((value != null))
  1584. {
  1585. value.Participation.Add(this);
  1586. }
  1587. this.RaisePropertyChanged("User");
  1588. }
  1589. }
  1590. }
  1591. /// <summary>
  1592. /// Gets or sets the 'UserId' value.
  1593. /// </summary>
  1594. [DataMember()]
  1595. [RoundtripOriginal()]
  1596. public int UserId
  1597. {
  1598. get
  1599. {
  1600. return this._userId;
  1601. }
  1602. set
  1603. {
  1604. if ((this._userId != value))
  1605. {
  1606. this.OnUserIdChanging(value);
  1607. this.RaiseDataMemberChanging("UserId");
  1608. this.ValidateProperty("UserId", value);
  1609. this._userId = value;
  1610. this.RaiseDataMemberChanged("UserId");
  1611. this.OnUserIdChanged();
  1612. }
  1613. }
  1614. }
  1615. private void AttachAssignment(Assignment entity)
  1616. {
  1617. entity.Participation = this;
  1618. }
  1619. private void DetachAssignment(Assignment entity)
  1620. {
  1621. entity.Participation = null;
  1622. }
  1623. private bool FilterAssignment(Assignment entity)
  1624. {
  1625. return (entity.ParticipationId == this.Id);
  1626. }
  1627. private bool FilterCourse(Course entity)
  1628. {
  1629. return (entity.Id == this.CourseId);
  1630. }
  1631. private bool FilterUser(User entity)
  1632. {
  1633. return (entity.Id == this.UserId);
  1634. }
  1635. /// <summary>
  1636. /// Computes a value from the key fields that uniquely identifies this entity instance.
  1637. /// </summary>
  1638. /// <returns>An object instance that uniquely identifies this entity instance.</returns>
  1639. public override object GetIdentity()
  1640. {
  1641. return this._id;
  1642. }
  1643. }
  1644. /// <summary>
  1645. /// The 'Problem' entity class.
  1646. /// </summary>
  1647. [DataContract(Namespace="http://schemas.datacontract.org/2004/07/glados.Web")]
  1648. public sealed partial class Problem : Entity
  1649. {
  1650. private EntityCollection<Assignment> _assignment;
  1651. private string _filePath;
  1652. private Nullable<int> _groupId;
  1653. private int _id;
  1654. private string _name;
  1655. private EntityRef<ProblemGroup> _problemGroup;
  1656. #region Extensibility Method Definitions
  1657. /// <summary>
  1658. /// This method is invoked from the constructor once initialization is complete and
  1659. /// can be used for further object setup.
  1660. /// </summary>
  1661. partial void OnCreated();
  1662. partial void OnFilePathChanging(string value);
  1663. partial void OnFilePathChanged();
  1664. partial void OnGroupIdChanging(Nullable<int> value);
  1665. partial void OnGroupIdChanged();
  1666. partial void OnIdChanging(int value);
  1667. partial void OnIdChanged();
  1668. partial void OnNameChanging(string value);
  1669. partial void OnNameChanged();
  1670. #endregion
  1671. /// <summary>
  1672. /// Initializes a new instance of the <see cref="Problem"/> class.
  1673. /// </summary>
  1674. public Problem()
  1675. {
  1676. this.OnCreated();
  1677. }
  1678. /// <summary>
  1679. /// Gets the collection of associated <see cref="Assignment"/> entity instances.
  1680. /// </summary>
  1681. [Association("Problem_Assignment", "Id", "ProblemId")]
  1682. [XmlIgnore()]
  1683. public EntityCollection<Assignment> Assignment
  1684. {
  1685. get
  1686. {
  1687. if ((this._assignment == null))
  1688. {
  1689. this._assignment = new EntityCollection<Assignment>(this, "Assignment", this.FilterAssignment, this.AttachAssignment, this.DetachAssignment);
  1690. }
  1691. return this._assignment;
  1692. }
  1693. }
  1694. /// <summary>
  1695. /// Gets or sets the 'FilePath' value.
  1696. /// </summary>
  1697. [DataMember()]
  1698. public string FilePath
  1699. {
  1700. get
  1701. {
  1702. return this._filePath;
  1703. }
  1704. set
  1705. {
  1706. if ((this._filePath != value))
  1707. {
  1708. this.OnFilePathChanging(value);
  1709. this.RaiseDataMemberChanging("FilePath");
  1710. this.ValidateProperty("FilePath", value);
  1711. this._filePath = value;
  1712. this.RaiseDataMemberChanged("FilePath");
  1713. this.OnFilePathChanged();
  1714. }
  1715. }
  1716. }
  1717. /// <summary>
  1718. /// Gets or sets the 'GroupId' value.
  1719. /// </summary>
  1720. [DataMember()]
  1721. [RoundtripOriginal()]
  1722. public Nullable<int> GroupId
  1723. {
  1724. get
  1725. {
  1726. return this._groupId;
  1727. }
  1728. set
  1729. {
  1730. if ((this._groupId != value))
  1731. {
  1732. this.OnGroupIdChanging(value);
  1733. this.RaiseDataMemberChanging("GroupId");
  1734. this.ValidateProperty("GroupId", value);
  1735. this._groupId = value;
  1736. this.RaiseDataMemberChanged("GroupId");
  1737. this.OnGroupIdChanged();
  1738. }
  1739. }
  1740. }
  1741. /// <summary>
  1742. /// Gets or sets the 'Id' value.
  1743. /// </summary>
  1744. [DataMember()]
  1745. [Editable(false, AllowInitialValue=true)]
  1746. [Key()]
  1747. [RoundtripOriginal()]
  1748. public int Id
  1749. {
  1750. get
  1751. {
  1752. return this._id;
  1753. }
  1754. set
  1755. {
  1756. if ((this._id != value))
  1757. {
  1758. this.OnIdChanging(value);
  1759. this.ValidateProperty("Id", value);
  1760. this._id = value;
  1761. this.RaisePropertyChanged("Id");
  1762. this.OnIdChanged();
  1763. }
  1764. }
  1765. }
  1766. /// <summary>
  1767. /// Gets or sets the 'Name' value.
  1768. /// </summary>
  1769. [DataMember()]
  1770. [Required()]
  1771. public string Name
  1772. {
  1773. get
  1774. {
  1775. return this._name;
  1776. }
  1777. set
  1778. {
  1779. if ((this._name != value))
  1780. {
  1781. this.OnNameChanging(value);
  1782. this.RaiseDataMemberChanging("Name");
  1783. this.ValidateProperty("Name", value);
  1784. this._name = value;
  1785. this.RaiseDataMemberChanged("Name");
  1786. this.OnNameChanged();
  1787. }
  1788. }
  1789. }
  1790. /// <summary>
  1791. /// Gets or sets the associated <see cref="ProblemGroup"/> entity.
  1792. /// </summary>
  1793. [Association("ProblemGroup_Problem", "GroupId", "Id", IsForeignKey=true)]
  1794. [XmlIgnore()]
  1795. public ProblemGroup ProblemGroup
  1796. {
  1797. get
  1798. {
  1799. if ((this._problemGroup == null))
  1800. {
  1801. this._problemGroup = new EntityRef<ProblemGroup>(this, "ProblemGroup", this.FilterProblemGroup);
  1802. }
  1803. return this._problemGroup.Entity;
  1804. }
  1805. set
  1806. {
  1807. ProblemGroup previous = this.ProblemGroup;
  1808. if ((previous != value))
  1809. {
  1810. this.ValidateProperty("ProblemGroup", value);
  1811. if ((previous != null))
  1812. {
  1813. this._problemGroup.Entity = null;
  1814. previous.Problem.Remove(this);
  1815. }
  1816. if ((value != null))
  1817. {
  1818. this.GroupId = value.Id;
  1819. }
  1820. else
  1821. {
  1822. this.GroupId = default(Nullable<int>);
  1823. }
  1824. this._problemGroup.Entity = value;
  1825. if ((value != null))
  1826. {
  1827. value.Problem.Add(this);
  1828. }
  1829. this.RaisePropertyChanged("ProblemGroup");
  1830. }
  1831. }
  1832. }
  1833. private void AttachAssignment(Assignment entity)
  1834. {
  1835. entity.Problem = this;
  1836. }
  1837. private void DetachAssignment(Assignment entity)
  1838. {
  1839. entity.Problem = null;
  1840. }
  1841. private bool FilterAssignment(Assignment entity)
  1842. {
  1843. return (entity.ProblemId == this.Id);
  1844. }
  1845. private bool FilterProblemGroup(ProblemGroup entity)
  1846. {
  1847. return (entity.Id == this.GroupId);
  1848. }
  1849. /// <summary>
  1850. /// Computes a value from the key fields that uniquely identifies this entity instance.
  1851. /// </summary>
  1852. /// <returns>An object instance that uniquely identifies this entity instance.</returns>
  1853. public override object GetIdentity()
  1854. {
  1855. return this._id;
  1856. }
  1857. }
  1858. /// <summary>
  1859. /// The 'ProblemGroup' entity class.
  1860. /// </summary>
  1861. [DataContract(Namespace="http://schemas.datacontract.org/2004/07/glados.Web")]
  1862. public sealed partial class ProblemGroup : Entity
  1863. {
  1864. private EntityCollection<ProblemGroup> _children;
  1865. private int _id;
  1866. private string _name;
  1867. private EntityRef<ProblemGroup> _parent;
  1868. private Nullable<int> _parentId;
  1869. private EntityCollection<Problem> _problem;
  1870. #region Extensibility Method Definitions
  1871. /// <summary>
  1872. /// This method is invoked from the constructor once initialization is complete and
  1873. /// can be used for further object setup.
  1874. /// </summary>
  1875. partial void OnCreated();
  1876. partial void OnIdChanging(int value);
  1877. partial void OnIdChanged();
  1878. partial void OnNameChanging(string value);
  1879. partial void OnNameChanged();
  1880. partial void OnParentIdChanging(Nullable<int> value);
  1881. partial void OnParentIdChanged();
  1882. #endregion
  1883. /// <summary>
  1884. /// Initializes a new instance of the <see cref="ProblemGroup"/> class.
  1885. /// </summary>
  1886. public ProblemGroup()
  1887. {
  1888. this.OnCreated();
  1889. }
  1890. /// <summary>
  1891. /// Gets the collection of associated <see cref="ProblemGroup"/> entity instances.
  1892. /// </summary>
  1893. [Association("ProblemGroup_ProblemGroup", "Id", "ParentId")]
  1894. [XmlIgnore()]
  1895. public EntityCollection<ProblemGroup> Children
  1896. {
  1897. get
  1898. {
  1899. if ((this._children == null))
  1900. {
  1901. this._children = new EntityCollection<ProblemGroup>(this, "Children", this.FilterChildren, this.AttachChildren, this.DetachChildren);
  1902. }
  1903. return this._children;
  1904. }
  1905. }
  1906. /// <summary>
  1907. /// Gets or sets the 'Id' value.
  1908. /// </summary>
  1909. [DataMember()]
  1910. [Editable(false, AllowInitialValue=true)]
  1911. [Key()]
  1912. [RoundtripOriginal()]
  1913. public int Id
  1914. {
  1915. get
  1916. {
  1917. return this._id;
  1918. }
  1919. set
  1920. {
  1921. if ((this._id != value))
  1922. {
  1923. this.OnIdChanging(value);
  1924. this.ValidateProperty("Id", value);
  1925. this._id = value;
  1926. this.RaisePropertyChanged("Id");
  1927. this.OnIdChanged();
  1928. }
  1929. }
  1930. }
  1931. /// <summary>
  1932. /// Gets or sets the 'Name' value.
  1933. /// </summary>
  1934. [DataMember()]
  1935. [Required()]
  1936. public string Name
  1937. {
  1938. get
  1939. {
  1940. return this._name;
  1941. }
  1942. set
  1943. {
  1944. if ((this._name != value))
  1945. {
  1946. this.OnNameChanging(value);
  1947. this.RaiseDataMemberChanging("Name");
  1948. this.ValidateProperty("Name", value);
  1949. this._name = value;
  1950. this.RaiseDataMemberChanged("Name");
  1951. this.OnNameChanged();
  1952. }
  1953. }
  1954. }
  1955. /// <summary>
  1956. /// Gets or sets the associated <see cref="ProblemGroup"/> entity.
  1957. /// </summary>
  1958. [Association("ProblemGroup_ProblemGroup", "ParentId", "Id", IsForeignKey=true)]
  1959. [XmlIgnore()]
  1960. public ProblemGroup Parent
  1961. {
  1962. get
  1963. {
  1964. if ((this._parent == null))
  1965. {
  1966. this._parent = new EntityRef<ProblemGroup>(this, "Parent", this.FilterParent);
  1967. }
  1968. return this._parent.Entity;
  1969. }
  1970. set
  1971. {
  1972. ProblemGroup previous = this.Parent;
  1973. if ((previous != value))
  1974. {
  1975. this.ValidateProperty("Parent", value);
  1976. if ((previous != null))
  1977. {
  1978. this._parent.Entity = null;
  1979. previous.Children.Remove(this);
  1980. }
  1981. if ((value != null))
  1982. {
  1983. this.ParentId = value.Id;
  1984. }
  1985. else
  1986. {
  1987. this.ParentId = default(Nullable<int>);
  1988. }
  1989. this._parent.Entity = value;
  1990. if ((value != null))
  1991. {
  1992. value.Children.Add(this);
  1993. }
  1994. this.RaisePropertyChanged("Parent");
  1995. }
  1996. }
  1997. }
  1998. /// <summary>
  1999. /// Gets or sets the 'ParentId' value.
  2000. /// </summary>
  2001. [DataMember()]
  2002. [RoundtripOriginal()]
  2003. public Nullable<int> ParentId
  2004. {
  2005. get
  2006. {
  2007. return this._parentId;
  2008. }
  2009. set
  2010. {
  2011. if ((this._parentId != value))
  2012. {
  2013. this.OnParentIdChanging(value);
  2014. this.RaiseDataMemberChanging("ParentId");
  2015. this.ValidateProperty("ParentId", value);
  2016. this._parentId = value;
  2017. this.RaiseDataMemberChanged("ParentId");
  2018. this.OnParentIdChanged();
  2019. }
  2020. }
  2021. }
  2022. /// <summary>
  2023. /// Gets the collection of associated <see cref="Problem"/> entity instances.
  2024. /// </summary>
  2025. [Association("ProblemGroup_Problem", "Id", "GroupId")]
  2026. [XmlIgnore()]
  2027. public EntityCollection<Problem> Problem
  2028. {
  2029. get
  2030. {
  2031. if ((this._problem == null))
  2032. {
  2033. this._problem = new EntityCollection<Problem>(this, "Problem", this.FilterProblem, this.AttachProblem, this.DetachProblem);
  2034. }
  2035. return this._problem;
  2036. }
  2037. }
  2038. private void AttachChildren(ProblemGroup entity)
  2039. {
  2040. entity.Parent = this;
  2041. }
  2042. private void DetachChildren(ProblemGroup entity)
  2043. {
  2044. entity.Parent = null;
  2045. }
  2046. private bool FilterChildren(ProblemGroup entity)
  2047. {
  2048. return (entity.ParentId == this.Id);
  2049. }
  2050. private bool FilterParent(ProblemGroup entity)
  2051. {
  2052. return (entity.Id == this.ParentId);
  2053. }
  2054. private void AttachProblem(Problem entity)
  2055. {
  2056. entity.ProblemGroup = this;
  2057. }
  2058. private void DetachProblem(Problem entity)
  2059. {
  2060. entity.ProblemGroup = null;
  2061. }
  2062. private bool FilterProblem(Problem entity)
  2063. {
  2064. return (entity.GroupId == this.Id);
  2065. }
  2066. /// <summary>
  2067. /// Computes a value from the key fields that uniquely identifies this entity instance.
  2068. /// </summary>
  2069. /// <returns>An object instance that uniquely identifies this entity instance.</returns>
  2070. public override object GetIdentity()
  2071. {
  2072. return this._id;
  2073. }
  2074. }
  2075. /// <summary>
  2076. /// The 'Submission' entity class.
  2077. /// </summary>
  2078. [DataContract(Namespace="http://schemas.datacontract.org/2004/07/glados.Web")]
  2079. public sealed partial class Submission : Entity
  2080. {
  2081. private EntityRef<Assignment> _assignment;
  2082. private int _assignmentId;
  2083. private string _filePath;
  2084. private int _id;
  2085. private string _lang;
  2086. private string _result;
  2087. private DateTime _time;
  2088. #region Extensibility Method Definitions
  2089. /// <summary>
  2090. /// This method is invoked from the constructor once initialization is complete and
  2091. /// can be used for further object setup.
  2092. /// </summary>
  2093. partial void OnCreated();
  2094. partial void OnAssignmentIdChanging(int value);
  2095. partial void OnAssignmentIdChanged();
  2096. partial void OnFilePathChanging(string value);
  2097. partial void OnFilePathChanged();
  2098. partial void OnIdChanging(int value);
  2099. partial void OnIdChanged();
  2100. partial void OnLangChanging(string value);
  2101. partial void OnLangChanged();
  2102. partial void OnResultChanging(string value);
  2103. partial void OnResultChanged();
  2104. partial void OnTimeChanging(DateTime value);
  2105. partial void OnTimeChanged();
  2106. #endregion
  2107. /// <summary>
  2108. /// Initializes a new instance of the <see cref="Submission"/> class.
  2109. /// </summary>
  2110. public Submission()
  2111. {
  2112. this.OnCreated();
  2113. }
  2114. /// <summary>
  2115. /// Gets or sets the associated <see cref="Assignment"/> entity.
  2116. /// </summary>
  2117. [Association("Assignment_Submission", "AssignmentId", "Id", IsForeignKey=true)]
  2118. [XmlIgnore()]
  2119. public Assignment Assignment
  2120. {
  2121. get
  2122. {
  2123. if ((this._assignment == null))
  2124. {
  2125. this._assignment = new EntityRef<Assignment>(this, "Assignment", this.FilterAssignment);
  2126. }
  2127. return this._assignment.Entity;
  2128. }
  2129. set
  2130. {
  2131. Assignment previous = this.Assignment;
  2132. if ((previous != value))
  2133. {
  2134. this.ValidateProperty("Assignment", value);
  2135. if ((previous != null))
  2136. {
  2137. this._assignment.Entity = null;
  2138. previous.Submission.Remove(this);
  2139. }
  2140. if ((value != null))
  2141. {
  2142. this.AssignmentId = value.Id;
  2143. }
  2144. else
  2145. {
  2146. this.AssignmentId = default(int);
  2147. }
  2148. this._assignment.Entity = value;
  2149. if ((value != null))
  2150. {
  2151. value.Submission.Add(this);
  2152. }
  2153. this.RaisePropertyChanged("Assignment");
  2154. }
  2155. }
  2156. }
  2157. /// <summary>
  2158. /// Gets or sets the 'AssignmentId' value.
  2159. /// </summary>
  2160. [DataMember()]
  2161. [RoundtripOriginal()]
  2162. public int AssignmentId
  2163. {
  2164. get
  2165. {
  2166. return this._assignmentId;
  2167. }
  2168. set
  2169. {
  2170. if ((this._assignmentId != value))
  2171. {
  2172. this.OnAssignmentIdChanging(value);
  2173. this.RaiseDataMemberChanging("AssignmentId");
  2174. this.ValidateProperty("AssignmentId", value);
  2175. this._assignmentId = value;
  2176. this.RaiseDataMemberChanged("AssignmentId");
  2177. this.OnAssignmentIdChanged();
  2178. }
  2179. }
  2180. }
  2181. /// <summary>
  2182. /// Gets or sets the 'FilePath' value.
  2183. /// </summary>
  2184. [DataMember()]
  2185. public string FilePath
  2186. {
  2187. get
  2188. {
  2189. return this._filePath;
  2190. }
  2191. set
  2192. {
  2193. if ((this._filePath != value))
  2194. {
  2195. this.OnFilePathChanging(value);
  2196. this.RaiseDataMemberChanging("FilePath");
  2197. this.ValidateProperty("FilePath", value);
  2198. this._filePath = value;
  2199. this.RaiseDataMemberChanged("FilePath");
  2200. this.OnFilePathChanged();
  2201. }
  2202. }
  2203. }
  2204. /// <summary>
  2205. /// Gets or sets the 'Id' value.
  2206. /// </summary>
  2207. [DataMember()]
  2208. [Editable(false, AllowInitialValue=true)]
  2209. [Key()]
  2210. [RoundtripOriginal()]
  2211. public int Id
  2212. {
  2213. get
  2214. {
  2215. return this._id;
  2216. }
  2217. set
  2218. {
  2219. if ((this._id != value))
  2220. {
  2221. this.OnIdChanging(value);
  2222. this.ValidateProperty("Id", value);
  2223. this._id = value;
  2224. this.RaisePropertyChanged("Id");
  2225. this.OnIdChanged();
  2226. }
  2227. }
  2228. }
  2229. /// <summary>
  2230. /// Gets or sets the 'Lang' value.
  2231. /// </summary>
  2232. [DataMember()]
  2233. public string Lang
  2234. {
  2235. get
  2236. {
  2237. return this._lang;
  2238. }
  2239. set
  2240. {
  2241. if ((this._lang != value))
  2242. {
  2243. this.OnLangChanging(value);
  2244. this.RaiseDataMemberChanging("Lang");
  2245. this.ValidateProperty("Lang", value);
  2246. this._lang = value;
  2247. this.RaiseDataMemberChanged("Lang");
  2248. this.OnLangChanged();
  2249. }
  2250. }
  2251. }
  2252. /// <summary>
  2253. /// Gets or sets the 'Result' value.
  2254. /// </summary>
  2255. [DataMember()]
  2256. [Required()]
  2257. public string Result
  2258. {
  2259. get
  2260. {
  2261. return this._result;
  2262. }
  2263. set
  2264. {
  2265. if ((this._result != value))
  2266. {
  2267. this.OnResultChanging(value);
  2268. this.RaiseDataMemberChanging("Result");
  2269. this.ValidateProperty("Result", value);
  2270. this._result = value;
  2271. this.RaiseDataMemberChanged("Result");
  2272. this.OnResultChanged();
  2273. }
  2274. }
  2275. }
  2276. /// <summary>
  2277. /// Gets or sets the 'Time' value.
  2278. /// </summary>
  2279. [DataMember()]
  2280. public DateTime Time
  2281. {
  2282. get
  2283. {
  2284. return this._time;
  2285. }
  2286. set
  2287. {
  2288. if ((this._time != value))
  2289. {
  2290. this.OnTimeChanging(value);
  2291. this.RaiseDataMemberChanging("Time");
  2292. this.ValidateProperty("Time", value);
  2293. this._time = value;
  2294. this.RaiseDataMemberChanged("Time");
  2295. this.OnTimeChanged();
  2296. }
  2297. }
  2298. }
  2299. private bool FilterAssignment(Assignment entity)
  2300. {
  2301. return (entity.Id == this.AssignmentId);
  2302. }
  2303. /// <summary>
  2304. /// Computes a value from the key fields that uniquely identifies this entity instance.
  2305. /// </summary>
  2306. /// <returns>An object instance that uniquely identifies this entity instance.</returns>
  2307. public override object GetIdentity()
  2308. {
  2309. return this._id;
  2310. }
  2311. }
  2312. /// <summary>
  2313. /// The 'User' entity class.
  2314. /// </summary>
  2315. [DataContract(Namespace="http://schemas.datacontract.org/2004/07/glados.Web")]
  2316. public sealed partial class User : Entity
  2317. {
  2318. private int _id;
  2319. private EntityCollection<Membership> _membership;
  2320. private string _name;
  2321. private EntityCollection<Participation> _participation;
  2322. private string _password;
  2323. #region Extensibility Method Definitions
  2324. /// <summary>
  2325. /// This method is invoked from the constructor once initialization is complete and
  2326. /// can be used for further object setup.
  2327. /// </summary>
  2328. partial void OnCreated();
  2329. partial void OnIdChanging(int value);
  2330. partial void OnIdChanged();
  2331. partial void OnNameChanging(string value);
  2332. partial void OnNameChanged();
  2333. partial void OnPasswordChanging(string value);
  2334. partial void OnPasswordChanged();
  2335. #endregion
  2336. /// <summary>
  2337. /// Initializes a new instance of the <see cref="User"/> class.
  2338. /// </summary>
  2339. public User()
  2340. {
  2341. this.OnCreated();
  2342. }
  2343. /// <summary>
  2344. /// Gets or sets the 'Id' value.
  2345. /// </summary>
  2346. [DataMember()]
  2347. [Editable(false, AllowInitialValue=true)]
  2348. [Key()]
  2349. [RoundtripOriginal()]
  2350. public int Id
  2351. {
  2352. get
  2353. {
  2354. return this._id;
  2355. }
  2356. set
  2357. {
  2358. if ((this._id != value))
  2359. {
  2360. this.OnIdChanging(value);
  2361. this.ValidateProperty("Id", value);
  2362. this._id = value;
  2363. this.RaisePropertyChanged("Id");
  2364. this.OnIdChanged();
  2365. }
  2366. }
  2367. }
  2368. /// <summary>
  2369. /// Gets the collection of associated <see cref="Membership"/> entity instances.
  2370. /// </summary>
  2371. [Association("User_Membership", "Id", "UserId")]
  2372. [XmlIgnore()]
  2373. public EntityCollection<Membership> Membership
  2374. {
  2375. get
  2376. {
  2377. if ((this._membership == null))
  2378. {
  2379. this._membership = new EntityCollection<Membership>(this, "Membership", this.FilterMembership, this.AttachMembership, this.DetachMembership);
  2380. }
  2381. return this._membership;
  2382. }
  2383. }
  2384. /// <summary>
  2385. /// Gets or sets the 'Name' value.
  2386. /// </summary>
  2387. [DataMember()]
  2388. [Required()]
  2389. public string Name
  2390. {
  2391. get
  2392. {
  2393. return this._name;
  2394. }
  2395. set
  2396. {
  2397. if ((this._name != value))
  2398. {
  2399. this.OnNameChanging(value);
  2400. this.RaiseDataMemberChanging("Name");
  2401. this.ValidateProperty("Name", value);
  2402. this._name = value;
  2403. this.RaiseDataMemberChanged("Name");
  2404. this.OnNameChanged();
  2405. }
  2406. }
  2407. }
  2408. /// <summary>
  2409. /// Gets the collection of associated <see cref="Participation"/> entity instances.
  2410. /// </summary>
  2411. [Association("User_Participation", "Id", "UserId")]
  2412. [XmlIgnore()]
  2413. public EntityCollection<Participation> Participation
  2414. {
  2415. get
  2416. {
  2417. if ((this._participation == null))
  2418. {
  2419. this._participation = new EntityCollection<Participation>(this, "Participation", this.FilterParticipation, this.AttachParticipation, this.DetachParticipation);
  2420. }
  2421. return this._participation;
  2422. }
  2423. }
  2424. /// <summary>
  2425. /// Gets or sets the 'Password' value.
  2426. /// </summary>
  2427. [DataMember()]
  2428. [Required()]
  2429. public string Password
  2430. {
  2431. get
  2432. {
  2433. return this._password;
  2434. }
  2435. set
  2436. {
  2437. if ((this._password != value))
  2438. {
  2439. this.OnPasswordChanging(value);
  2440. this.RaiseDataMemberChanging("Password");
  2441. this.ValidateProperty("Password", value);
  2442. this._password = value;
  2443. this.RaiseDataMemberChanged("Password");
  2444. this.OnPasswordChanged();
  2445. }
  2446. }
  2447. }
  2448. private void AttachMembership(Membership entity)
  2449. {
  2450. entity.User = this;
  2451. }
  2452. private void DetachMembership(Membership entity)
  2453. {
  2454. entity.User = null;
  2455. }
  2456. private bool FilterMembership(Membership entity)
  2457. {
  2458. return (entity.UserId == this.Id);
  2459. }
  2460. private void AttachParticipation(Participation entity)
  2461. {
  2462. entity.User = this;
  2463. }
  2464. private void DetachParticipation(Participation entity)
  2465. {
  2466. entity.User = null;
  2467. }
  2468. private bool FilterParticipation(Participation entity)
  2469. {
  2470. return (entity.UserId == this.Id);
  2471. }
  2472. /// <summary>
  2473. /// Computes a value from the key fields that uniquely identifies this entity instance.
  2474. /// </summary>
  2475. /// <returns>An object instance that uniquely identifies this entity instance.</returns>
  2476. public override object GetIdentity()
  2477. {
  2478. return this._id;
  2479. }
  2480. }
  2481. }
  2482. namespace glados.Web.Logic
  2483. {
  2484. using System;
  2485. using System.Collections.Generic;
  2486. using System.ComponentModel;
  2487. using System.ComponentModel.DataAnnotations;
  2488. using System.Linq;
  2489. using System.Runtime.Serialization;
  2490. using System.ServiceModel.DomainServices;
  2491. using System.ServiceModel.DomainServices.Client;
  2492. using System.ServiceModel.DomainServices.Client.ApplicationServices;
  2493. /// <summary>
  2494. /// The 'CourseTopic' class.
  2495. /// </summary>
  2496. [DataContract(Namespace="http://schemas.datacontract.org/2004/07/glados.Web.Logic")]
  2497. public sealed partial class CourseTopic : ComplexObject
  2498. {
  2499. #region Extensibility Method Definitions
  2500. /// <summary>
  2501. /// This method is invoked from the constructor once initialization is complete and
  2502. /// can be used for further object setup.
  2503. /// </summary>
  2504. partial void OnCreated();
  2505. #endregion
  2506. /// <summary>
  2507. /// Initializes a new instance of the <see cref="CourseTopic"/> class.
  2508. /// </summary>
  2509. public CourseTopic()
  2510. {
  2511. this.OnCreated();
  2512. }
  2513. }
  2514. }
  2515. namespace glados.Web.Logic.Base
  2516. {
  2517. using System;
  2518. using System.Collections.Generic;
  2519. using System.ComponentModel;
  2520. using System.ComponentModel.DataAnnotations;
  2521. using System.Linq;
  2522. using System.Runtime.Serialization;
  2523. using System.ServiceModel.DomainServices;
  2524. using System.ServiceModel.DomainServices.Client;
  2525. using System.ServiceModel.DomainServices.Client.ApplicationServices;
  2526. /// <summary>
  2527. /// The 'ParticipantState' class.
  2528. /// </summary>
  2529. [DataContract(Namespace="http://schemas.datacontract.org/2004/07/glados.Web.Logic.Base")]
  2530. public sealed partial class ParticipantState : ComplexObject
  2531. {
  2532. #region Extensibility Method Definitions
  2533. /// <summary>
  2534. /// This method is invoked from the constructor once initialization is complete and
  2535. /// can be used for further object setup.
  2536. /// </summary>
  2537. partial void OnCreated();
  2538. #endregion
  2539. /// <summary>
  2540. /// Initializes a new instance of the <see cref="ParticipantState"/> class.
  2541. /// </summary>
  2542. public ParticipantState()
  2543. {
  2544. this.OnCreated();
  2545. }
  2546. }
  2547. }
  2548. namespace glados.Web.Services
  2549. {
  2550. using System;
  2551. using System.Collections.Generic;
  2552. using System.ComponentModel;
  2553. using System.ComponentModel.DataAnnotations;
  2554. using System.Linq;
  2555. using System.ServiceModel;
  2556. using System.ServiceModel.DomainServices;
  2557. using System.ServiceModel.DomainServices.Client;
  2558. using System.ServiceModel.DomainServices.Client.ApplicationServices;
  2559. using System.ServiceModel.Web;
  2560. using glados.Web;
  2561. using glados.Web.Services.Entities;
  2562. /// <summary>
  2563. /// The DomainContext corresponding to the 'MessageService' DomainService.
  2564. /// </summary>
  2565. public sealed partial class MessageContext : DomainContext
  2566. {
  2567. #region Extensibility Method Definitions
  2568. /// <summary>
  2569. /// This method is invoked from the constructor once initialization is complete and
  2570. /// can be used for further object setup.
  2571. /// </summary>
  2572. partial void OnCreated();
  2573. #endregion
  2574. /// <summary>
  2575. /// Initializes a new instance of the <see cref="MessageContext"/> class.
  2576. /// </summary>
  2577. public MessageContext() :
  2578. this(new WebDomainClient<IMessageServiceContract>(new Uri("glados-Web-Services-MessageService.svc", UriKind.Relative)))
  2579. {
  2580. }
  2581. /// <summary>
  2582. /// Initializes a new instance of the <see cref="MessageContext"/> class with the specified service URI.
  2583. /// </summary>
  2584. /// <param name="serviceUri">The MessageService service URI.</param>
  2585. public MessageContext(Uri serviceUri) :
  2586. this(new WebDomainClient<IMessageServiceContract>(serviceUri))
  2587. {
  2588. }
  2589. /// <summary>
  2590. /// Initializes a new instance of the <see cref="MessageContext"/> class with the specified <paramref name="domainClient"/>.
  2591. /// </summary>
  2592. /// <param name="domainClient">The DomainClient instance to use for this DomainContext.</param>
  2593. public MessageContext(DomainClient domainClient) :
  2594. base(domainClient)
  2595. {
  2596. this.OnCreated();
  2597. }
  2598. /// <summary>
  2599. /// Gets the set of <see cref="Message"/> entity instances that have been loaded into this <see cref="MessageContext"/> instance.
  2600. /// </summary>
  2601. public EntitySet<Message> Messages
  2602. {
  2603. get
  2604. {
  2605. return base.EntityContainer.GetEntitySet<Message>();
  2606. }
  2607. }
  2608. /// <summary>
  2609. /// Gets an EntityQuery instance that can be used to load <see cref="Message"/> entity instances using the 'GetMessageById' query.
  2610. /// </summary>
  2611. /// <param name="id">The value for the 'id' parameter of the query.</param>
  2612. /// <returns>An EntityQuery that can be loaded to retrieve <see cref="Message"/> entity instances.</returns>
  2613. public EntityQuery<Message> GetMessageByIdQuery(int id)
  2614. {
  2615. Dictionary<string, object> parameters = new Dictionary<string, object>();
  2616. parameters.Add("id", id);
  2617. this.ValidateMethod("GetMessageByIdQuery", parameters);
  2618. return base.CreateQuery<Message>("GetMessageById", parameters, false, false);
  2619. }
  2620. /// <summary>
  2621. /// Gets an EntityQuery instance that can be used to load <see cref="Message"/> entity instances using the 'GetMessages' query.
  2622. /// </summary>
  2623. /// <returns>An EntityQuery that can be loaded to retrieve <see cref="Message"/> entity instances.</returns>
  2624. public EntityQuery<Message> GetMessagesQuery()
  2625. {
  2626. this.ValidateMethod("GetMessagesQuery", null);
  2627. return base.CreateQuery<Message>("GetMessages", null, false, true);
  2628. }
  2629. /// <summary>
  2630. /// Gets an EntityQuery instance that can be used to load <see cref="Message"/> entity instances using the 'GetMyReceivedMessages' query.
  2631. /// </summary>
  2632. /// <returns>An EntityQuery that can be loaded to retrieve <see cref="Message"/> entity instances.</returns>
  2633. public EntityQuery<Message> GetMyReceivedMessagesQuery()
  2634. {
  2635. this.ValidateMethod("GetMyReceivedMessagesQuery", null);
  2636. return base.CreateQuery<Message>("GetMyReceivedMessages", null, false, true);
  2637. }
  2638. /// <summary>
  2639. /// Gets an EntityQuery instance that can be used to load <see cref="Message"/> entity instances using the 'GetMySentMessages' query.
  2640. /// </summary>
  2641. /// <returns>An EntityQuery that can be loaded to retrieve <see cref="Message"/> entity instances.</returns>
  2642. public EntityQuery<Message> GetMySentMessagesQuery()
  2643. {
  2644. this.ValidateMethod("GetMySentMessagesQuery", null);
  2645. return base.CreateQuery<Message>("GetMySentMessages", null, false, true);
  2646. }
  2647. /// <summary>
  2648. /// Creates a new EntityContainer for this DomainContext's EntitySets.
  2649. /// </summary>
  2650. /// <returns>A new container instance.</returns>
  2651. protected override EntityContainer CreateEntityContainer()
  2652. {
  2653. return new MessageContextEntityContainer();
  2654. }
  2655. /// <summary>
  2656. /// Service contract for the 'MessageService' DomainService.
  2657. /// </summary>
  2658. [ServiceContract()]
  2659. public interface IMessageServiceContract
  2660. {
  2661. /// <summary>
  2662. /// Asynchronously invokes the 'GetMessageById' operation.
  2663. /// </summary>
  2664. /// <param name="id">The value for the 'id' parameter of this action.</param>
  2665. /// <param name="callback">Callback to invoke on completion.</param>
  2666. /// <param name="asyncState">Optional state object.</param>
  2667. /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
  2668. [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/MessageService/GetMessageByIdDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
  2669. [OperationContract(AsyncPattern=true, Action="http://tempuri.org/MessageService/GetMessageById", ReplyAction="http://tempuri.org/MessageService/GetMessageByIdResponse")]
  2670. [WebGet()]
  2671. IAsyncResult BeginGetMessageById(int id, AsyncCallback callback, object asyncState);
  2672. /// <summary>
  2673. /// Completes the asynchronous operation begun by 'BeginGetMessageById'.
  2674. /// </summary>
  2675. /// <param name="result">The IAsyncResult returned from 'BeginGetMessageById'.</param>
  2676. /// <returns>The 'QueryResult' returned from the 'GetMessageById' operation.</returns>
  2677. QueryResult<Message> EndGetMessageById(IAsyncResult result);
  2678. /// <summary>
  2679. /// Asynchronously invokes the 'GetMessages' operation.
  2680. /// </summary>
  2681. /// <param name="callback">Callback to invoke on completion.</param>
  2682. /// <param name="asyncState">Optional state object.</param>
  2683. /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
  2684. [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/MessageService/GetMessagesDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
  2685. [OperationContract(AsyncPattern=true, Action="http://tempuri.org/MessageService/GetMessages", ReplyAction="http://tempuri.org/MessageService/GetMessagesResponse")]
  2686. [WebGet()]
  2687. IAsyncResult BeginGetMessages(AsyncCallback callback, object asyncState);
  2688. /// <summary>
  2689. /// Completes the asynchronous operation begun by 'BeginGetMessages'.
  2690. /// </summary>
  2691. /// <param name="result">The IAsyncResult returned from 'BeginGetMessages'.</param>
  2692. /// <returns>The 'QueryResult' returned from the 'GetMessages' operation.</returns>
  2693. QueryResult<Message> EndGetMessages(IAsyncResult result);
  2694. /// <summary>
  2695. /// Asynchronously invokes the 'GetMyReceivedMessages' operation.
  2696. /// </summary>
  2697. /// <param name="callback">Callback to invoke on completion.</param>
  2698. /// <param name="asyncState">Optional state object.</param>
  2699. /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
  2700. [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/MessageService/GetMyReceivedMessagesDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
  2701. [OperationContract(AsyncPattern=true, Action="http://tempuri.org/MessageService/GetMyReceivedMessages", ReplyAction="http://tempuri.org/MessageService/GetMyReceivedMessagesResponse")]
  2702. [WebGet()]
  2703. IAsyncResult BeginGetMyReceivedMessages(AsyncCallback callback, object asyncState);
  2704. /// <summary>
  2705. /// Completes the asynchronous operation begun by 'BeginGetMyReceivedMessages'.
  2706. /// </summary>
  2707. /// <param name="result">The IAsyncResult returned from 'BeginGetMyReceivedMessages'.</param>
  2708. /// <returns>The 'QueryResult' returned from the 'GetMyReceivedMessages' operation.</returns>
  2709. QueryResult<Message> EndGetMyReceivedMessages(IAsyncResult result);
  2710. /// <summary>
  2711. /// Asynchronously invokes the 'GetMySentMessages' operation.
  2712. /// </summary>
  2713. /// <param name="callback">Callback to invoke on completion.</param>
  2714. /// <param name="asyncState">Optional state object.</param>
  2715. /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
  2716. [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/MessageService/GetMySentMessagesDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
  2717. [OperationContract(AsyncPattern=true, Action="http://tempuri.org/MessageService/GetMySentMessages", ReplyAction="http://tempuri.org/MessageService/GetMySentMessagesResponse")]
  2718. [WebGet()]
  2719. IAsyncResult BeginGetMySentMessages(AsyncCallback callback, object asyncState);
  2720. /// <summary>
  2721. /// Completes the asynchronous operation begun by 'BeginGetMySentMessages'.
  2722. /// </summary>
  2723. /// <param name="result">The IAsyncResult returned from 'BeginGetMySentMessages'.</param>
  2724. /// <returns>The 'QueryResult' returned from the 'GetMySentMessages' operation.</returns>
  2725. QueryResult<Message> EndGetMySentMessages(IAsyncResult result);
  2726. /// <summary>
  2727. /// Asynchronously invokes the 'SubmitChanges' operation.
  2728. /// </summary>
  2729. /// <param name="changeSet">The change-set to submit.</param>
  2730. /// <param name="callback">Callback to invoke on completion.</param>
  2731. /// <param name="asyncState">Optional state object.</param>
  2732. /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
  2733. [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/MessageService/SubmitChangesDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
  2734. [OperationContract(AsyncPattern=true, Action="http://tempuri.org/MessageService/SubmitChanges", ReplyAction="http://tempuri.org/MessageService/SubmitChangesResponse")]
  2735. IAsyncResult BeginSubmitChanges(IEnumerable<ChangeSetEntry> changeSet, AsyncCallback callback, object asyncState);
  2736. /// <summary>
  2737. /// Completes the asynchronous operation begun by 'BeginSubmitChanges'.
  2738. /// </summary>
  2739. /// <param name="result">The IAsyncResult returned from 'BeginSubmitChanges'.</param>
  2740. /// <returns>The collection of change-set entry elements returned from 'SubmitChanges'.</returns>
  2741. IEnumerable<ChangeSetEntry> EndSubmitChanges(IAsyncResult result);
  2742. }
  2743. internal sealed class MessageContextEntityContainer : EntityContainer
  2744. {
  2745. public MessageContextEntityContainer()
  2746. {
  2747. this.CreateEntitySet<Message>(EntitySetOperations.All);
  2748. }
  2749. }
  2750. }
  2751. /// <summary>
  2752. /// The DomainContext corresponding to the 'StatusService' DomainService.
  2753. /// </summary>
  2754. public sealed partial class StatusContext : DomainContext
  2755. {
  2756. #region Extensibility Method Definitions
  2757. /// <summary>
  2758. /// This method is invoked from the constructor once initialization is complete and
  2759. /// can be used for further object setup.
  2760. /// </summary>
  2761. partial void OnCreated();
  2762. #endregion
  2763. /// <summary>
  2764. /// Initializes a new instance of the <see cref="StatusContext"/> class.
  2765. /// </summary>
  2766. public StatusContext() :
  2767. this(new WebDomainClient<IStatusServiceContract>(new Uri("glados-Web-Services-StatusService.svc", UriKind.Relative)))
  2768. {
  2769. }
  2770. /// <summary>
  2771. /// Initializes a new instance of the <see cref="StatusContext"/> class with the specified service URI.
  2772. /// </summary>
  2773. /// <param name="serviceUri">The StatusService service URI.</param>
  2774. public StatusContext(Uri serviceUri) :
  2775. this(new WebDomainClient<IStatusServiceContract>(serviceUri))
  2776. {
  2777. }
  2778. /// <summary>
  2779. /// Initializes a new instance of the <see cref="StatusContext"/> class with the specified <paramref name="domainClient"/>.
  2780. /// </summary>
  2781. /// <param name="domainClient">The DomainClient instance to use for this DomainContext.</param>
  2782. public StatusContext(DomainClient domainClient) :
  2783. base(domainClient)
  2784. {
  2785. this.OnCreated();
  2786. }
  2787. /// <summary>
  2788. /// Gets the set of <see cref="TestingMachineEntity"/> entity instances that have been loaded into this <see cref="StatusContext"/> instance.
  2789. /// </summary>
  2790. public EntitySet<TestingMachineEntity> TestingMachineEntities
  2791. {
  2792. get
  2793. {
  2794. return base.EntityContainer.GetEntitySet<TestingMachineEntity>();
  2795. }
  2796. }
  2797. /// <summary>
  2798. /// Gets an EntityQuery instance that can be used to load <see cref="TestingMachineEntity"/> entity instances using the 'GetTesterStatus' query.
  2799. /// </summary>
  2800. /// <returns>An EntityQuery that can be loaded to retrieve <see cref="TestingMachineEntity"/> entity instances.</returns>
  2801. public EntityQuery<TestingMachineEntity> GetTesterStatusQuery()
  2802. {
  2803. this.ValidateMethod("GetTesterStatusQuery", null);
  2804. return base.CreateQuery<TestingMachineEntity>("GetTesterStatus", null, false, true);
  2805. }
  2806. /// <summary>
  2807. /// Asynchronously invokes the 'ReloadProblemsIntoDb' method of the DomainService.
  2808. /// </summary>
  2809. /// <param name="callback">Callback to invoke when the operation completes.</param>
  2810. /// <param name="userState">Value to pass to the callback. It can be <c>null</c>.</param>
  2811. /// <returns>An operation instance that can be used to manage the asynchronous request.</returns>
  2812. public InvokeOperation ReloadProblemsIntoDb(Action<InvokeOperation> callback, object userState)
  2813. {
  2814. this.ValidateMethod("ReloadProblemsIntoDb", null);
  2815. return this.InvokeOperation("ReloadProblemsIntoDb", typeof(void), null, true, callback, userState);
  2816. }
  2817. /// <summary>
  2818. /// Asynchronously invokes the 'ReloadProblemsIntoDb' method of the DomainService.
  2819. /// </summary>
  2820. /// <returns>An operation instance that can be used to manage the asynchronous request.</returns>
  2821. public InvokeOperation ReloadProblemsIntoDb()
  2822. {
  2823. this.ValidateMethod("ReloadProblemsIntoDb", null);
  2824. return this.InvokeOperation("ReloadProblemsIntoDb", typeof(void), null, true, null, null);
  2825. }
  2826. /// <summary>
  2827. /// Asynchronously invokes the 'RetestSubmission' method of the DomainService.
  2828. /// </summary>
  2829. /// <param name="id">The value for the 'id' parameter of this action.</param>
  2830. /// <param name="callback">Callback to invoke when the operation completes.</param>
  2831. /// <param name="userState">Value to pass to the callback. It can be <c>null</c>.</param>
  2832. /// <returns>An operation instance that can be used to manage the asynchronous request.</returns>
  2833. public InvokeOperation RetestSubmission(int id, Action<InvokeOperation> callback, object userState)
  2834. {
  2835. Dictionary<string, object> parameters = new Dictionary<string, object>();
  2836. parameters.Add("id", id);
  2837. this.ValidateMethod("RetestSubmission", parameters);
  2838. return this.InvokeOperation("RetestSubmission", typeof(void), parameters, true, callback, userState);
  2839. }
  2840. /// <summary>
  2841. /// Asynchronously invokes the 'RetestSubmission' method of the DomainService.
  2842. /// </summary>
  2843. /// <param name="id">The value for the 'id' parameter of this action.</param>
  2844. /// <returns>An operation instance that can be used to manage the asynchronous request.</returns>
  2845. public InvokeOperation RetestSubmission(int id)
  2846. {
  2847. Dictionary<string, object> parameters = new Dictionary<string, object>();
  2848. parameters.Add("id", id);
  2849. this.ValidateMethod("RetestSubmission", parameters);
  2850. return this.InvokeOperation("RetestSubmission", typeof(void), parameters, true, null, null);
  2851. }
  2852. /// <summary>
  2853. /// Creates a new EntityContainer for this DomainContext's EntitySets.
  2854. /// </summary>
  2855. /// <returns>A new container instance.</returns>
  2856. protected override EntityContainer CreateEntityContainer()
  2857. {
  2858. return new StatusContextEntityContainer();
  2859. }
  2860. /// <summary>
  2861. /// Service contract for the 'StatusService' DomainService.
  2862. /// </summary>
  2863. [ServiceContract()]
  2864. public interface IStatusServiceContract
  2865. {
  2866. /// <summary>
  2867. /// Asynchronously invokes the 'GetTesterStatus' operation.
  2868. /// </summary>
  2869. /// <param name="callback">Callback to invoke on completion.</param>
  2870. /// <param name="asyncState">Optional state object.</param>
  2871. /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
  2872. [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/StatusService/GetTesterStatusDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
  2873. [OperationContract(AsyncPattern=true, Action="http://tempuri.org/StatusService/GetTesterStatus", ReplyAction="http://tempuri.org/StatusService/GetTesterStatusResponse")]
  2874. [WebGet()]
  2875. IAsyncResult BeginGetTesterStatus(AsyncCallback callback, object asyncState);
  2876. /// <summary>
  2877. /// Completes the asynchronous operation begun by 'BeginGetTesterStatus'.
  2878. /// </summary>
  2879. /// <param name="result">The IAsyncResult returned from 'BeginGetTesterStatus'.</param>
  2880. /// <returns>The 'QueryResult' returned from the 'GetTesterStatus' operation.</returns>
  2881. QueryResult<TestingMachineEntity> EndGetTesterStatus(IAsyncResult result);
  2882. /// <summary>
  2883. /// Asynchronously invokes the 'ReloadProblemsIntoDb' operation.
  2884. /// </summary>
  2885. /// <param name="callback">Callback to invoke on completion.</param>
  2886. /// <param name="asyncState">Optional state object.</param>
  2887. /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
  2888. [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/StatusService/ReloadProblemsIntoDbDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
  2889. [OperationContract(AsyncPattern=true, Action="http://tempuri.org/StatusService/ReloadProblemsIntoDb", ReplyAction="http://tempuri.org/StatusService/ReloadProblemsIntoDbResponse")]
  2890. IAsyncResult BeginReloadProblemsIntoDb(AsyncCallback callback, object asyncState);
  2891. /// <summary>
  2892. /// Completes the asynchronous operation begun by 'BeginReloadProblemsIntoDb'.
  2893. /// </summary>
  2894. /// <param name="result">The IAsyncResult returned from 'BeginReloadProblemsIntoDb'.</param>
  2895. void EndReloadProblemsIntoDb(IAsyncResult result);
  2896. /// <summary>
  2897. /// Asynchronously invokes the 'RetestSubmission' operation.
  2898. /// </summary>
  2899. /// <param name="id">The value for the 'id' parameter of this action.</param>
  2900. /// <param name="callback">Callback to invoke on completion.</param>
  2901. /// <param name="asyncState">Optional state object.</param>
  2902. /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
  2903. [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/StatusService/RetestSubmissionDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
  2904. [OperationContract(AsyncPattern=true, Action="http://tempuri.org/StatusService/RetestSubmission", ReplyAction="http://tempuri.org/StatusService/RetestSubmissionResponse")]
  2905. IAsyncResult BeginRetestSubmission(int id, AsyncCallback callback, object asyncState);
  2906. /// <summary>
  2907. /// Completes the asynchronous operation begun by 'BeginRetestSubmission'.
  2908. /// </summary>
  2909. /// <param name="result">The IAsyncResult returned from 'BeginRetestSubmission'.</param>
  2910. void EndRetestSubmission(IAsyncResult result);
  2911. }
  2912. internal sealed class StatusContextEntityContainer : EntityContainer
  2913. {
  2914. public StatusContextEntityContainer()
  2915. {
  2916. this.CreateEntitySet<TestingMachineEntity>(EntitySetOperations.None);
  2917. }
  2918. }
  2919. }
  2920. /// <summary>
  2921. /// The DomainContext corresponding to the 'TaskStructureService' DomainService.
  2922. /// </summary>
  2923. public sealed partial class TaskStructureContext : DomainContext
  2924. {
  2925. #region Extensibility Method Definitions
  2926. /// <summary>
  2927. /// This method is invoked from the constructor once initialization is complete and
  2928. /// can be used for further object setup.
  2929. /// </summary>
  2930. partial void OnCreated();
  2931. #endregion
  2932. /// <summary>
  2933. /// Initializes a new instance of the <see cref="TaskStructureContext"/> class.
  2934. /// </summary>
  2935. public TaskStructureContext() :
  2936. this(new WebDomainClient<ITaskStructureServiceContract>(new Uri("glados-Web-Services-TaskStructureService.svc", UriKind.Relative)))
  2937. {
  2938. }
  2939. /// <summary>
  2940. /// Initializes a new instance of the <see cref="TaskStructureContext"/> class with the specified service URI.
  2941. /// </summary>
  2942. /// <param name="serviceUri">The TaskStructureService service URI.</param>
  2943. public TaskStructureContext(Uri serviceUri) :
  2944. this(new WebDomainClient<ITaskStructureServiceContract>(serviceUri))
  2945. {
  2946. }
  2947. /// <summary>
  2948. /// Initializes a new instance of the <see cref="TaskStructureContext"/> class with the specified <paramref name="domainClient"/>.
  2949. /// </summary>
  2950. /// <param name="domainClient">The DomainClient instance to use for this DomainContext.</param>
  2951. public TaskStructureContext(DomainClient domainClient) :
  2952. base(domainClient)
  2953. {
  2954. this.OnCreated();
  2955. }
  2956. /// <summary>
  2957. /// Gets the set of <see cref="Assignment"/> entity instances that have been loaded into this <see cref="TaskStructureContext"/> instance.
  2958. /// </summary>
  2959. public EntitySet<Assignment> Assignments
  2960. {
  2961. get
  2962. {
  2963. return base.EntityContainer.GetEntitySet<Assignment>();
  2964. }
  2965. }
  2966. /// <summary>
  2967. /// Gets the set of <see cref="Course"/> entity instances that have been loaded into this <see cref="TaskStructureContext"/> instance.
  2968. /// </summary>
  2969. public EntitySet<Course> Courses
  2970. {
  2971. get
  2972. {
  2973. return base.EntityContainer.GetEntitySet<Course>();
  2974. }
  2975. }
  2976. /// <summary>
  2977. /// Gets the set of <see cref="Group"/> entity instances that have been loaded into this <see cref="TaskStructureContext"/> instance.
  2978. /// </summary>
  2979. public EntitySet<Group> Groups
  2980. {
  2981. get
  2982. {
  2983. return base.EntityContainer.GetEntitySet<Group>();
  2984. }
  2985. }
  2986. /// <summary>
  2987. /// Gets the set of <see cref="Membership"/> entity instances that have been loaded into this <see cref="TaskStructureContext"/> instance.
  2988. /// </summary>
  2989. public EntitySet<Membership> Memberships
  2990. {
  2991. get
  2992. {
  2993. return base.EntityContainer.GetEntitySet<Membership>();
  2994. }
  2995. }
  2996. /// <summary>
  2997. /// Gets the set of <see cref="Participation"/> entity instances that have been loaded into this <see cref="TaskStructureContext"/> instance.
  2998. /// </summary>
  2999. public EntitySet<Participation> Participations
  3000. {
  3001. get
  3002. {
  3003. return base.EntityContainer.GetEntitySet<Participation>();
  3004. }
  3005. }
  3006. /// <summary>
  3007. /// Gets the set of <see cref="ProblemGroup"/> entity instances that have been loaded into this <see cref="TaskStructureContext"/> instance.
  3008. /// </summary>
  3009. public EntitySet<ProblemGroup> ProblemGroups
  3010. {
  3011. get
  3012. {
  3013. return base.EntityContainer.GetEntitySet<ProblemGroup>();
  3014. }
  3015. }
  3016. /// <summary>
  3017. /// Gets the set of <see cref="Problem"/> entity instances that have been loaded into this <see cref="TaskStructureContext"/> instance.
  3018. /// </summary>
  3019. public EntitySet<Problem> Problems
  3020. {
  3021. get
  3022. {
  3023. return base.EntityContainer.GetEntitySet<Problem>();
  3024. }
  3025. }
  3026. /// <summary>
  3027. /// Gets the set of <see cref="Submission"/> entity instances that have been loaded into this <see cref="TaskStructureContext"/> instance.
  3028. /// </summary>
  3029. public EntitySet<Submission> Submissions
  3030. {
  3031. get
  3032. {
  3033. return base.EntityContainer.GetEntitySet<Submission>();
  3034. }
  3035. }
  3036. /// <summary>
  3037. /// Gets the set of <see cref="User"/> entity instances that have been loaded into this <see cref="TaskStructureContext"/> instance.
  3038. /// </summary>
  3039. public EntitySet<User> Users
  3040. {
  3041. get
  3042. {
  3043. return base.EntityContainer.GetEntitySet<User>();
  3044. }
  3045. }
  3046. /// <summary>
  3047. /// Gets an EntityQuery instance that can be used to load <see cref="Assignment"/> entity instances using the 'GetAssignmentSet' query.
  3048. /// </summary>
  3049. /// <returns>An EntityQuery that can be loaded to retrieve <see cref="Assignment"/> entity instances.</returns>
  3050. public EntityQuery<Assignment> GetAssignmentSetQuery()
  3051. {
  3052. this.ValidateMethod("GetAssignmentSetQuery", null);
  3053. return base.CreateQuery<Assignment>("GetAssignmentSet", null, false, true);
  3054. }
  3055. /// <summary>
  3056. /// Gets an EntityQuery instance that can be used to load <see cref="Assignment"/> entity instances using the 'GetAssignmentsForMe' query.
  3057. /// </summary>
  3058. /// <returns>An EntityQuery that can be loaded to retrieve <see cref="Assignment"/> entity instances.</returns>
  3059. public EntityQuery<Assignment> GetAssignmentsForMeQuery()
  3060. {
  3061. this.ValidateMethod("GetAssignmentsForMeQuery", null);
  3062. return base.CreateQuery<Assignment>("GetAssignmentsForMe", null, false, true);
  3063. }
  3064. /// <summary>
  3065. /// Gets an EntityQuery instance that can be used to load <see cref="Course"/> entity instances using the 'GetCourseSet' query.
  3066. /// </summary>
  3067. /// <returns>An EntityQuery that can be loaded to retrieve <see cref="Course"/> entity instances.</returns>
  3068. public EntityQuery<Course> GetCourseSetQuery()
  3069. {
  3070. this.ValidateMethod("GetCourseSetQuery", null);
  3071. return base.CreateQuery<Course>("GetCourseSet", null, false, true);
  3072. }
  3073. /// <summary>
  3074. /// Gets an EntityQuery instance that can be used to load <see cref="Group"/> entity instances using the 'GetGroupSet' query.
  3075. /// </summary>
  3076. /// <returns>An EntityQuery that can be loaded to retrieve <see cref="Group"/> entity instances.</returns>
  3077. public EntityQuery<Group> GetGroupSetQuery()
  3078. {
  3079. this.ValidateMethod("GetGroupSetQuery", null);
  3080. return base.CreateQuery<Group>("GetGroupSet", null, false, true);
  3081. }
  3082. /// <summary>
  3083. /// Gets an EntityQuery instance that can be used to load <see cref="Membership"/> entity instances using the 'GetMembershipSet' query.
  3084. /// </summary>
  3085. /// <returns>An EntityQuery that can be loaded to retrieve <see cref="Membership"/> entity instances.</returns>
  3086. public EntityQuery<Membership> GetMembershipSetQuery()
  3087. {
  3088. this.ValidateMethod("GetMembershipSetQuery", null);
  3089. return base.CreateQuery<Membership>("GetMembershipSet", null, false, true);
  3090. }
  3091. /// <summary>
  3092. /// Gets an EntityQuery instance that can be used to load <see cref="Participation"/> entity instances using the 'GetParticipationSet' query.
  3093. /// </summary>
  3094. /// <returns>An EntityQuery that can be loaded to retrieve <see cref="Participation"/> entity instances.</returns>
  3095. public EntityQuery<Participation> GetParticipationSetQuery()
  3096. {
  3097. this.ValidateMethod("GetParticipationSetQuery", null);
  3098. return base.CreateQuery<Participation>("GetParticipationSet", null, false, true);
  3099. }
  3100. /// <summary>
  3101. /// Gets an EntityQuery instance that can be used to load <see cref="ProblemGroup"/> entity instances using the 'GetProblemGroupSet' query.
  3102. /// </summary>
  3103. /// <returns>An EntityQuery that can be loaded to retrieve <see cref="ProblemGroup"/> entity instances.</returns>
  3104. public EntityQuery<ProblemGroup> GetProblemGroupSetQuery()
  3105. {
  3106. this.ValidateMethod("GetProblemGroupSetQuery", null);
  3107. return base.CreateQuery<ProblemGroup>("GetProblemGroupSet", null, false, true);
  3108. }
  3109. /// <summary>
  3110. /// Gets an EntityQuery instance that can be used to load <see cref="Problem"/> entity instances using the 'GetProblemSet' query.
  3111. /// </summary>
  3112. /// <returns>An EntityQuery that can be loaded to retrieve <see cref="Problem"/> entity instances.</returns>
  3113. public EntityQuery<Problem> GetProblemSetQuery()
  3114. {
  3115. this.ValidateMethod("GetProblemSetQuery", null);
  3116. return base.CreateQuery<Problem>("GetProblemSet", null, false, true);
  3117. }
  3118. /// <summary>
  3119. /// Gets an EntityQuery instance that can be used to load <see cref="Problem"/> entity instances using the 'GetProblemSetByGroupId' query.
  3120. /// </summary>
  3121. /// <param name="id">The value for the 'id' parameter of the query.</param>
  3122. /// <returns>An EntityQuery that can be loaded to retrieve <see cref="Problem"/> entity instances.</returns>
  3123. public EntityQuery<Problem> GetProblemSetByGroupIdQuery(int id)
  3124. {
  3125. Dictionary<string, object> parameters = new Dictionary<string, object>();
  3126. parameters.Add("id", id);
  3127. this.ValidateMethod("GetProblemSetByGroupIdQuery", parameters);
  3128. return base.CreateQuery<Problem>("GetProblemSetByGroupId", parameters, false, true);
  3129. }
  3130. /// <summary>
  3131. /// Gets an EntityQuery instance that can be used to load <see cref="Submission"/> entity instances using the 'GetSubmissionSet' query.
  3132. /// </summary>
  3133. /// <returns>An EntityQuery that can be loaded to retrieve <see cref="Submission"/> entity instances.</returns>
  3134. public EntityQuery<Submission> GetSubmissionSetQuery()
  3135. {
  3136. this.ValidateMethod("GetSubmissionSetQuery", null);
  3137. return base.CreateQuery<Submission>("GetSubmissionSet", null, false, true);
  3138. }
  3139. /// <summary>
  3140. /// Gets an EntityQuery instance that can be used to load <see cref="User"/> entity instances using the 'GetUsers' query.
  3141. /// </summary>
  3142. /// <returns>An EntityQuery that can be loaded to retrieve <see cref="User"/> entity instances.</returns>
  3143. public EntityQuery<User> GetUsersQuery()
  3144. {
  3145. this.ValidateMethod("GetUsersQuery", null);
  3146. return base.CreateQuery<User>("GetUsers", null, false, true);
  3147. }
  3148. /// <summary>
  3149. /// Creates a new EntityContainer for this DomainContext's EntitySets.
  3150. /// </summary>
  3151. /// <returns>A new container instance.</returns>
  3152. protected override EntityContainer CreateEntityContainer()
  3153. {
  3154. return new TaskStructureContextEntityContainer();
  3155. }
  3156. /// <summary>
  3157. /// Service contract for the 'TaskStructureService' DomainService.
  3158. /// </summary>
  3159. [ServiceContract()]
  3160. public interface ITaskStructureServiceContract
  3161. {
  3162. /// <summary>
  3163. /// Asynchronously invokes the 'GetAssignmentSet' operation.
  3164. /// </summary>
  3165. /// <param name="callback">Callback to invoke on completion.</param>
  3166. /// <param name="asyncState">Optional state object.</param>
  3167. /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
  3168. [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/TaskStructureService/GetAssignmentSetDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
  3169. [OperationContract(AsyncPattern=true, Action="http://tempuri.org/TaskStructureService/GetAssignmentSet", ReplyAction="http://tempuri.org/TaskStructureService/GetAssignmentSetResponse")]
  3170. [WebGet()]
  3171. IAsyncResult BeginGetAssignmentSet(AsyncCallback callback, object asyncState);
  3172. /// <summary>
  3173. /// Completes the asynchronous operation begun by 'BeginGetAssignmentSet'.
  3174. /// </summary>
  3175. /// <param name="result">The IAsyncResult returned from 'BeginGetAssignmentSet'.</param>
  3176. /// <returns>The 'QueryResult' returned from the 'GetAssignmentSet' operation.</returns>
  3177. QueryResult<Assignment> EndGetAssignmentSet(IAsyncResult result);
  3178. /// <summary>
  3179. /// Asynchronously invokes the 'GetAssignmentsForMe' operation.
  3180. /// </summary>
  3181. /// <param name="callback">Callback to invoke on completion.</param>
  3182. /// <param name="asyncState">Optional state object.</param>
  3183. /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
  3184. [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/TaskStructureService/GetAssignmentsForMeDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
  3185. [OperationContract(AsyncPattern=true, Action="http://tempuri.org/TaskStructureService/GetAssignmentsForMe", ReplyAction="http://tempuri.org/TaskStructureService/GetAssignmentsForMeResponse")]
  3186. [WebGet()]
  3187. IAsyncResult BeginGetAssignmentsForMe(AsyncCallback callback, object asyncState);
  3188. /// <summary>
  3189. /// Completes the asynchronous operation begun by 'BeginGetAssignmentsForMe'.
  3190. /// </summary>
  3191. /// <param name="result">The IAsyncResult returned from 'BeginGetAssignmentsForMe'.</param>
  3192. /// <returns>The 'QueryResult' returned from the 'GetAssignmentsForMe' operation.</returns>
  3193. QueryResult<Assignment> EndGetAssignmentsForMe(IAsyncResult result);
  3194. /// <summary>
  3195. /// Asynchronously invokes the 'GetCourseSet' operation.
  3196. /// </summary>
  3197. /// <param name="callback">Callback to invoke on completion.</param>
  3198. /// <param name="asyncState">Optional state object.</param>
  3199. /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
  3200. [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/TaskStructureService/GetCourseSetDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
  3201. [OperationContract(AsyncPattern=true, Action="http://tempuri.org/TaskStructureService/GetCourseSet", ReplyAction="http://tempuri.org/TaskStructureService/GetCourseSetResponse")]
  3202. [WebGet()]
  3203. IAsyncResult BeginGetCourseSet(AsyncCallback callback, object asyncState);
  3204. /// <summary>
  3205. /// Completes the asynchronous operation begun by 'BeginGetCourseSet'.
  3206. /// </summary>
  3207. /// <param name="result">The IAsyncResult returned from 'BeginGetCourseSet'.</param>
  3208. /// <returns>The 'QueryResult' returned from the 'GetCourseSet' operation.</returns>
  3209. QueryResult<Course> EndGetCourseSet(IAsyncResult result);
  3210. /// <summary>
  3211. /// Asynchronously invokes the 'GetGroupSet' operation.
  3212. /// </summary>
  3213. /// <param name="callback">Callback to invoke on completion.</param>
  3214. /// <param name="asyncState">Optional state object.</param>
  3215. /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
  3216. [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/TaskStructureService/GetGroupSetDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
  3217. [OperationContract(AsyncPattern=true, Action="http://tempuri.org/TaskStructureService/GetGroupSet", ReplyAction="http://tempuri.org/TaskStructureService/GetGroupSetResponse")]
  3218. [WebGet()]
  3219. IAsyncResult BeginGetGroupSet(AsyncCallback callback, object asyncState);
  3220. /// <summary>
  3221. /// Completes the asynchronous operation begun by 'BeginGetGroupSet'.
  3222. /// </summary>
  3223. /// <param name="result">The IAsyncResult returned from 'BeginGetGroupSet'.</param>
  3224. /// <returns>The 'QueryResult' returned from the 'GetGroupSet' operation.</returns>
  3225. QueryResult<Group> EndGetGroupSet(IAsyncResult result);
  3226. /// <summary>
  3227. /// Asynchronously invokes the 'GetMembershipSet' operation.
  3228. /// </summary>
  3229. /// <param name="callback">Callback to invoke on completion.</param>
  3230. /// <param name="asyncState">Optional state object.</param>
  3231. /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
  3232. [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/TaskStructureService/GetMembershipSetDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
  3233. [OperationContract(AsyncPattern=true, Action="http://tempuri.org/TaskStructureService/GetMembershipSet", ReplyAction="http://tempuri.org/TaskStructureService/GetMembershipSetResponse")]
  3234. [WebGet()]
  3235. IAsyncResult BeginGetMembershipSet(AsyncCallback callback, object asyncState);
  3236. /// <summary>
  3237. /// Completes the asynchronous operation begun by 'BeginGetMembershipSet'.
  3238. /// </summary>
  3239. /// <param name="result">The IAsyncResult returned from 'BeginGetMembershipSet'.</param>
  3240. /// <returns>The 'QueryResult' returned from the 'GetMembershipSet' operation.</returns>
  3241. QueryResult<Membership> EndGetMembershipSet(IAsyncResult result);
  3242. /// <summary>
  3243. /// Asynchronously invokes the 'GetParticipationSet' operation.
  3244. /// </summary>
  3245. /// <param name="callback">Callback to invoke on completion.</param>
  3246. /// <param name="asyncState">Optional state object.</param>
  3247. /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
  3248. [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/TaskStructureService/GetParticipationSetDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
  3249. [OperationContract(AsyncPattern=true, Action="http://tempuri.org/TaskStructureService/GetParticipationSet", ReplyAction="http://tempuri.org/TaskStructureService/GetParticipationSetResponse")]
  3250. [WebGet()]
  3251. IAsyncResult BeginGetParticipationSet(AsyncCallback callback, object asyncState);
  3252. /// <summary>
  3253. /// Completes the asynchronous operation begun by 'BeginGetParticipationSet'.
  3254. /// </summary>
  3255. /// <param name="result">The IAsyncResult returned from 'BeginGetParticipationSet'.</param>
  3256. /// <returns>The 'QueryResult' returned from the 'GetParticipationSet' operation.</returns>
  3257. QueryResult<Participation> EndGetParticipationSet(IAsyncResult result);
  3258. /// <summary>
  3259. /// Asynchronously invokes the 'GetProblemGroupSet' operation.
  3260. /// </summary>
  3261. /// <param name="callback">Callback to invoke on completion.</param>
  3262. /// <param name="asyncState">Optional state object.</param>
  3263. /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
  3264. [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/TaskStructureService/GetProblemGroupSetDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
  3265. [OperationContract(AsyncPattern=true, Action="http://tempuri.org/TaskStructureService/GetProblemGroupSet", ReplyAction="http://tempuri.org/TaskStructureService/GetProblemGroupSetResponse")]
  3266. [WebGet()]
  3267. IAsyncResult BeginGetProblemGroupSet(AsyncCallback callback, object asyncState);
  3268. /// <summary>
  3269. /// Completes the asynchronous operation begun by 'BeginGetProblemGroupSet'.
  3270. /// </summary>
  3271. /// <param name="result">The IAsyncResult returned from 'BeginGetProblemGroupSet'.</param>
  3272. /// <returns>The 'QueryResult' returned from the 'GetProblemGroupSet' operation.</returns>
  3273. QueryResult<ProblemGroup> EndGetProblemGroupSet(IAsyncResult result);
  3274. /// <summary>
  3275. /// Asynchronously invokes the 'GetProblemSet' operation.
  3276. /// </summary>
  3277. /// <param name="callback">Callback to invoke on completion.</param>
  3278. /// <param name="asyncState">Optional state object.</param>
  3279. /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
  3280. [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/TaskStructureService/GetProblemSetDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
  3281. [OperationContract(AsyncPattern=true, Action="http://tempuri.org/TaskStructureService/GetProblemSet", ReplyAction="http://tempuri.org/TaskStructureService/GetProblemSetResponse")]
  3282. [WebGet()]
  3283. IAsyncResult BeginGetProblemSet(AsyncCallback callback, object asyncState);
  3284. /// <summary>
  3285. /// Completes the asynchronous operation begun by 'BeginGetProblemSet'.
  3286. /// </summary>
  3287. /// <param name="result">The IAsyncResult returned from 'BeginGetProblemSet'.</param>
  3288. /// <returns>The 'QueryResult' returned from the 'GetProblemSet' operation.</returns>
  3289. QueryResult<Problem> EndGetProblemSet(IAsyncResult result);
  3290. /// <summary>
  3291. /// Asynchronously invokes the 'GetProblemSetByGroupId' operation.
  3292. /// </summary>
  3293. /// <param name="id">The value for the 'id' parameter of this action.</param>
  3294. /// <param name="callback">Callback to invoke on completion.</param>
  3295. /// <param name="asyncState">Optional state object.</param>
  3296. /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
  3297. [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/TaskStructureService/GetProblemSetByGroupIdDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
  3298. [OperationContract(AsyncPattern=true, Action="http://tempuri.org/TaskStructureService/GetProblemSetByGroupId", ReplyAction="http://tempuri.org/TaskStructureService/GetProblemSetByGroupIdResponse")]
  3299. [WebGet()]
  3300. IAsyncResult BeginGetProblemSetByGroupId(int id, AsyncCallback callback, object asyncState);
  3301. /// <summary>
  3302. /// Completes the asynchronous operation begun by 'BeginGetProblemSetByGroupId'.
  3303. /// </summary>
  3304. /// <param name="result">The IAsyncResult returned from 'BeginGetProblemSetByGroupId'.</param>
  3305. /// <returns>The 'QueryResult' returned from the 'GetProblemSetByGroupId' operation.</returns>
  3306. QueryResult<Problem> EndGetProblemSetByGroupId(IAsyncResult result);
  3307. /// <summary>
  3308. /// Asynchronously invokes the 'GetSubmissionSet' operation.
  3309. /// </summary>
  3310. /// <param name="callback">Callback to invoke on completion.</param>
  3311. /// <param name="asyncState">Optional state object.</param>
  3312. /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
  3313. [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/TaskStructureService/GetSubmissionSetDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
  3314. [OperationContract(AsyncPattern=true, Action="http://tempuri.org/TaskStructureService/GetSubmissionSet", ReplyAction="http://tempuri.org/TaskStructureService/GetSubmissionSetResponse")]
  3315. [WebGet()]
  3316. IAsyncResult BeginGetSubmissionSet(AsyncCallback callback, object asyncState);
  3317. /// <summary>
  3318. /// Completes the asynchronous operation begun by 'BeginGetSubmissionSet'.
  3319. /// </summary>
  3320. /// <param name="result">The IAsyncResult returned from 'BeginGetSubmissionSet'.</param>
  3321. /// <returns>The 'QueryResult' returned from the 'GetSubmissionSet' operation.</returns>
  3322. QueryResult<Submission> EndGetSubmissionSet(IAsyncResult result);
  3323. /// <summary>
  3324. /// Asynchronously invokes the 'GetUsers' operation.
  3325. /// </summary>
  3326. /// <param name="callback">Callback to invoke on completion.</param>
  3327. /// <param name="asyncState">Optional state object.</param>
  3328. /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
  3329. [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/TaskStructureService/GetUsersDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
  3330. [OperationContract(AsyncPattern=true, Action="http://tempuri.org/TaskStructureService/GetUsers", ReplyAction="http://tempuri.org/TaskStructureService/GetUsersResponse")]
  3331. [WebGet()]
  3332. IAsyncResult BeginGetUsers(AsyncCallback callback, object asyncState);
  3333. /// <summary>
  3334. /// Completes the asynchronous operation begun by 'BeginGetUsers'.
  3335. /// </summary>
  3336. /// <param name="result">The IAsyncResult returned from 'BeginGetUsers'.</param>
  3337. /// <returns>The 'QueryResult' returned from the 'GetUsers' operation.</returns>
  3338. QueryResult<User> EndGetUsers(IAsyncResult result);
  3339. /// <summary>
  3340. /// Asynchronously invokes the 'SubmitChanges' operation.
  3341. /// </summary>
  3342. /// <param name="changeSet">The change-set to submit.</param>
  3343. /// <param name="callback">Callback to invoke on completion.</param>
  3344. /// <param name="asyncState">Optional state object.</param>
  3345. /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
  3346. [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/TaskStructureService/SubmitChangesDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
  3347. [OperationContract(AsyncPattern=true, Action="http://tempuri.org/TaskStructureService/SubmitChanges", ReplyAction="http://tempuri.org/TaskStructureService/SubmitChangesResponse")]
  3348. IAsyncResult BeginSubmitChanges(IEnumerable<ChangeSetEntry> changeSet, AsyncCallback callback, object asyncState);
  3349. /// <summary>
  3350. /// Completes the asynchronous operation begun by 'BeginSubmitChanges'.
  3351. /// </summary>
  3352. /// <param name="result">The IAsyncResult returned from 'BeginSubmitChanges'.</param>
  3353. /// <returns>The collection of change-set entry elements returned from 'SubmitChanges'.</returns>
  3354. IEnumerable<ChangeSetEntry> EndSubmitChanges(IAsyncResult result);
  3355. }
  3356. internal sealed class TaskStructureContextEntityContainer : EntityContainer
  3357. {
  3358. public TaskStructureContextEntityContainer()
  3359. {
  3360. this.CreateEntitySet<Assignment>(EntitySetOperations.All);
  3361. this.CreateEntitySet<Course>(EntitySetOperations.All);
  3362. this.CreateEntitySet<Group>(EntitySetOperations.All);
  3363. this.CreateEntitySet<Membership>(EntitySetOperations.All);
  3364. this.CreateEntitySet<Participation>(EntitySetOperations.All);
  3365. this.CreateEntitySet<Problem>(EntitySetOperations.All);
  3366. this.CreateEntitySet<ProblemGroup>(EntitySetOperations.All);
  3367. this.CreateEntitySet<Submission>(EntitySetOperations.All);
  3368. this.CreateEntitySet<User>(EntitySetOperations.All);
  3369. }
  3370. }
  3371. }
  3372. }
  3373. namespace glados.Web.Services.Entities
  3374. {
  3375. using System;
  3376. using System.Collections.Generic;
  3377. using System.ComponentModel;
  3378. using System.ComponentModel.DataAnnotations;
  3379. using System.Linq;
  3380. using System.Runtime.Serialization;
  3381. using System.ServiceModel.DomainServices;
  3382. using System.ServiceModel.DomainServices.Client;
  3383. using System.ServiceModel.DomainServices.Client.ApplicationServices;
  3384. using System.Xml.Serialization;
  3385. using Glados.TestingModule.Interfaces;
  3386. using glados.Web.Logic;
  3387. /// <summary>
  3388. /// The 'AssignmentState' class.
  3389. /// </summary>
  3390. [DataContract(Namespace="http://schemas.datacontract.org/2004/07/glados.Web.Services.Entities")]
  3391. public sealed partial class AssignmentState : ComplexObject
  3392. {
  3393. private string _state;
  3394. private string _task;
  3395. private string _topic;
  3396. #region Extensibility Method Definitions
  3397. /// <summary>
  3398. /// This method is invoked from the constructor once initialization is complete and
  3399. /// can be used for further object setup.
  3400. /// </summary>
  3401. partial void OnCreated();
  3402. partial void OnStateChanging(string value);
  3403. partial void OnStateChanged();
  3404. partial void OnTaskChanging(string value);
  3405. partial void OnTaskChanged();
  3406. partial void OnTopicChanging(string value);
  3407. partial void OnTopicChanged();
  3408. #endregion
  3409. /// <summary>
  3410. /// Initializes a new instance of the <see cref="AssignmentState"/> class.
  3411. /// </summary>
  3412. public AssignmentState()
  3413. {
  3414. this.OnCreated();
  3415. }
  3416. /// <summary>
  3417. /// Gets or sets the 'State' value.
  3418. /// </summary>
  3419. [DataMember()]
  3420. public string State
  3421. {
  3422. get
  3423. {
  3424. return this._state;
  3425. }
  3426. set
  3427. {
  3428. if ((this._state != value))
  3429. {
  3430. this.OnStateChanging(value);
  3431. this.RaiseDataMemberChanging("State");
  3432. this.ValidateProperty("State", value);
  3433. this._state = value;
  3434. this.RaiseDataMemberChanged("State");
  3435. this.OnStateChanged();
  3436. }
  3437. }
  3438. }
  3439. /// <summary>
  3440. /// Gets or sets the 'Task' value.
  3441. /// </summary>
  3442. [DataMember()]
  3443. public string Task
  3444. {
  3445. get
  3446. {
  3447. return this._task;
  3448. }
  3449. set
  3450. {
  3451. if ((this._task != value))
  3452. {
  3453. this.OnTaskChanging(value);
  3454. this.RaiseDataMemberChanging("Task");
  3455. this.ValidateProperty("Task", value);
  3456. this._task = value;
  3457. this.RaiseDataMemberChanged("Task");
  3458. this.OnTaskChanged();
  3459. }
  3460. }
  3461. }
  3462. /// <summary>
  3463. /// Gets or sets the 'Topic' value.
  3464. /// </summary>
  3465. [DataMember()]
  3466. public string Topic
  3467. {
  3468. get
  3469. {
  3470. return this._topic;
  3471. }
  3472. set
  3473. {
  3474. if ((this._topic != value))
  3475. {
  3476. this.OnTopicChanging(value);
  3477. this.RaiseDataMemberChanging("Topic");
  3478. this.ValidateProperty("Topic", value);
  3479. this._topic = value;
  3480. this.RaiseDataMemberChanged("Topic");
  3481. this.OnTopicChanged();
  3482. }
  3483. }
  3484. }
  3485. }
  3486. /// <summary>
  3487. /// The 'CourseDashboardInfo' class.
  3488. /// </summary>
  3489. [DataContract(Namespace="http://schemas.datacontract.org/2004/07/glados.Web.Services.Entities")]
  3490. public sealed partial class CourseDashboardInfo : ComplexObject
  3491. {
  3492. private CourseParticipantClientState[] _participants;
  3493. private CourseTopic[] _topics;
  3494. #region Extensibility Method Definitions
  3495. /// <summary>
  3496. /// This method is invoked from the constructor once initialization is complete and
  3497. /// can be used for further object setup.
  3498. /// </summary>
  3499. partial void OnCreated();
  3500. partial void OnParticipantsChanging(CourseParticipantClientState[] value);
  3501. partial void OnParticipantsChanged();
  3502. partial void OnTopicsChanging(CourseTopic[] value);
  3503. partial void OnTopicsChanged();
  3504. #endregion
  3505. /// <summary>
  3506. /// Initializes a new instance of the <see cref="CourseDashboardInfo"/> class.
  3507. /// </summary>
  3508. public CourseDashboardInfo()
  3509. {
  3510. this.OnCreated();
  3511. }
  3512. /// <summary>
  3513. /// Gets or sets the 'Participants' value.
  3514. /// </summary>
  3515. [DataMember()]
  3516. [Display(AutoGenerateField=false)]
  3517. public CourseParticipantClientState[] Participants
  3518. {
  3519. get
  3520. {
  3521. return this._participants;
  3522. }
  3523. set
  3524. {
  3525. if ((this._participants != value))
  3526. {
  3527. this.OnParticipantsChanging(value);
  3528. this.RaiseDataMemberChanging("Participants");
  3529. this.ValidateProperty("Participants", value);
  3530. this._participants = value;
  3531. this.RaiseDataMemberChanged("Participants");
  3532. this.OnParticipantsChanged();
  3533. }
  3534. }
  3535. }
  3536. /// <summary>
  3537. /// Gets or sets the 'Topics' value.
  3538. /// </summary>
  3539. [DataMember()]
  3540. [Display(AutoGenerateField=false)]
  3541. public CourseTopic[] Topics
  3542. {
  3543. get
  3544. {
  3545. return this._topics;
  3546. }
  3547. set
  3548. {
  3549. if ((this._topics != value))
  3550. {
  3551. this.OnTopicsChanging(value);
  3552. this.RaiseDataMemberChanging("Topics");
  3553. this.ValidateProperty("Topics", value);
  3554. this._topics = value;
  3555. this.RaiseDataMemberChanged("Topics");
  3556. this.OnTopicsChanged();
  3557. }
  3558. }
  3559. }
  3560. }
  3561. /// <summary>
  3562. /// The 'CourseParticipantClientState' class.
  3563. /// </summary>
  3564. [DataContract(Namespace="http://schemas.datacontract.org/2004/07/glados.Web.Services.Entities")]
  3565. public sealed partial class CourseParticipantClientState : ComplexObject
  3566. {
  3567. private AssignmentState[] _assignments;
  3568. private int _id;
  3569. private string _name;
  3570. #region Extensibility Method Definitions
  3571. /// <summary>
  3572. /// This method is invoked from the constructor once initialization is complete and
  3573. /// can be used for further object setup.
  3574. /// </summary>
  3575. partial void OnCreated();
  3576. partial void OnAssignmentsChanging(AssignmentState[] value);
  3577. partial void OnAssignmentsChanged();
  3578. partial void OnIdChanging(int value);
  3579. partial void OnIdChanged();
  3580. partial void OnNameChanging(string value);
  3581. partial void OnNameChanged();
  3582. #endregion
  3583. /// <summary>
  3584. /// Initializes a new instance of the <see cref="CourseParticipantClientState"/> class.
  3585. /// </summary>
  3586. public CourseParticipantClientState()
  3587. {
  3588. this.OnCreated();
  3589. }
  3590. /// <summary>
  3591. /// Gets or sets the 'Assignments' value.
  3592. /// </summary>
  3593. [DataMember()]
  3594. [Display(AutoGenerateField=false)]
  3595. public AssignmentState[] Assignments
  3596. {
  3597. get
  3598. {
  3599. return this._assignments;
  3600. }
  3601. set
  3602. {
  3603. if ((this._assignments != value))
  3604. {
  3605. this.OnAssignmentsChanging(value);
  3606. this.RaiseDataMemberChanging("Assignments");
  3607. this.ValidateProperty("Assignments", value);
  3608. this._assignments = value;
  3609. this.RaiseDataMemberChanged("Assignments");
  3610. this.OnAssignmentsChanged();
  3611. }
  3612. }
  3613. }
  3614. /// <summary>
  3615. /// Gets or sets the 'Id' value.
  3616. /// </summary>
  3617. [DataMember()]
  3618. public int Id
  3619. {
  3620. get
  3621. {
  3622. return this._id;
  3623. }
  3624. set
  3625. {
  3626. if ((this._id != value))
  3627. {
  3628. this.OnIdChanging(value);
  3629. this.RaiseDataMemberChanging("Id");
  3630. this.ValidateProperty("Id", value);
  3631. this._id = value;
  3632. this.RaiseDataMemberChanged("Id");
  3633. this.OnIdChanged();
  3634. }
  3635. }
  3636. }
  3637. /// <summary>
  3638. /// Gets or sets the 'Name' value.
  3639. /// </summary>
  3640. [DataMember()]
  3641. public string Name
  3642. {
  3643. get
  3644. {
  3645. return this._name;
  3646. }
  3647. set
  3648. {
  3649. if ((this._name != value))
  3650. {
  3651. this.OnNameChanging(value);
  3652. this.RaiseDataMemberChanging("Name");
  3653. this.ValidateProperty("Name", value);
  3654. this._name = value;
  3655. this.RaiseDataMemberChanged("Name");
  3656. this.OnNameChanged();
  3657. }
  3658. }
  3659. }
  3660. }
  3661. /// <summary>
  3662. /// The 'ParticipantAssignment' class.
  3663. /// </summary>
  3664. [DataContract(Namespace="http://schemas.datacontract.org/2004/07/glados.Web.Services.Entities")]
  3665. public sealed partial class ParticipantAssignment : ComplexObject
  3666. {
  3667. private bool _assigned;
  3668. private int _participantId;
  3669. private string _participantName;
  3670. #region Extensibility Method Definitions
  3671. /// <summary>
  3672. /// This method is invoked from the constructor once initialization is complete and
  3673. /// can be used for further object setup.
  3674. /// </summary>
  3675. partial void OnCreated();
  3676. partial void OnAssignedChanging(bool value);
  3677. partial void OnAssignedChanged();
  3678. partial void OnParticipantIdChanging(int value);
  3679. partial void OnParticipantIdChanged();
  3680. partial void OnParticipantNameChanging(string value);
  3681. partial void OnParticipantNameChanged();
  3682. #endregion
  3683. /// <summary>
  3684. /// Initializes a new instance of the <see cref="ParticipantAssignment"/> class.
  3685. /// </summary>
  3686. public ParticipantAssignment()
  3687. {
  3688. this.OnCreated();
  3689. }
  3690. /// <summary>
  3691. /// Gets or sets the 'Assigned' value.
  3692. /// </summary>
  3693. [DataMember()]
  3694. public bool Assigned
  3695. {
  3696. get
  3697. {
  3698. return this._assigned;
  3699. }
  3700. set
  3701. {
  3702. if ((this._assigned != value))
  3703. {
  3704. this.OnAssignedChanging(value);
  3705. this.RaiseDataMemberChanging("Assigned");
  3706. this.ValidateProperty("Assigned", value);
  3707. this._assigned = value;
  3708. this.RaiseDataMemberChanged("Assigned");
  3709. this.OnAssignedChanged();
  3710. }
  3711. }
  3712. }
  3713. /// <summary>
  3714. /// Gets or sets the 'ParticipantId' value.
  3715. /// </summary>
  3716. [DataMember()]
  3717. public int ParticipantId
  3718. {
  3719. get
  3720. {
  3721. return this._participantId;
  3722. }
  3723. set
  3724. {
  3725. if ((this._participantId != value))
  3726. {
  3727. this.OnParticipantIdChanging(value);
  3728. this.RaiseDataMemberChanging("ParticipantId");
  3729. this.ValidateProperty("ParticipantId", value);
  3730. this._participantId = value;
  3731. this.RaiseDataMemberChanged("ParticipantId");
  3732. this.OnParticipantIdChanged();
  3733. }
  3734. }
  3735. }
  3736. /// <summary>
  3737. /// Gets or sets the 'ParticipantName' value.
  3738. /// </summary>
  3739. [DataMember()]
  3740. public string ParticipantName
  3741. {
  3742. get
  3743. {
  3744. return this._participantName;
  3745. }
  3746. set
  3747. {
  3748. if ((this._participantName != value))
  3749. {
  3750. this.OnParticipantNameChanging(value);
  3751. this.RaiseDataMemberChanging("ParticipantName");
  3752. this.ValidateProperty("ParticipantName", value);
  3753. this._participantName = value;
  3754. this.RaiseDataMemberChanged("ParticipantName");
  3755. this.OnParticipantNameChanged();
  3756. }
  3757. }
  3758. }
  3759. }
  3760. /// <summary>
  3761. /// The 'ProblemDetails' class.
  3762. /// </summary>
  3763. [DataContract(Namespace="http://schemas.datacontract.org/2004/07/glados.Web.Services.Entities")]
  3764. [XmlRoot(ElementName="task")]
  3765. public sealed partial class ProblemDetails : ComplexObject
  3766. {
  3767. private string[] _compilers;
  3768. private int _id;
  3769. private string _name;
  3770. private string _statementPath;
  3771. private TestingInformation _testingInformation;
  3772. #region Extensibility Method Definitions
  3773. /// <summary>
  3774. /// This method is invoked from the constructor once initialization is complete and
  3775. /// can be used for further object setup.
  3776. /// </summary>
  3777. partial void OnCreated();
  3778. partial void OnCompilersChanging(string[] value);
  3779. partial void OnCompilersChanged();
  3780. partial void OnIdChanging(int value);
  3781. partial void OnIdChanged();
  3782. partial void OnNameChanging(string value);
  3783. partial void OnNameChanged();
  3784. partial void OnStatementPathChanging(string value);
  3785. partial void OnStatementPathChanged();
  3786. partial void OnTestingInformationChanging(TestingInformation value);
  3787. partial void OnTestingInformationChanged();
  3788. #endregion
  3789. /// <summary>
  3790. /// Initializes a new instance of the <see cref="ProblemDetails"/> class.
  3791. /// </summary>
  3792. public ProblemDetails()
  3793. {
  3794. this.OnCreated();
  3795. }
  3796. /// <summary>
  3797. /// Gets or sets the 'Compilers' value.
  3798. /// </summary>
  3799. [DataMember()]
  3800. [XmlIgnore()]
  3801. public string[] Compilers
  3802. {
  3803. get
  3804. {
  3805. return this._compilers;
  3806. }
  3807. set
  3808. {
  3809. if ((this._compilers != value))
  3810. {
  3811. this.OnCompilersChanging(value);
  3812. this.RaiseDataMemberChanging("Compilers");
  3813. this.ValidateProperty("Compilers", value);
  3814. this._compilers = value;
  3815. this.RaiseDataMemberChanged("Compilers");
  3816. this.OnCompilersChanged();
  3817. }
  3818. }
  3819. }
  3820. /// <summary>
  3821. /// Gets or sets the 'Id' value.
  3822. /// </summary>
  3823. [DataMember()]
  3824. [XmlIgnore()]
  3825. public int Id
  3826. {
  3827. get
  3828. {
  3829. return this._id;
  3830. }
  3831. set
  3832. {
  3833. if ((this._id != value))
  3834. {
  3835. this.OnIdChanging(value);
  3836. this.RaiseDataMemberChanging("Id");
  3837. this.ValidateProperty("Id", value);
  3838. this._id = value;
  3839. this.RaiseDataMemberChanged("Id");
  3840. this.OnIdChanged();
  3841. }
  3842. }
  3843. }
  3844. /// <summary>
  3845. /// Gets or sets the 'Name' value.
  3846. /// </summary>
  3847. [DataMember()]
  3848. [XmlElement(ElementName="name")]
  3849. public string Name
  3850. {
  3851. get
  3852. {
  3853. return this._name;
  3854. }
  3855. set
  3856. {
  3857. if ((this._name != value))
  3858. {
  3859. this.OnNameChanging(value);
  3860. this.RaiseDataMemberChanging("Name");
  3861. this.ValidateProperty("Name", value);
  3862. this._name = value;
  3863. this.RaiseDataMemberChanged("Name");
  3864. this.OnNameChanged();
  3865. }
  3866. }
  3867. }
  3868. /// <summary>
  3869. /// Gets or sets the 'StatementPath' value.
  3870. /// </summary>
  3871. [DataMember()]
  3872. [XmlIgnore()]
  3873. public string StatementPath
  3874. {
  3875. get
  3876. {
  3877. return this._statementPath;
  3878. }
  3879. set
  3880. {
  3881. if ((this._statementPath != value))
  3882. {
  3883. this.OnStatementPathChanging(value);
  3884. this.RaiseDataMemberChanging("StatementPath");
  3885. this.ValidateProperty("StatementPath", value);
  3886. this._statementPath = value;
  3887. this.RaiseDataMemberChanged("StatementPath");
  3888. this.OnStatementPathChanged();
  3889. }
  3890. }
  3891. }
  3892. /// <summary>
  3893. /// Gets or sets the 'TestingInformation' value.
  3894. /// </summary>
  3895. [DataMember()]
  3896. [Display(AutoGenerateField=false)]
  3897. [XmlElement(ElementName="testingInfo")]
  3898. public TestingInformation TestingInformation
  3899. {
  3900. get
  3901. {
  3902. return this._testingInformation;
  3903. }
  3904. set
  3905. {
  3906. if ((this._testingInformation != value))
  3907. {
  3908. this.OnTestingInformationChanging(value);
  3909. this.RaiseDataMemberChanging("TestingInformation");
  3910. this.ValidateProperty("TestingInformation", value);
  3911. this._testingInformation = value;
  3912. this.RaiseDataMemberChanged("TestingInformation");
  3913. this.OnTestingInformationChanged();
  3914. }
  3915. }
  3916. }
  3917. }
  3918. /// <summary>
  3919. /// The 'TaskIOFile' class.
  3920. /// </summary>
  3921. [DataContract(Namespace="http://schemas.datacontract.org/2004/07/glados.Web.Services.Entities")]
  3922. public sealed partial class TaskIOFile : ComplexObject
  3923. {
  3924. private string _name;
  3925. private string _type;
  3926. #region Extensibility Method Definitions
  3927. /// <summary>
  3928. /// This method is invoked from the constructor once initialization is complete and
  3929. /// can be used for further object setup.
  3930. /// </summary>
  3931. partial void OnCreated();
  3932. partial void OnNameChanging(string value);
  3933. partial void OnNameChanged();
  3934. partial void OnTypeChanging(string value);
  3935. partial void OnTypeChanged();
  3936. #endregion
  3937. /// <summary>
  3938. /// Initializes a new instance of the <see cref="TaskIOFile"/> class.
  3939. /// </summary>
  3940. public TaskIOFile()
  3941. {
  3942. this.OnCreated();
  3943. }
  3944. /// <summary>
  3945. /// Gets or sets the 'Name' value.
  3946. /// </summary>
  3947. [DataMember()]
  3948. [XmlText()]
  3949. public string Name
  3950. {
  3951. get
  3952. {
  3953. return this._name;
  3954. }
  3955. set
  3956. {
  3957. if ((this._name != value))
  3958. {
  3959. this.OnNameChanging(value);
  3960. this.RaiseDataMemberChanging("Name");
  3961. this.ValidateProperty("Name", value);
  3962. this._name = value;
  3963. this.RaiseDataMemberChanged("Name");
  3964. this.OnNameChanged();
  3965. }
  3966. }
  3967. }
  3968. /// <summary>
  3969. /// Gets or sets the 'Type' value.
  3970. /// </summary>
  3971. [DataMember()]
  3972. [XmlAttribute(AttributeName="type")]
  3973. public string Type
  3974. {
  3975. get
  3976. {
  3977. return this._type;
  3978. }
  3979. set
  3980. {
  3981. if ((this._type != value))
  3982. {
  3983. this.OnTypeChanging(value);
  3984. this.RaiseDataMemberChanging("Type");
  3985. this.ValidateProperty("Type", value);
  3986. this._type = value;
  3987. this.RaiseDataMemberChanged("Type");
  3988. this.OnTypeChanged();
  3989. }
  3990. }
  3991. }
  3992. }
  3993. /// <summary>
  3994. /// The 'TestDescriptor' class.
  3995. /// </summary>
  3996. [DataContract(Namespace="http://schemas.datacontract.org/2004/07/glados.Web.Services.Entities")]
  3997. public sealed partial class TestDescriptor : ComplexObject
  3998. {
  3999. private int _id;
  4000. private int _memoryLimitMb;
  4001. private float _timeLimitSec;
  4002. #region Extensibility Method Definitions
  4003. /// <summary>
  4004. /// This method is invoked from the constructor once initialization is complete and
  4005. /// can be used for further object setup.
  4006. /// </summary>
  4007. partial void OnCreated();
  4008. partial void OnIdChanging(int value);
  4009. partial void OnIdChanged();
  4010. partial void OnMemoryLimitMbChanging(int value);
  4011. partial void OnMemoryLimitMbChanged();
  4012. partial void OnTimeLimitSecChanging(float value);
  4013. partial void OnTimeLimitSecChanged();
  4014. #endregion
  4015. /// <summary>
  4016. /// Initializes a new instance of the <see cref="TestDescriptor"/> class.
  4017. /// </summary>
  4018. public TestDescriptor()
  4019. {
  4020. this.OnCreated();
  4021. }
  4022. /// <summary>
  4023. /// Gets or sets the 'Id' value.
  4024. /// </summary>
  4025. [DataMember()]
  4026. [XmlAttribute(AttributeName="id")]
  4027. public int Id
  4028. {
  4029. get
  4030. {
  4031. return this._id;
  4032. }
  4033. set
  4034. {
  4035. if ((this._id != value))
  4036. {
  4037. this.OnIdChanging(value);
  4038. this.RaiseDataMemberChanging("Id");
  4039. this.ValidateProperty("Id", value);
  4040. this._id = value;
  4041. this.RaiseDataMemberChanged("Id");
  4042. this.OnIdChanged();
  4043. }
  4044. }
  4045. }
  4046. /// <summary>
  4047. /// Gets or sets the 'MemoryLimitMb' value.
  4048. /// </summary>
  4049. [DataMember()]
  4050. [XmlAttribute(AttributeName="memoryLimit")]
  4051. public int MemoryLimitMb
  4052. {
  4053. get
  4054. {
  4055. return this._memoryLimitMb;
  4056. }
  4057. set
  4058. {
  4059. if ((this._memoryLimitMb != value))
  4060. {
  4061. this.OnMemoryLimitMbChanging(value);
  4062. this.RaiseDataMemberChanging("MemoryLimitMb");
  4063. this.ValidateProperty("MemoryLimitMb", value);
  4064. this._memoryLimitMb = value;
  4065. this.RaiseDataMemberChanged("MemoryLimitMb");
  4066. this.OnMemoryLimitMbChanged();
  4067. }
  4068. }
  4069. }
  4070. /// <summary>
  4071. /// Gets or sets the 'TimeLimitSec' value.
  4072. /// </summary>
  4073. [DataMember()]
  4074. [XmlAttribute(AttributeName="timeLimit")]
  4075. public float TimeLimitSec
  4076. {
  4077. get
  4078. {
  4079. return this._timeLimitSec;
  4080. }
  4081. set
  4082. {
  4083. if ((this._timeLimitSec != value))
  4084. {
  4085. this.OnTimeLimitSecChanging(value);
  4086. this.RaiseDataMemberChanging("TimeLimitSec");
  4087. this.ValidateProperty("TimeLimitSec", value);
  4088. this._timeLimitSec = value;
  4089. this.RaiseDataMemberChanged("TimeLimitSec");
  4090. this.OnTimeLimitSecChanged();
  4091. }
  4092. }
  4093. }
  4094. }
  4095. /// <summary>
  4096. /// The 'TestingInformation' class.
  4097. /// </summary>
  4098. [DataContract(Namespace="http://schemas.datacontract.org/2004/07/glados.Web.Services.Entities")]
  4099. public sealed partial class TestingInformation : ComplexObject
  4100. {
  4101. private TaskIOFile[] _ioFiles;
  4102. private TestDescriptor[] _tests;
  4103. #region Extensibility Method Definitions
  4104. /// <summary>
  4105. /// This method is invoked from the constructor once initialization is complete and
  4106. /// can be used for further object setup.
  4107. /// </summary>
  4108. partial void OnCreated();
  4109. partial void OnIOFilesChanging(TaskIOFile[] value);
  4110. partial void OnIOFilesChanged();
  4111. partial void OnTestsChanging(TestDescriptor[] value);
  4112. partial void OnTestsChanged();
  4113. #endregion
  4114. /// <summary>
  4115. /// Initializes a new instance of the <see cref="TestingInformation"/> class.
  4116. /// </summary>
  4117. public TestingInformation()
  4118. {
  4119. this.OnCreated();
  4120. }
  4121. /// <summary>
  4122. /// Gets or sets the 'IOFiles' value.
  4123. /// </summary>
  4124. [DataMember()]
  4125. [Display(AutoGenerateField=false)]
  4126. [XmlArray(ElementName="files")]
  4127. [XmlArrayItem(ElementName="file")]
  4128. public TaskIOFile[] IOFiles
  4129. {
  4130. get
  4131. {
  4132. return this._ioFiles;
  4133. }
  4134. set
  4135. {
  4136. if ((this._ioFiles != value))
  4137. {
  4138. this.OnIOFilesChanging(value);
  4139. this.RaiseDataMemberChanging("IOFiles");
  4140. this.ValidateProperty("IOFiles", value);
  4141. this._ioFiles = value;
  4142. this.RaiseDataMemberChanged("IOFiles");
  4143. this.OnIOFilesChanged();
  4144. }
  4145. }
  4146. }
  4147. /// <summary>
  4148. /// Gets or sets the 'Tests' value.
  4149. /// </summary>
  4150. [DataMember()]
  4151. [Display(AutoGenerateField=false)]
  4152. [XmlArray(ElementName="tests")]
  4153. [XmlArrayItem(ElementName="test")]
  4154. public TestDescriptor[] Tests
  4155. {
  4156. get
  4157. {
  4158. return this._tests;
  4159. }
  4160. set
  4161. {
  4162. if ((this._tests != value))
  4163. {
  4164. this.OnTestsChanging(value);
  4165. this.RaiseDataMemberChanging("Tests");
  4166. this.ValidateProperty("Tests", value);
  4167. this._tests = value;
  4168. this.RaiseDataMemberChanged("Tests");
  4169. this.OnTestsChanged();
  4170. }
  4171. }
  4172. }
  4173. }
  4174. /// <summary>
  4175. /// The 'TestingMachineEntity' entity class.
  4176. /// </summary>
  4177. [DataContract(Namespace="http://schemas.datacontract.org/2004/07/glados.Web.Services.Entities")]
  4178. public sealed partial class TestingMachineEntity : Entity
  4179. {
  4180. private string _name;
  4181. private ServerStatus _status;
  4182. #region Extensibility Method Definitions
  4183. /// <summary>
  4184. /// This method is invoked from the constructor once initialization is complete and
  4185. /// can be used for further object setup.
  4186. /// </summary>
  4187. partial void OnCreated();
  4188. partial void OnNameChanging(string value);
  4189. partial void OnNameChanged();
  4190. partial void OnStatusChanging(ServerStatus value);
  4191. partial void OnStatusChanged();
  4192. #endregion
  4193. /// <summary>
  4194. /// Initializes a new instance of the <see cref="TestingMachineEntity"/> class.
  4195. /// </summary>
  4196. public TestingMachineEntity()
  4197. {
  4198. this.OnCreated();
  4199. }
  4200. /// <summary>
  4201. /// Gets or sets the 'Name' value.
  4202. /// </summary>
  4203. [DataMember()]
  4204. [Editable(false, AllowInitialValue=true)]
  4205. [Key()]
  4206. [RoundtripOriginal()]
  4207. public string Name
  4208. {
  4209. get
  4210. {
  4211. return this._name;
  4212. }
  4213. set
  4214. {
  4215. if ((this._name != value))
  4216. {
  4217. this.OnNameChanging(value);
  4218. this.ValidateProperty("Name", value);
  4219. this._name = value;
  4220. this.RaisePropertyChanged("Name");
  4221. this.OnNameChanged();
  4222. }
  4223. }
  4224. }
  4225. /// <summary>
  4226. /// Gets or sets the 'Status' value.
  4227. /// </summary>
  4228. [DataMember()]
  4229. public ServerStatus Status
  4230. {
  4231. get
  4232. {
  4233. return this._status;
  4234. }
  4235. set
  4236. {
  4237. if ((this._status != value))
  4238. {
  4239. this.OnStatusChanging(value);
  4240. this.RaiseDataMemberChanging("Status");
  4241. this.ValidateProperty("Status", value);
  4242. this._status = value;
  4243. this.RaiseDataMemberChanged("Status");
  4244. this.OnStatusChanged();
  4245. }
  4246. }
  4247. }
  4248. /// <summary>
  4249. /// Computes a value from the key fields that uniquely identifies this entity instance.
  4250. /// </summary>
  4251. /// <returns>An object instance that uniquely identifies this entity instance.</returns>
  4252. public override object GetIdentity()
  4253. {
  4254. return this._name;
  4255. }
  4256. }
  4257. }
  4258. namespace glados.Web.Services.RIAServices
  4259. {
  4260. using System;
  4261. using System.Collections.Generic;
  4262. using System.ComponentModel;
  4263. using System.ComponentModel.DataAnnotations;
  4264. using System.Linq;
  4265. using System.ServiceModel;
  4266. using System.ServiceModel.DomainServices;
  4267. using System.ServiceModel.DomainServices.Client;
  4268. using System.ServiceModel.DomainServices.Client.ApplicationServices;
  4269. using glados.Web.Logic.Base;
  4270. using glados.Web.Services.Entities;
  4271. /// <summary>
  4272. /// The DomainContext corresponding to the 'CompetitionAdminService' DomainService.
  4273. /// </summary>
  4274. public sealed partial class CompetitionAdminContext : DomainContext
  4275. {
  4276. #region Extensibility Method Definitions
  4277. /// <summary>
  4278. /// This method is invoked from the constructor once initialization is complete and
  4279. /// can be used for further object setup.
  4280. /// </summary>
  4281. partial void OnCreated();
  4282. #endregion
  4283. /// <summary>
  4284. /// Initializes a new instance of the <see cref="CompetitionAdminContext"/> class.
  4285. /// </summary>
  4286. public CompetitionAdminContext() :
  4287. this(new WebDomainClient<ICompetitionAdminServiceContract>(new Uri("glados-Web-Services-RIAServices-CompetitionAdminService.svc", UriKind.Relative)))
  4288. {
  4289. }
  4290. /// <summary>
  4291. /// Initializes a new instance of the <see cref="CompetitionAdminContext"/> class with the specified service URI.
  4292. /// </summary>
  4293. /// <param name="serviceUri">The CompetitionAdminService service URI.</param>
  4294. public CompetitionAdminContext(Uri serviceUri) :
  4295. this(new WebDomainClient<ICompetitionAdminServiceContract>(serviceUri))
  4296. {
  4297. }
  4298. /// <summary>
  4299. /// Initializes a new instance of the <see cref="CompetitionAdminContext"/> class with the specified <paramref name="domainClient"/>.
  4300. /// </summary>
  4301. /// <param name="domainClient">The DomainClient instance to use for this DomainContext.</param>
  4302. public CompetitionAdminContext(DomainClient domainClient) :
  4303. base(domainClient)
  4304. {
  4305. this.OnCreated();
  4306. }
  4307. /// <summary>
  4308. /// Asynchronously invokes the 'AssignTask' method of the DomainService.
  4309. /// </summary>
  4310. /// <param name="assignmentId">The value for the 'assignmentId' parameter of this action.</param>
  4311. /// <param name="problemId">The value for the 'problemId' parameter of this action.</param>
  4312. /// <param name="callback">Callback to invoke when the operation completes.</param>
  4313. /// <param name="userState">Value to pass to the callback. It can be <c>null</c>.</param>
  4314. /// <returns>An operation instance that can be used to manage the asynchronous request.</returns>
  4315. public InvokeOperation AssignTask(int assignmentId, int problemId, Action<InvokeOperation> callback, object userState)
  4316. {
  4317. Dictionary<string, object> parameters = new Dictionary<string, object>();
  4318. parameters.Add("assignmentId", assignmentId);
  4319. parameters.Add("problemId", problemId);
  4320. this.ValidateMethod("AssignTask", parameters);
  4321. return this.InvokeOperation("AssignTask", typeof(void), parameters, true, callback, userState);
  4322. }
  4323. /// <summary>
  4324. /// Asynchronously invokes the 'AssignTask' method of the DomainService.
  4325. /// </summary>
  4326. /// <param name="assignmentId">The value for the 'assignmentId' parameter of this action.</param>
  4327. /// <param name="problemId">The value for the 'problemId' parameter of this action.</param>
  4328. /// <returns>An operation instance that can be used to manage the asynchronous request.</returns>
  4329. public InvokeOperation AssignTask(int assignmentId, int problemId)
  4330. {
  4331. Dictionary<string, object> parameters = new Dictionary<string, object>();
  4332. parameters.Add("assignmentId", assignmentId);
  4333. parameters.Add("problemId", problemId);
  4334. this.ValidateMethod("AssignTask", parameters);
  4335. return this.InvokeOperation("AssignTask", typeof(void), parameters, true, null, null);
  4336. }
  4337. /// <summary>
  4338. /// Asynchronously invokes the 'CreateCompetition' method of the DomainService.
  4339. /// </summary>
  4340. /// <param name="name">The value for the 'name' parameter of this action.</param>
  4341. /// <param name="typeName">The value for the 'typeName' parameter of this action.</param>
  4342. /// <param name="callback">Callback to invoke when the operation completes.</param>
  4343. /// <param name="userState">Value to pass to the callback. It can be <c>null</c>.</param>
  4344. /// <returns>An operation instance that can be used to manage the asynchronous request.</returns>
  4345. public InvokeOperation<int> CreateCompetition(string name, string typeName, Action<InvokeOperation<int>> callback, object userState)
  4346. {
  4347. Dictionary<string, object> parameters = new Dictionary<string, object>();
  4348. parameters.Add("name", name);
  4349. parameters.Add("typeName", typeName);
  4350. this.ValidateMethod("CreateCompetition", parameters);
  4351. return ((InvokeOperation<int>)(this.InvokeOperation("CreateCompetition", typeof(int), parameters, true, callback, userState)));
  4352. }
  4353. /// <summary>
  4354. /// Asynchronously invokes the 'CreateCompetition' method of the DomainService.
  4355. /// </summary>
  4356. /// <param name="name">The value for the 'name' parameter of this action.</param>
  4357. /// <param name="typeName">The value for the 'typeName' parameter of this action.</param>
  4358. /// <returns>An operation instance that can be used to manage the asynchronous request.</returns>
  4359. public InvokeOperation<int> CreateCompetition(string name, string typeName)
  4360. {
  4361. Dictionary<string, object> parameters = new Dictionary<string, object>();
  4362. parameters.Add("name", name);
  4363. parameters.Add("typeName", typeName);
  4364. this.ValidateMethod("CreateCompetition", parameters);
  4365. return ((InvokeOperation<int>)(this.InvokeOperation("CreateCompetition", typeof(int), parameters, true, null, null)));
  4366. }
  4367. /// <summary>
  4368. /// Asynchronously invokes the 'DeleteCompetition' method of the DomainService.
  4369. /// </summary>
  4370. /// <param name="id">The value for the 'id' parameter of this action.</param>
  4371. /// <param name="callback">Callback to invoke when the operation completes.</param>
  4372. /// <param name="userState">Value to pass to the callback. It can be <c>null</c>.</param>
  4373. /// <returns>An operation instance that can be used to manage the asynchronous request.</returns>
  4374. public InvokeOperation DeleteCompetition(int id, Action<InvokeOperation> callback, object userState)
  4375. {
  4376. Dictionary<string, object> parameters = new Dictionary<string, object>();
  4377. parameters.Add("id", id);
  4378. this.ValidateMethod("DeleteCompetition", parameters);
  4379. return this.InvokeOperation("DeleteCompetition", typeof(void), parameters, true, callback, userState);
  4380. }
  4381. /// <summary>
  4382. /// Asynchronously invokes the 'DeleteCompetition' method of the DomainService.
  4383. /// </summary>
  4384. /// <param name="id">The value for the 'id' parameter of this action.</param>
  4385. /// <returns>An operation instance that can be used to manage the asynchronous request.</returns>
  4386. public InvokeOperation DeleteCompetition(int id)
  4387. {
  4388. Dictionary<string, object> parameters = new Dictionary<string, object>();
  4389. parameters.Add("id", id);
  4390. this.ValidateMethod("DeleteCompetition", parameters);
  4391. return this.InvokeOperation("DeleteCompetition", typeof(void), parameters, true, null, null);
  4392. }
  4393. /// <summary>
  4394. /// Asynchronously invokes the 'GetAssignmentsForCompetition' method of the DomainService.
  4395. /// </summary>
  4396. /// <param name="id">The value for the 'id' parameter of this action.</param>
  4397. /// <param name="callback">Callback to invoke when the operation completes.</param>
  4398. /// <param name="userState">Value to pass to the callback. It can be <c>null</c>.</param>
  4399. /// <returns>An operation instance that can be used to manage the asynchronous request.</returns>
  4400. public InvokeOperation<IEnumerable<ParticipantAssignment>> GetAssignmentsForCompetition(int id, Action<InvokeOperation<IEnumerable<ParticipantAssignment>>> callback, object userState)
  4401. {
  4402. Dictionary<string, object> parameters = new Dictionary<string, object>();
  4403. parameters.Add("id", id);
  4404. this.ValidateMethod("GetAssignmentsForCompetition", parameters);
  4405. return ((InvokeOperation<IEnumerable<ParticipantAssignment>>)(this.InvokeOperation("GetAssignmentsForCompetition", typeof(IEnumerable<ParticipantAssignment>), parameters, true, callback, userState)));
  4406. }
  4407. /// <summary>
  4408. /// Asynchronously invokes the 'GetAssignmentsForCompetition' method of the DomainService.
  4409. /// </summary>
  4410. /// <param name="id">The value for the 'id' parameter of this action.</param>
  4411. /// <returns>An operation instance that can be used to manage the asynchronous request.</returns>
  4412. public InvokeOperation<IEnumerable<ParticipantAssignment>> GetAssignmentsForCompetition(int id)
  4413. {
  4414. Dictionary<string, object> parameters = new Dictionary<string, object>();
  4415. parameters.Add("id", id);
  4416. this.ValidateMethod("GetAssignmentsForCompetition", parameters);
  4417. return ((InvokeOperation<IEnumerable<ParticipantAssignment>>)(this.InvokeOperation("GetAssignmentsForCompetition", typeof(IEnumerable<ParticipantAssignment>), parameters, true, null, null)));
  4418. }
  4419. /// <summary>
  4420. /// Asynchronously invokes the 'GetCompetitionMainPage' method of the DomainService.
  4421. /// </summary>
  4422. /// <param name="id">The value for the 'id' parameter of this action.</param>
  4423. /// <param name="callback">Callback to invoke when the operation completes.</param>
  4424. /// <param name="userState">Value to pass to the callback. It can be <c>null</c>.</param>
  4425. /// <returns>An operation instance that can be used to manage the asynchronous request.</returns>
  4426. public InvokeOperation<Uri> GetCompetitionMainPage(int id, Action<InvokeOperation<Uri>> callback, object userState)
  4427. {
  4428. Dictionary<string, object> parameters = new Dictionary<string, object>();
  4429. parameters.Add("id", id);
  4430. this.ValidateMethod("GetCompetitionMainPage", parameters);
  4431. return ((InvokeOperation<Uri>)(this.InvokeOperation("GetCompetitionMainPage", typeof(Uri), parameters, true, callback, userState)));
  4432. }
  4433. /// <summary>
  4434. /// Asynchronously invokes the 'GetCompetitionMainPage' method of the DomainService.
  4435. /// </summary>
  4436. /// <param name="id">The value for the 'id' parameter of this action.</param>
  4437. /// <returns>An operation instance that can be used to manage the asynchronous request.</returns>
  4438. public InvokeOperation<Uri> GetCompetitionMainPage(int id)
  4439. {
  4440. Dictionary<string, object> parameters = new Dictionary<string, object>();
  4441. parameters.Add("id", id);
  4442. this.ValidateMethod("GetCompetitionMainPage", parameters);
  4443. return ((InvokeOperation<Uri>)(this.InvokeOperation("GetCompetitionMainPage", typeof(Uri), parameters, true, null, null)));
  4444. }
  4445. /// <summary>
  4446. /// Asynchronously invokes the 'GetCompetitionTypeList' method of the DomainService.
  4447. /// </summary>
  4448. /// <param name="callback">Callback to invoke when the operation completes.</param>
  4449. /// <param name="userState">Value to pass to the callback. It can be <c>null</c>.</param>
  4450. /// <returns>An operation instance that can be used to manage the asynchronous request.</returns>
  4451. public InvokeOperation<IEnumerable<string>> GetCompetitionTypeList(Action<InvokeOperation<IEnumerable<string>>> callback, object userState)
  4452. {
  4453. this.ValidateMethod("GetCompetitionTypeList", null);
  4454. return ((InvokeOperation<IEnumerable<string>>)(this.InvokeOperation("GetCompetitionTypeList", typeof(IEnumerable<string>), null, true, callback, userState)));
  4455. }
  4456. /// <summary>
  4457. /// Asynchronously invokes the 'GetCompetitionTypeList' method of the DomainService.
  4458. /// </summary>
  4459. /// <returns>An operation instance that can be used to manage the asynchronous request.</returns>
  4460. public InvokeOperation<IEnumerable<string>> GetCompetitionTypeList()
  4461. {
  4462. this.ValidateMethod("GetCompetitionTypeList", null);
  4463. return ((InvokeOperation<IEnumerable<string>>)(this.InvokeOperation("GetCompetitionTypeList", typeof(IEnumerable<string>), null, true, null, null)));
  4464. }
  4465. /// <summary>
  4466. /// Asynchronously invokes the 'GetCourseParticipantStates' method of the DomainService.
  4467. /// </summary>
  4468. /// <param name="competitionId">The value for the 'competitionId' parameter of this action.</param>
  4469. /// <param name="callback">Callback to invoke when the operation completes.</param>
  4470. /// <param name="userState">Value to pass to the callback. It can be <c>null</c>.</param>
  4471. /// <returns>An operation instance that can be used to manage the asynchronous request.</returns>
  4472. public InvokeOperation<CourseDashboardInfo> GetCourseParticipantStates(int competitionId, Action<InvokeOperation<CourseDashboardInfo>> callback, object userState)
  4473. {
  4474. Dictionary<string, object> parameters = new Dictionary<string, object>();
  4475. parameters.Add("competitionId", competitionId);
  4476. this.ValidateMethod("GetCourseParticipantStates", parameters);
  4477. return ((InvokeOperation<CourseDashboardInfo>)(this.InvokeOperation("GetCourseParticipantStates", typeof(CourseDashboardInfo), parameters, true, callback, userState)));
  4478. }
  4479. /// <summary>
  4480. /// Asynchronously invokes the 'GetCourseParticipantStates' method of the DomainService.
  4481. /// </summary>
  4482. /// <param name="competitionId">The value for the 'competitionId' parameter of this action.</param>
  4483. /// <returns>An operation instance that can be used to manage the asynchronous request.</returns>
  4484. public InvokeOperation<CourseDashboardInfo> GetCourseParticipantStates(int competitionId)
  4485. {
  4486. Dictionary<string, object> parameters = new Dictionary<string, object>();
  4487. parameters.Add("competitionId", competitionId);
  4488. this.ValidateMethod("GetCourseParticipantStates", parameters);
  4489. return ((InvokeOperation<CourseDashboardInfo>)(this.InvokeOperation("GetCourseParticipantStates", typeof(CourseDashboardInfo), parameters, true, null, null)));
  4490. }
  4491. /// <summary>
  4492. /// Asynchronously invokes the 'SetAssignmentsForCompetition' method of the DomainService.
  4493. /// </summary>
  4494. /// <param name="id">The value for the 'id' parameter of this action.</param>
  4495. /// <param name="assignments">The value for the 'assignments' parameter of this action.</param>
  4496. /// <param name="callback">Callback to invoke when the operation completes.</param>
  4497. /// <param name="userState">Value to pass to the callback. It can be <c>null</c>.</param>
  4498. /// <returns>An operation instance that can be used to manage the asynchronous request.</returns>
  4499. public InvokeOperation SetAssignmentsForCompetition(int id, IEnumerable<ParticipantAssignment> assignments, Action<InvokeOperation> callback, object userState)
  4500. {
  4501. Dictionary<string, object> parameters = new Dictionary<string, object>();
  4502. parameters.Add("id", id);
  4503. parameters.Add("assignments", assignments);
  4504. this.ValidateMethod("SetAssignmentsForCompetition", parameters);
  4505. return this.InvokeOperation("SetAssignmentsForCompetition", typeof(void), parameters, true, callback, userState);
  4506. }
  4507. /// <summary>
  4508. /// Asynchronously invokes the 'SetAssignmentsForCompetition' method of the DomainService.
  4509. /// </summary>
  4510. /// <param name="id">The value for the 'id' parameter of this action.</param>
  4511. /// <param name="assignments">The value for the 'assignments' parameter of this action.</param>
  4512. /// <returns>An operation instance that can be used to manage the asynchronous request.</returns>
  4513. public InvokeOperation SetAssignmentsForCompetition(int id, IEnumerable<ParticipantAssignment> assignments)
  4514. {
  4515. Dictionary<string, object> parameters = new Dictionary<string, object>();
  4516. parameters.Add("id", id);
  4517. parameters.Add("assignments", assignments);
  4518. this.ValidateMethod("SetAssignmentsForCompetition", parameters);
  4519. return this.InvokeOperation("SetAssignmentsForCompetition", typeof(void), parameters, true, null, null);
  4520. }
  4521. /// <summary>
  4522. /// Creates a new EntityContainer for this DomainContext's EntitySets.
  4523. /// </summary>
  4524. /// <returns>A new container instance.</returns>
  4525. protected override EntityContainer CreateEntityContainer()
  4526. {
  4527. return new CompetitionAdminContextEntityContainer();
  4528. }
  4529. /// <summary>
  4530. /// Service contract for the 'CompetitionAdminService' DomainService.
  4531. /// </summary>
  4532. [ServiceContract()]
  4533. public interface ICompetitionAdminServiceContract
  4534. {
  4535. /// <summary>
  4536. /// Asynchronously invokes the 'AssignTask' operation.
  4537. /// </summary>
  4538. /// <param name="assignmentId">The value for the 'assignmentId' parameter of this action.</param>
  4539. /// <param name="problemId">The value for the 'problemId' parameter of this action.</param>
  4540. /// <param name="callback">Callback to invoke on completion.</param>
  4541. /// <param name="asyncState">Optional state object.</param>
  4542. /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
  4543. [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/CompetitionAdminService/AssignTaskDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
  4544. [OperationContract(AsyncPattern=true, Action="http://tempuri.org/CompetitionAdminService/AssignTask", ReplyAction="http://tempuri.org/CompetitionAdminService/AssignTaskResponse")]
  4545. IAsyncResult BeginAssignTask(int assignmentId, int problemId, AsyncCallback callback, object asyncState);
  4546. /// <summary>
  4547. /// Completes the asynchronous operation begun by 'BeginAssignTask'.
  4548. /// </summary>
  4549. /// <param name="result">The IAsyncResult returned from 'BeginAssignTask'.</param>
  4550. void EndAssignTask(IAsyncResult result);
  4551. /// <summary>
  4552. /// Asynchronously invokes the 'CreateCompetition' operation.
  4553. /// </summary>
  4554. /// <param name="name">The value for the 'name' parameter of this action.</param>
  4555. /// <param name="typeName">The value for the 'typeName' parameter of this action.</param>
  4556. /// <param name="callback">Callback to invoke on completion.</param>
  4557. /// <param name="asyncState">Optional state object.</param>
  4558. /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
  4559. [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/CompetitionAdminService/CreateCompetitionDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
  4560. [OperationContract(AsyncPattern=true, Action="http://tempuri.org/CompetitionAdminService/CreateCompetition", ReplyAction="http://tempuri.org/CompetitionAdminService/CreateCompetitionResponse")]
  4561. IAsyncResult BeginCreateCompetition(string name, string typeName, AsyncCallback callback, object asyncState);
  4562. /// <summary>
  4563. /// Completes the asynchronous operation begun by 'BeginCreateCompetition'.
  4564. /// </summary>
  4565. /// <param name="result">The IAsyncResult returned from 'BeginCreateCompetition'.</param>
  4566. /// <returns>The 'Int32' returned from the 'CreateCompetition' operation.</returns>
  4567. int EndCreateCompetition(IAsyncResult result);
  4568. /// <summary>
  4569. /// Asynchronously invokes the 'DeleteCompetition' operation.
  4570. /// </summary>
  4571. /// <param name="id">The value for the 'id' parameter of this action.</param>
  4572. /// <param name="callback">Callback to invoke on completion.</param>
  4573. /// <param name="asyncState">Optional state object.</param>
  4574. /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
  4575. [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/CompetitionAdminService/DeleteCompetitionDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
  4576. [OperationContract(AsyncPattern=true, Action="http://tempuri.org/CompetitionAdminService/DeleteCompetition", ReplyAction="http://tempuri.org/CompetitionAdminService/DeleteCompetitionResponse")]
  4577. IAsyncResult BeginDeleteCompetition(int id, AsyncCallback callback, object asyncState);
  4578. /// <summary>
  4579. /// Completes the asynchronous operation begun by 'BeginDeleteCompetition'.
  4580. /// </summary>
  4581. /// <param name="result">The IAsyncResult returned from 'BeginDeleteCompetition'.</param>
  4582. void EndDeleteCompetition(IAsyncResult result);
  4583. /// <summary>
  4584. /// Asynchronously invokes the 'GetAssignmentsForCompetition' operation.
  4585. /// </summary>
  4586. /// <param name="id">The value for the 'id' parameter of this action.</param>
  4587. /// <param name="callback">Callback to invoke on completion.</param>
  4588. /// <param name="asyncState">Optional state object.</param>
  4589. /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
  4590. [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/CompetitionAdminService/GetAssignmentsForCompetitionDomainServ" +
  4591. "iceFault", Name="DomainServiceFault", Namespace="DomainServices")]
  4592. [OperationContract(AsyncPattern=true, Action="http://tempuri.org/CompetitionAdminService/GetAssignmentsForCompetition", ReplyAction="http://tempuri.org/CompetitionAdminService/GetAssignmentsForCompetitionResponse")]
  4593. IAsyncResult BeginGetAssignmentsForCompetition(int id, AsyncCallback callback, object asyncState);
  4594. /// <summary>
  4595. /// Completes the asynchronous operation begun by 'BeginGetAssignmentsForCompetition'.
  4596. /// </summary>
  4597. /// <param name="result">The IAsyncResult returned from 'BeginGetAssignmentsForCompetition'.</param>
  4598. /// <returns>The 'IEnumerable`1' returned from the 'GetAssignmentsForCompetition' operation.</returns>
  4599. IEnumerable<ParticipantAssignment> EndGetAssignmentsForCompetition(IAsyncResult result);
  4600. /// <summary>
  4601. /// Asynchronously invokes the 'GetCompetitionMainPage' operation.
  4602. /// </summary>
  4603. /// <param name="id">The value for the 'id' parameter of this action.</param>
  4604. /// <param name="callback">Callback to invoke on completion.</param>
  4605. /// <param name="asyncState">Optional state object.</param>
  4606. /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
  4607. [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/CompetitionAdminService/GetCompetitionMainPageDomainServiceFau" +
  4608. "lt", Name="DomainServiceFault", Namespace="DomainServices")]
  4609. [OperationContract(AsyncPattern=true, Action="http://tempuri.org/CompetitionAdminService/GetCompetitionMainPage", ReplyAction="http://tempuri.org/CompetitionAdminService/GetCompetitionMainPageResponse")]
  4610. IAsyncResult BeginGetCompetitionMainPage(int id, AsyncCallback callback, object asyncState);
  4611. /// <summary>
  4612. /// Completes the asynchronous operation begun by 'BeginGetCompetitionMainPage'.
  4613. /// </summary>
  4614. /// <param name="result">The IAsyncResult returned from 'BeginGetCompetitionMainPage'.</param>
  4615. /// <returns>The 'Uri' returned from the 'GetCompetitionMainPage' operation.</returns>
  4616. Uri EndGetCompetitionMainPage(IAsyncResult result);
  4617. /// <summary>
  4618. /// Asynchronously invokes the 'GetCompetitionTypeList' operation.
  4619. /// </summary>
  4620. /// <param name="callback">Callback to invoke on completion.</param>
  4621. /// <param name="asyncState">Optional state object.</param>
  4622. /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
  4623. [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/CompetitionAdminService/GetCompetitionTypeListDomainServiceFau" +
  4624. "lt", Name="DomainServiceFault", Namespace="DomainServices")]
  4625. [OperationContract(AsyncPattern=true, Action="http://tempuri.org/CompetitionAdminService/GetCompetitionTypeList", ReplyAction="http://tempuri.org/CompetitionAdminService/GetCompetitionTypeListResponse")]
  4626. IAsyncResult BeginGetCompetitionTypeList(AsyncCallback callback, object asyncState);
  4627. /// <summary>
  4628. /// Completes the asynchronous operation begun by 'BeginGetCompetitionTypeList'.
  4629. /// </summary>
  4630. /// <param name="result">The IAsyncResult returned from 'BeginGetCompetitionTypeList'.</param>
  4631. /// <returns>The 'IEnumerable`1' returned from the 'GetCompetitionTypeList' operation.</returns>
  4632. IEnumerable<string> EndGetCompetitionTypeList(IAsyncResult result);
  4633. /// <summary>
  4634. /// Asynchronously invokes the 'GetCourseParticipantStates' operation.
  4635. /// </summary>
  4636. /// <param name="competitionId">The value for the 'competitionId' parameter of this action.</param>
  4637. /// <param name="callback">Callback to invoke on completion.</param>
  4638. /// <param name="asyncState">Optional state object.</param>
  4639. /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
  4640. [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/CompetitionAdminService/GetCourseParticipantStatesDomainServic" +
  4641. "eFault", Name="DomainServiceFault", Namespace="DomainServices")]
  4642. [OperationContract(AsyncPattern=true, Action="http://tempuri.org/CompetitionAdminService/GetCourseParticipantStates", ReplyAction="http://tempuri.org/CompetitionAdminService/GetCourseParticipantStatesResponse")]
  4643. IAsyncResult BeginGetCourseParticipantStates(int competitionId, AsyncCallback callback, object asyncState);
  4644. /// <summary>
  4645. /// Completes the asynchronous operation begun by 'BeginGetCourseParticipantStates'.
  4646. /// </summary>
  4647. /// <param name="result">The IAsyncResult returned from 'BeginGetCourseParticipantStates'.</param>
  4648. /// <returns>The 'CourseDashboardInfo' returned from the 'GetCourseParticipantStates' operation.</returns>
  4649. CourseDashboardInfo EndGetCourseParticipantStates(IAsyncResult result);
  4650. /// <summary>
  4651. /// Asynchronously invokes the 'SetAssignmentsForCompetition' operation.
  4652. /// </summary>
  4653. /// <param name="id">The value for the 'id' parameter of this action.</param>
  4654. /// <param name="assignments">The value for the 'assignments' parameter of this action.</param>
  4655. /// <param name="callback">Callback to invoke on completion.</param>
  4656. /// <param name="asyncState">Optional state object.</param>
  4657. /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
  4658. [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/CompetitionAdminService/SetAssignmentsForCompetitionDomainServ" +
  4659. "iceFault", Name="DomainServiceFault", Namespace="DomainServices")]
  4660. [OperationContract(AsyncPattern=true, Action="http://tempuri.org/CompetitionAdminService/SetAssignmentsForCompetition", ReplyAction="http://tempuri.org/CompetitionAdminService/SetAssignmentsForCompetitionResponse")]
  4661. IAsyncResult BeginSetAssignmentsForCompetition(int id, IEnumerable<ParticipantAssignment> assignments, AsyncCallback callback, object asyncState);
  4662. /// <summary>
  4663. /// Completes the asynchronous operation begun by 'BeginSetAssignmentsForCompetition'.
  4664. /// </summary>
  4665. /// <param name="result">The IAsyncResult returned from 'BeginSetAssignmentsForCompetition'.</param>
  4666. void EndSetAssignmentsForCompetition(IAsyncResult result);
  4667. }
  4668. internal sealed class CompetitionAdminContextEntityContainer : EntityContainer
  4669. {
  4670. public CompetitionAdminContextEntityContainer()
  4671. {
  4672. }
  4673. }
  4674. }
  4675. /// <summary>
  4676. /// The DomainContext corresponding to the 'ParticipationService' DomainService.
  4677. /// </summary>
  4678. public sealed partial class ParticipationContext : DomainContext
  4679. {
  4680. #region Extensibility Method Definitions
  4681. /// <summary>
  4682. /// This method is invoked from the constructor once initialization is complete and
  4683. /// can be used for further object setup.
  4684. /// </summary>
  4685. partial void OnCreated();
  4686. #endregion
  4687. /// <summary>
  4688. /// Initializes a new instance of the <see cref="ParticipationContext"/> class.
  4689. /// </summary>
  4690. public ParticipationContext() :
  4691. this(new WebDomainClient<IParticipationServiceContract>(new Uri("glados-Web-Services-RIAServices-ParticipationService.svc", UriKind.Relative)))
  4692. {
  4693. }
  4694. /// <summary>
  4695. /// Initializes a new instance of the <see cref="ParticipationContext"/> class with the specified service URI.
  4696. /// </summary>
  4697. /// <param name="serviceUri">The ParticipationService service URI.</param>
  4698. public ParticipationContext(Uri serviceUri) :
  4699. this(new WebDomainClient<IParticipationServiceContract>(serviceUri))
  4700. {
  4701. }
  4702. /// <summary>
  4703. /// Initializes a new instance of the <see cref="ParticipationContext"/> class with the specified <paramref name="domainClient"/>.
  4704. /// </summary>
  4705. /// <param name="domainClient">The DomainClient instance to use for this DomainContext.</param>
  4706. public ParticipationContext(DomainClient domainClient) :
  4707. base(domainClient)
  4708. {
  4709. this.OnCreated();
  4710. }
  4711. /// <summary>
  4712. /// Asynchronously invokes the 'GetParticipantsForCompetition' method of the DomainService.
  4713. /// </summary>
  4714. /// <param name="competitionId">The value for the 'competitionId' parameter of this action.</param>
  4715. /// <param name="callback">Callback to invoke when the operation completes.</param>
  4716. /// <param name="userState">Value to pass to the callback. It can be <c>null</c>.</param>
  4717. /// <returns>An operation instance that can be used to manage the asynchronous request.</returns>
  4718. public InvokeOperation<IEnumerable<ParticipantState>> GetParticipantsForCompetition(int competitionId, Action<InvokeOperation<IEnumerable<ParticipantState>>> callback, object userState)
  4719. {
  4720. Dictionary<string, object> parameters = new Dictionary<string, object>();
  4721. parameters.Add("competitionId", competitionId);
  4722. this.ValidateMethod("GetParticipantsForCompetition", parameters);
  4723. return ((InvokeOperation<IEnumerable<ParticipantState>>)(this.InvokeOperation("GetParticipantsForCompetition", typeof(IEnumerable<ParticipantState>), parameters, true, callback, userState)));
  4724. }
  4725. /// <summary>
  4726. /// Asynchronously invokes the 'GetParticipantsForCompetition' method of the DomainService.
  4727. /// </summary>
  4728. /// <param name="competitionId">The value for the 'competitionId' parameter of this action.</param>
  4729. /// <returns>An operation instance that can be used to manage the asynchronous request.</returns>
  4730. public InvokeOperation<IEnumerable<ParticipantState>> GetParticipantsForCompetition(int competitionId)
  4731. {
  4732. Dictionary<string, object> parameters = new Dictionary<string, object>();
  4733. parameters.Add("competitionId", competitionId);
  4734. this.ValidateMethod("GetParticipantsForCompetition", parameters);
  4735. return ((InvokeOperation<IEnumerable<ParticipantState>>)(this.InvokeOperation("GetParticipantsForCompetition", typeof(IEnumerable<ParticipantState>), parameters, true, null, null)));
  4736. }
  4737. /// <summary>
  4738. /// Asynchronously invokes the 'GetProblemByAssignmentId' method of the DomainService.
  4739. /// </summary>
  4740. /// <param name="assignmentId">The value for the 'assignmentId' parameter of this action.</param>
  4741. /// <param name="callback">Callback to invoke when the operation completes.</param>
  4742. /// <param name="userState">Value to pass to the callback. It can be <c>null</c>.</param>
  4743. /// <returns>An operation instance that can be used to manage the asynchronous request.</returns>
  4744. public InvokeOperation<ProblemDetails> GetProblemByAssignmentId(int assignmentId, Action<InvokeOperation<ProblemDetails>> callback, object userState)
  4745. {
  4746. Dictionary<string, object> parameters = new Dictionary<string, object>();
  4747. parameters.Add("assignmentId", assignmentId);
  4748. this.ValidateMethod("GetProblemByAssignmentId", parameters);
  4749. return ((InvokeOperation<ProblemDetails>)(this.InvokeOperation("GetProblemByAssignmentId", typeof(ProblemDetails), parameters, true, callback, userState)));
  4750. }
  4751. /// <summary>
  4752. /// Asynchronously invokes the 'GetProblemByAssignmentId' method of the DomainService.
  4753. /// </summary>
  4754. /// <param name="assignmentId">The value for the 'assignmentId' parameter of this action.</param>
  4755. /// <returns>An operation instance that can be used to manage the asynchronous request.</returns>
  4756. public InvokeOperation<ProblemDetails> GetProblemByAssignmentId(int assignmentId)
  4757. {
  4758. Dictionary<string, object> parameters = new Dictionary<string, object>();
  4759. parameters.Add("assignmentId", assignmentId);
  4760. this.ValidateMethod("GetProblemByAssignmentId", parameters);
  4761. return ((InvokeOperation<ProblemDetails>)(this.InvokeOperation("GetProblemByAssignmentId", typeof(ProblemDetails), parameters, true, null, null)));
  4762. }
  4763. /// <summary>
  4764. /// Asynchronously invokes the 'GetProblemDetails' method of the DomainService.
  4765. /// </summary>
  4766. /// <param name="problemId">The value for the 'problemId' parameter of this action.</param>
  4767. /// <param name="callback">Callback to invoke when the operation completes.</param>
  4768. /// <param name="userState">Value to pass to the callback. It can be <c>null</c>.</param>
  4769. /// <returns>An operation instance that can be used to manage the asynchronous request.</returns>
  4770. public InvokeOperation<ProblemDetails> GetProblemDetails(int problemId, Action<InvokeOperation<ProblemDetails>> callback, object userState)
  4771. {
  4772. Dictionary<string, object> parameters = new Dictionary<string, object>();
  4773. parameters.Add("problemId", problemId);
  4774. this.ValidateMethod("GetProblemDetails", parameters);
  4775. return ((InvokeOperation<ProblemDetails>)(this.InvokeOperation("GetProblemDetails", typeof(ProblemDetails), parameters, true, callback, userState)));
  4776. }
  4777. /// <summary>
  4778. /// Asynchronously invokes the 'GetProblemDetails' method of the DomainService.
  4779. /// </summary>
  4780. /// <param name="problemId">The value for the 'problemId' parameter of this action.</param>
  4781. /// <returns>An operation instance that can be used to manage the asynchronous request.</returns>
  4782. public InvokeOperation<ProblemDetails> GetProblemDetails(int problemId)
  4783. {
  4784. Dictionary<string, object> parameters = new Dictionary<string, object>();
  4785. parameters.Add("problemId", problemId);
  4786. this.ValidateMethod("GetProblemDetails", parameters);
  4787. return ((InvokeOperation<ProblemDetails>)(this.InvokeOperation("GetProblemDetails", typeof(ProblemDetails), parameters, true, null, null)));
  4788. }
  4789. /// <summary>
  4790. /// Asynchronously invokes the 'SubmitSolution' method of the DomainService.
  4791. /// </summary>
  4792. /// <param name="assignmentId">The value for the 'assignmentId' parameter of this action.</param>
  4793. /// <param name="compilerName">The value for the 'compilerName' parameter of this action.</param>
  4794. /// <param name="source">The value for the 'source' parameter of this action.</param>
  4795. /// <param name="callback">Callback to invoke when the operation completes.</param>
  4796. /// <param name="userState">Value to pass to the callback. It can be <c>null</c>.</param>
  4797. /// <returns>An operation instance that can be used to manage the asynchronous request.</returns>
  4798. public InvokeOperation<int> SubmitSolution(int assignmentId, string compilerName, byte[] source, Action<InvokeOperation<int>> callback, object userState)
  4799. {
  4800. Dictionary<string, object> parameters = new Dictionary<string, object>();
  4801. parameters.Add("assignmentId", assignmentId);
  4802. parameters.Add("compilerName", compilerName);
  4803. parameters.Add("source", source);
  4804. this.ValidateMethod("SubmitSolution", parameters);
  4805. return ((InvokeOperation<int>)(this.InvokeOperation("SubmitSolution", typeof(int), parameters, true, callback, userState)));
  4806. }
  4807. /// <summary>
  4808. /// Asynchronously invokes the 'SubmitSolution' method of the DomainService.
  4809. /// </summary>
  4810. /// <param name="assignmentId">The value for the 'assignmentId' parameter of this action.</param>
  4811. /// <param name="compilerName">The value for the 'compilerName' parameter of this action.</param>
  4812. /// <param name="source">The value for the 'source' parameter of this action.</param>
  4813. /// <returns>An operation instance that can be used to manage the asynchronous request.</returns>
  4814. public InvokeOperation<int> SubmitSolution(int assignmentId, string compilerName, byte[] source)
  4815. {
  4816. Dictionary<string, object> parameters = new Dictionary<string, object>();
  4817. parameters.Add("assignmentId", assignmentId);
  4818. parameters.Add("compilerName", compilerName);
  4819. parameters.Add("source", source);
  4820. this.ValidateMethod("SubmitSolution", parameters);
  4821. return ((InvokeOperation<int>)(this.InvokeOperation("SubmitSolution", typeof(int), parameters, true, null, null)));
  4822. }
  4823. /// <summary>
  4824. /// Creates a new EntityContainer for this DomainContext's EntitySets.
  4825. /// </summary>
  4826. /// <returns>A new container instance.</returns>
  4827. protected override EntityContainer CreateEntityContainer()
  4828. {
  4829. return new ParticipationContextEntityContainer();
  4830. }
  4831. /// <summary>
  4832. /// Service contract for the 'ParticipationService' DomainService.
  4833. /// </summary>
  4834. [ServiceContract()]
  4835. public interface IParticipationServiceContract
  4836. {
  4837. /// <summary>
  4838. /// Asynchronously invokes the 'GetParticipantsForCompetition' operation.
  4839. /// </summary>
  4840. /// <param name="competitionId">The value for the 'competitionId' parameter of this action.</param>
  4841. /// <param name="callback">Callback to invoke on completion.</param>
  4842. /// <param name="asyncState">Optional state object.</param>
  4843. /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
  4844. [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/ParticipationService/GetParticipantsForCompetitionDomainServic" +
  4845. "eFault", Name="DomainServiceFault", Namespace="DomainServices")]
  4846. [OperationContract(AsyncPattern=true, Action="http://tempuri.org/ParticipationService/GetParticipantsForCompetition", ReplyAction="http://tempuri.org/ParticipationService/GetParticipantsForCompetitionResponse")]
  4847. IAsyncResult BeginGetParticipantsForCompetition(int competitionId, AsyncCallback callback, object asyncState);
  4848. /// <summary>
  4849. /// Completes the asynchronous operation begun by 'BeginGetParticipantsForCompetition'.
  4850. /// </summary>
  4851. /// <param name="result">The IAsyncResult returned from 'BeginGetParticipantsForCompetition'.</param>
  4852. /// <returns>The 'IEnumerable`1' returned from the 'GetParticipantsForCompetition' operation.</returns>
  4853. IEnumerable<ParticipantState> EndGetParticipantsForCompetition(IAsyncResult result);
  4854. /// <summary>
  4855. /// Asynchronously invokes the 'GetProblemByAssignmentId' operation.
  4856. /// </summary>
  4857. /// <param name="assignmentId">The value for the 'assignmentId' parameter of this action.</param>
  4858. /// <param name="callback">Callback to invoke on completion.</param>
  4859. /// <param name="asyncState">Optional state object.</param>
  4860. /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
  4861. [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/ParticipationService/GetProblemByAssignmentIdDomainServiceFaul" +
  4862. "t", Name="DomainServiceFault", Namespace="DomainServices")]
  4863. [OperationContract(AsyncPattern=true, Action="http://tempuri.org/ParticipationService/GetProblemByAssignmentId", ReplyAction="http://tempuri.org/ParticipationService/GetProblemByAssignmentIdResponse")]
  4864. IAsyncResult BeginGetProblemByAssignmentId(int assignmentId, AsyncCallback callback, object asyncState);
  4865. /// <summary>
  4866. /// Completes the asynchronous operation begun by 'BeginGetProblemByAssignmentId'.
  4867. /// </summary>
  4868. /// <param name="result">The IAsyncResult returned from 'BeginGetProblemByAssignmentId'.</param>
  4869. /// <returns>The 'ProblemDetails' returned from the 'GetProblemByAssignmentId' operation.</returns>
  4870. ProblemDetails EndGetProblemByAssignmentId(IAsyncResult result);
  4871. /// <summary>
  4872. /// Asynchronously invokes the 'GetProblemDetails' operation.
  4873. /// </summary>
  4874. /// <param name="problemId">The value for the 'problemId' parameter of this action.</param>
  4875. /// <param name="callback">Callback to invoke on completion.</param>
  4876. /// <param name="asyncState">Optional state object.</param>
  4877. /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
  4878. [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/ParticipationService/GetProblemDetailsDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
  4879. [OperationContract(AsyncPattern=true, Action="http://tempuri.org/ParticipationService/GetProblemDetails", ReplyAction="http://tempuri.org/ParticipationService/GetProblemDetailsResponse")]
  4880. IAsyncResult BeginGetProblemDetails(int problemId, AsyncCallback callback, object asyncState);
  4881. /// <summary>
  4882. /// Completes the asynchronous operation begun by 'BeginGetProblemDetails'.
  4883. /// </summary>
  4884. /// <param name="result">The IAsyncResult returned from 'BeginGetProblemDetails'.</param>
  4885. /// <returns>The 'ProblemDetails' returned from the 'GetProblemDetails' operation.</returns>
  4886. ProblemDetails EndGetProblemDetails(IAsyncResult result);
  4887. /// <summary>
  4888. /// Asynchronously invokes the 'SubmitSolution' operation.
  4889. /// </summary>
  4890. /// <param name="assignmentId">The value for the 'assignmentId' parameter of this action.</param>
  4891. /// <param name="compilerName">The value for the 'compilerName' parameter of this action.</param>
  4892. /// <param name="source">The value for the 'source' parameter of this action.</param>
  4893. /// <param name="callback">Callback to invoke on completion.</param>
  4894. /// <param name="asyncState">Optional state object.</param>
  4895. /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
  4896. [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/ParticipationService/SubmitSolutionDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
  4897. [OperationContract(AsyncPattern=true, Action="http://tempuri.org/ParticipationService/SubmitSolution", ReplyAction="http://tempuri.org/ParticipationService/SubmitSolutionResponse")]
  4898. IAsyncResult BeginSubmitSolution(int assignmentId, string compilerName, byte[] source, AsyncCallback callback, object asyncState);
  4899. /// <summary>
  4900. /// Completes the asynchronous operation begun by 'BeginSubmitSolution'.
  4901. /// </summary>
  4902. /// <param name="result">The IAsyncResult returned from 'BeginSubmitSolution'.</param>
  4903. /// <returns>The 'Int32' returned from the 'SubmitSolution' operation.</returns>
  4904. int EndSubmitSolution(IAsyncResult result);
  4905. }
  4906. internal sealed class ParticipationContextEntityContainer : EntityContainer
  4907. {
  4908. public ParticipationContextEntityContainer()
  4909. {
  4910. }
  4911. }
  4912. }
  4913. }