PageRenderTime 79ms CodeModel.GetById 30ms RepoModel.GetById 0ms app.codeStats 0ms

/glados_proto/glados_proto/Generated_Code/glados.Web.g.cs-299c7693

https://bitbucket.org/lucky_geck/tsys
Unknown | 4260 lines | 3809 code | 451 blank | 0 comment | 0 complexity | 8c32a28ad47213695f1fdd063d26b9f2 MD5 | raw file
  1. //------------------------------------------------------------------------------
  2. // <auto-generated>
  3. // This code was generated by a tool.
  4. // Runtime Version:4.0.30319.431
  5. //
  6. // Changes to this file may cause incorrect behavior and will be lost if
  7. // the code is regenerated.
  8. // </auto-generated>
  9. //------------------------------------------------------------------------------
  10. namespace glados
  11. {
  12. using System;
  13. using System.Collections.Generic;
  14. using System.ComponentModel;
  15. using System.ComponentModel.DataAnnotations;
  16. using System.Linq;
  17. using System.ServiceModel.DomainServices;
  18. using System.ServiceModel.DomainServices.Client;
  19. using System.ServiceModel.DomainServices.Client.ApplicationServices;
  20. using glados.Web;
  21. /// <summary>
  22. /// Context for the RIA application.
  23. /// </summary>
  24. /// <remarks>
  25. /// This context extends the base to make application services and types available
  26. /// for consumption from code and xaml.
  27. /// </remarks>
  28. public sealed partial class WebContext : WebContextBase
  29. {
  30. #region Extensibility Method Definitions
  31. /// <summary>
  32. /// This method is invoked from the constructor once initialization is complete and
  33. /// can be used for further object setup.
  34. /// </summary>
  35. partial void OnCreated();
  36. #endregion
  37. /// <summary>
  38. /// Initializes a new instance of the WebContext class.
  39. /// </summary>
  40. public WebContext()
  41. {
  42. this.OnCreated();
  43. }
  44. /// <summary>
  45. /// Gets the context that is registered as a lifetime object with the current application.
  46. /// </summary>
  47. /// <exception cref="InvalidOperationException"> is thrown if there is no current application,
  48. /// no contexts have been added, or more than one context has been added.
  49. /// </exception>
  50. /// <seealso cref="System.Windows.Application.ApplicationLifetimeObjects"/>
  51. public new static WebContext Current
  52. {
  53. get
  54. {
  55. return ((WebContext)(WebContextBase.Current));
  56. }
  57. }
  58. /// <summary>
  59. /// Gets a user representing the authenticated identity.
  60. /// </summary>
  61. public new AuthUser User
  62. {
  63. get
  64. {
  65. return ((AuthUser)(base.User));
  66. }
  67. }
  68. }
  69. }
  70. namespace Glados.TestingModule.Interfaces
  71. {
  72. using System;
  73. using System.Collections.Generic;
  74. using System.ComponentModel;
  75. using System.ComponentModel.DataAnnotations;
  76. using System.Linq;
  77. using System.ServiceModel.DomainServices;
  78. using System.ServiceModel.DomainServices.Client;
  79. using System.ServiceModel.DomainServices.Client.ApplicationServices;
  80. public enum ServerStatus
  81. {
  82. Idle = 0,
  83. Busy = 1,
  84. InternalError = 2,
  85. Unavailable = 3,
  86. Down = 4,
  87. }
  88. }
  89. namespace glados.Web
  90. {
  91. using System;
  92. using System.Collections.Generic;
  93. using System.ComponentModel;
  94. using System.ComponentModel.DataAnnotations;
  95. using System.Linq;
  96. using System.Runtime.Serialization;
  97. using System.ServiceModel;
  98. using System.ServiceModel.DomainServices;
  99. using System.ServiceModel.DomainServices.Client;
  100. using System.ServiceModel.DomainServices.Client.ApplicationServices;
  101. using System.ServiceModel.Web;
  102. using System.Xml.Serialization;
  103. /// <summary>
  104. /// The 'Assignment' entity class.
  105. /// </summary>
  106. [DataContract(Namespace="http://schemas.datacontract.org/2004/07/glados.Web")]
  107. public sealed partial class Assignment : Entity
  108. {
  109. private int _id;
  110. private EntityRef<Participation> _participation;
  111. private int _participationId;
  112. private EntityRef<Problem> _problem;
  113. private int _problemId;
  114. private byte[] _state;
  115. private EntityCollection<Submission> _submission;
  116. #region Extensibility Method Definitions
  117. /// <summary>
  118. /// This method is invoked from the constructor once initialization is complete and
  119. /// can be used for further object setup.
  120. /// </summary>
  121. partial void OnCreated();
  122. partial void OnIdChanging(int value);
  123. partial void OnIdChanged();
  124. partial void OnParticipationIdChanging(int value);
  125. partial void OnParticipationIdChanged();
  126. partial void OnProblemIdChanging(int value);
  127. partial void OnProblemIdChanged();
  128. partial void OnStateChanging(byte[] value);
  129. partial void OnStateChanged();
  130. #endregion
  131. /// <summary>
  132. /// Initializes a new instance of the <see cref="Assignment"/> class.
  133. /// </summary>
  134. public Assignment()
  135. {
  136. this.OnCreated();
  137. }
  138. /// <summary>
  139. /// Gets or sets the 'Id' value.
  140. /// </summary>
  141. [DataMember()]
  142. [Editable(false, AllowInitialValue=true)]
  143. [Key()]
  144. [RoundtripOriginal()]
  145. public int Id
  146. {
  147. get
  148. {
  149. return this._id;
  150. }
  151. set
  152. {
  153. if ((this._id != value))
  154. {
  155. this.OnIdChanging(value);
  156. this.ValidateProperty("Id", value);
  157. this._id = value;
  158. this.RaisePropertyChanged("Id");
  159. this.OnIdChanged();
  160. }
  161. }
  162. }
  163. /// <summary>
  164. /// Gets or sets the associated <see cref="Participation"/> entity.
  165. /// </summary>
  166. [Association("Participation_Assignment", "ParticipationId", "Id", IsForeignKey=true)]
  167. [XmlIgnore()]
  168. public Participation Participation
  169. {
  170. get
  171. {
  172. if ((this._participation == null))
  173. {
  174. this._participation = new EntityRef<Participation>(this, "Participation", this.FilterParticipation);
  175. }
  176. return this._participation.Entity;
  177. }
  178. set
  179. {
  180. Participation previous = this.Participation;
  181. if ((previous != value))
  182. {
  183. this.ValidateProperty("Participation", value);
  184. if ((previous != null))
  185. {
  186. this._participation.Entity = null;
  187. previous.Assignment.Remove(this);
  188. }
  189. if ((value != null))
  190. {
  191. this.ParticipationId = value.Id;
  192. }
  193. else
  194. {
  195. this.ParticipationId = default(int);
  196. }
  197. this._participation.Entity = value;
  198. if ((value != null))
  199. {
  200. value.Assignment.Add(this);
  201. }
  202. this.RaisePropertyChanged("Participation");
  203. }
  204. }
  205. }
  206. /// <summary>
  207. /// Gets or sets the 'ParticipationId' value.
  208. /// </summary>
  209. [DataMember()]
  210. [RoundtripOriginal()]
  211. public int ParticipationId
  212. {
  213. get
  214. {
  215. return this._participationId;
  216. }
  217. set
  218. {
  219. if ((this._participationId != value))
  220. {
  221. this.OnParticipationIdChanging(value);
  222. this.RaiseDataMemberChanging("ParticipationId");
  223. this.ValidateProperty("ParticipationId", value);
  224. this._participationId = value;
  225. this.RaiseDataMemberChanged("ParticipationId");
  226. this.OnParticipationIdChanged();
  227. }
  228. }
  229. }
  230. /// <summary>
  231. /// Gets or sets the associated <see cref="Problem"/> entity.
  232. /// </summary>
  233. [Association("Problem_Assignment", "ProblemId", "Id", IsForeignKey=true)]
  234. [XmlIgnore()]
  235. public Problem Problem
  236. {
  237. get
  238. {
  239. if ((this._problem == null))
  240. {
  241. this._problem = new EntityRef<Problem>(this, "Problem", this.FilterProblem);
  242. }
  243. return this._problem.Entity;
  244. }
  245. set
  246. {
  247. Problem previous = this.Problem;
  248. if ((previous != value))
  249. {
  250. this.ValidateProperty("Problem", value);
  251. if ((previous != null))
  252. {
  253. this._problem.Entity = null;
  254. previous.Assignment.Remove(this);
  255. }
  256. if ((value != null))
  257. {
  258. this.ProblemId = value.Id;
  259. }
  260. else
  261. {
  262. this.ProblemId = default(int);
  263. }
  264. this._problem.Entity = value;
  265. if ((value != null))
  266. {
  267. value.Assignment.Add(this);
  268. }
  269. this.RaisePropertyChanged("Problem");
  270. }
  271. }
  272. }
  273. /// <summary>
  274. /// Gets or sets the 'ProblemId' value.
  275. /// </summary>
  276. [DataMember()]
  277. [RoundtripOriginal()]
  278. public int ProblemId
  279. {
  280. get
  281. {
  282. return this._problemId;
  283. }
  284. set
  285. {
  286. if ((this._problemId != value))
  287. {
  288. this.OnProblemIdChanging(value);
  289. this.RaiseDataMemberChanging("ProblemId");
  290. this.ValidateProperty("ProblemId", value);
  291. this._problemId = value;
  292. this.RaiseDataMemberChanged("ProblemId");
  293. this.OnProblemIdChanged();
  294. }
  295. }
  296. }
  297. /// <summary>
  298. /// Gets or sets the 'State' value.
  299. /// </summary>
  300. [DataMember()]
  301. public byte[] State
  302. {
  303. get
  304. {
  305. return this._state;
  306. }
  307. set
  308. {
  309. if ((this._state != value))
  310. {
  311. this.OnStateChanging(value);
  312. this.RaiseDataMemberChanging("State");
  313. this.ValidateProperty("State", value);
  314. this._state = value;
  315. this.RaiseDataMemberChanged("State");
  316. this.OnStateChanged();
  317. }
  318. }
  319. }
  320. /// <summary>
  321. /// Gets the collection of associated <see cref="Submission"/> entity instances.
  322. /// </summary>
  323. [Association("Assignment_Submission", "Id", "AssignmentId")]
  324. [XmlIgnore()]
  325. public EntityCollection<Submission> Submission
  326. {
  327. get
  328. {
  329. if ((this._submission == null))
  330. {
  331. this._submission = new EntityCollection<Submission>(this, "Submission", this.FilterSubmission, this.AttachSubmission, this.DetachSubmission);
  332. }
  333. return this._submission;
  334. }
  335. }
  336. private bool FilterParticipation(Participation entity)
  337. {
  338. return (entity.Id == this.ParticipationId);
  339. }
  340. private bool FilterProblem(Problem entity)
  341. {
  342. return (entity.Id == this.ProblemId);
  343. }
  344. private void AttachSubmission(Submission entity)
  345. {
  346. entity.Assignment = this;
  347. }
  348. private void DetachSubmission(Submission entity)
  349. {
  350. entity.Assignment = null;
  351. }
  352. private bool FilterSubmission(Submission entity)
  353. {
  354. return (entity.AssignmentId == this.Id);
  355. }
  356. /// <summary>
  357. /// Computes a value from the key fields that uniquely identifies this entity instance.
  358. /// </summary>
  359. /// <returns>An object instance that uniquely identifies this entity instance.</returns>
  360. public override object GetIdentity()
  361. {
  362. return this._id;
  363. }
  364. }
  365. /// <summary>
  366. /// The DomainContext corresponding to the 'AuthenticationDomainService' DomainService.
  367. /// </summary>
  368. public sealed partial class AuthenticationDomainContext : global::System.ServiceModel.DomainServices.Client.ApplicationServices.AuthenticationDomainContextBase
  369. {
  370. #region Extensibility Method Definitions
  371. /// <summary>
  372. /// This method is invoked from the constructor once initialization is complete and
  373. /// can be used for further object setup.
  374. /// </summary>
  375. partial void OnCreated();
  376. #endregion
  377. /// <summary>
  378. /// Initializes a new instance of the <see cref="AuthenticationDomainContext"/> class.
  379. /// </summary>
  380. public AuthenticationDomainContext() :
  381. this(new WebDomainClient<IAuthenticationDomainServiceContract>(new Uri("glados-Web-AuthenticationDomainService.svc", UriKind.Relative)))
  382. {
  383. }
  384. /// <summary>
  385. /// Initializes a new instance of the <see cref="AuthenticationDomainContext"/> class with the specified service URI.
  386. /// </summary>
  387. /// <param name="serviceUri">The AuthenticationDomainService service URI.</param>
  388. public AuthenticationDomainContext(Uri serviceUri) :
  389. this(new WebDomainClient<IAuthenticationDomainServiceContract>(serviceUri))
  390. {
  391. }
  392. /// <summary>
  393. /// Initializes a new instance of the <see cref="AuthenticationDomainContext"/> class with the specified <paramref name="domainClient"/>.
  394. /// </summary>
  395. /// <param name="domainClient">The DomainClient instance to use for this DomainContext.</param>
  396. public AuthenticationDomainContext(DomainClient domainClient) :
  397. base(domainClient)
  398. {
  399. this.OnCreated();
  400. }
  401. /// <summary>
  402. /// Gets the set of <see cref="AuthUser"/> entity instances that have been loaded into this <see cref="AuthenticationDomainContext"/> instance.
  403. /// </summary>
  404. public EntitySet<AuthUser> AuthUsers
  405. {
  406. get
  407. {
  408. return base.EntityContainer.GetEntitySet<AuthUser>();
  409. }
  410. }
  411. /// <summary>
  412. /// Gets an EntityQuery instance that can be used to load <see cref="AuthUser"/> entity instances using the 'GetUser' query.
  413. /// </summary>
  414. /// <returns>An EntityQuery that can be loaded to retrieve <see cref="AuthUser"/> entity instances.</returns>
  415. public EntityQuery<AuthUser> GetUserQuery()
  416. {
  417. this.ValidateMethod("GetUserQuery", null);
  418. return base.CreateQuery<AuthUser>("GetUser", null, false, false);
  419. }
  420. /// <summary>
  421. /// Gets an EntityQuery instance that can be used to load <see cref="AuthUser"/> entity instances using the 'Login' query.
  422. /// </summary>
  423. /// <param name="userName">The value for the 'userName' parameter of the query.</param>
  424. /// <param name="password">The value for the 'password' parameter of the query.</param>
  425. /// <param name="isPersistent">The value for the 'isPersistent' parameter of the query.</param>
  426. /// <param name="customData">The value for the 'customData' parameter of the query.</param>
  427. /// <returns>An EntityQuery that can be loaded to retrieve <see cref="AuthUser"/> entity instances.</returns>
  428. public EntityQuery<AuthUser> LoginQuery(string userName, string password, bool isPersistent, string customData)
  429. {
  430. Dictionary<string, object> parameters = new Dictionary<string, object>();
  431. parameters.Add("userName", userName);
  432. parameters.Add("password", password);
  433. parameters.Add("isPersistent", isPersistent);
  434. parameters.Add("customData", customData);
  435. this.ValidateMethod("LoginQuery", parameters);
  436. return base.CreateQuery<AuthUser>("Login", parameters, true, false);
  437. }
  438. /// <summary>
  439. /// Gets an EntityQuery instance that can be used to load <see cref="AuthUser"/> entity instances using the 'Logout' query.
  440. /// </summary>
  441. /// <returns>An EntityQuery that can be loaded to retrieve <see cref="AuthUser"/> entity instances.</returns>
  442. public EntityQuery<AuthUser> LogoutQuery()
  443. {
  444. this.ValidateMethod("LogoutQuery", null);
  445. return base.CreateQuery<AuthUser>("Logout", null, true, false);
  446. }
  447. /// <summary>
  448. /// Creates a new EntityContainer for this DomainContext's EntitySets.
  449. /// </summary>
  450. /// <returns>A new container instance.</returns>
  451. protected override EntityContainer CreateEntityContainer()
  452. {
  453. return new AuthenticationDomainContextEntityContainer();
  454. }
  455. /// <summary>
  456. /// Service contract for the 'AuthenticationDomainService' DomainService.
  457. /// </summary>
  458. [ServiceContract()]
  459. public interface IAuthenticationDomainServiceContract
  460. {
  461. /// <summary>
  462. /// Asynchronously invokes the 'GetUser' operation.
  463. /// </summary>
  464. /// <param name="callback">Callback to invoke on completion.</param>
  465. /// <param name="asyncState">Optional state object.</param>
  466. /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
  467. [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/AuthenticationDomainService/GetUserDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
  468. [OperationContract(AsyncPattern=true, Action="http://tempuri.org/AuthenticationDomainService/GetUser", ReplyAction="http://tempuri.org/AuthenticationDomainService/GetUserResponse")]
  469. [WebGet()]
  470. IAsyncResult BeginGetUser(AsyncCallback callback, object asyncState);
  471. /// <summary>
  472. /// Completes the asynchronous operation begun by 'BeginGetUser'.
  473. /// </summary>
  474. /// <param name="result">The IAsyncResult returned from 'BeginGetUser'.</param>
  475. /// <returns>The 'QueryResult' returned from the 'GetUser' operation.</returns>
  476. QueryResult<AuthUser> EndGetUser(IAsyncResult result);
  477. /// <summary>
  478. /// Asynchronously invokes the 'Login' operation.
  479. /// </summary>
  480. /// <param name="userName">The value for the 'userName' parameter of this action.</param>
  481. /// <param name="password">The value for the 'password' parameter of this action.</param>
  482. /// <param name="isPersistent">The value for the 'isPersistent' parameter of this action.</param>
  483. /// <param name="customData">The value for the 'customData' parameter of this action.</param>
  484. /// <param name="callback">Callback to invoke on completion.</param>
  485. /// <param name="asyncState">Optional state object.</param>
  486. /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
  487. [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/AuthenticationDomainService/LoginDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
  488. [OperationContract(AsyncPattern=true, Action="http://tempuri.org/AuthenticationDomainService/Login", ReplyAction="http://tempuri.org/AuthenticationDomainService/LoginResponse")]
  489. IAsyncResult BeginLogin(string userName, string password, bool isPersistent, string customData, AsyncCallback callback, object asyncState);
  490. /// <summary>
  491. /// Completes the asynchronous operation begun by 'BeginLogin'.
  492. /// </summary>
  493. /// <param name="result">The IAsyncResult returned from 'BeginLogin'.</param>
  494. /// <returns>The 'QueryResult' returned from the 'Login' operation.</returns>
  495. QueryResult<AuthUser> EndLogin(IAsyncResult result);
  496. /// <summary>
  497. /// Asynchronously invokes the 'Logout' operation.
  498. /// </summary>
  499. /// <param name="callback">Callback to invoke on completion.</param>
  500. /// <param name="asyncState">Optional state object.</param>
  501. /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
  502. [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/AuthenticationDomainService/LogoutDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
  503. [OperationContract(AsyncPattern=true, Action="http://tempuri.org/AuthenticationDomainService/Logout", ReplyAction="http://tempuri.org/AuthenticationDomainService/LogoutResponse")]
  504. IAsyncResult BeginLogout(AsyncCallback callback, object asyncState);
  505. /// <summary>
  506. /// Completes the asynchronous operation begun by 'BeginLogout'.
  507. /// </summary>
  508. /// <param name="result">The IAsyncResult returned from 'BeginLogout'.</param>
  509. /// <returns>The 'QueryResult' returned from the 'Logout' operation.</returns>
  510. QueryResult<AuthUser> EndLogout(IAsyncResult result);
  511. /// <summary>
  512. /// Asynchronously invokes the 'SubmitChanges' operation.
  513. /// </summary>
  514. /// <param name="changeSet">The change-set to submit.</param>
  515. /// <param name="callback">Callback to invoke on completion.</param>
  516. /// <param name="asyncState">Optional state object.</param>
  517. /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
  518. [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/AuthenticationDomainService/SubmitChangesDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
  519. [OperationContract(AsyncPattern=true, Action="http://tempuri.org/AuthenticationDomainService/SubmitChanges", ReplyAction="http://tempuri.org/AuthenticationDomainService/SubmitChangesResponse")]
  520. IAsyncResult BeginSubmitChanges(IEnumerable<ChangeSetEntry> changeSet, AsyncCallback callback, object asyncState);
  521. /// <summary>
  522. /// Completes the asynchronous operation begun by 'BeginSubmitChanges'.
  523. /// </summary>
  524. /// <param name="result">The IAsyncResult returned from 'BeginSubmitChanges'.</param>
  525. /// <returns>The collection of change-set entry elements returned from 'SubmitChanges'.</returns>
  526. IEnumerable<ChangeSetEntry> EndSubmitChanges(IAsyncResult result);
  527. }
  528. internal sealed class AuthenticationDomainContextEntityContainer : EntityContainer
  529. {
  530. public AuthenticationDomainContextEntityContainer()
  531. {
  532. this.CreateEntitySet<AuthUser>(EntitySetOperations.Edit);
  533. }
  534. }
  535. }
  536. /// <summary>
  537. /// The 'AuthUser' entity class.
  538. /// </summary>
  539. [DataContract(Namespace="http://schemas.datacontract.org/2004/07/glados.Web")]
  540. public sealed partial class AuthUser : Entity, global::System.Security.Principal.IIdentity, global::System.Security.Principal.IPrincipal
  541. {
  542. private string _name = string.Empty;
  543. private IEnumerable<string> _roles;
  544. #region Extensibility Method Definitions
  545. /// <summary>
  546. /// This method is invoked from the constructor once initialization is complete and
  547. /// can be used for further object setup.
  548. /// </summary>
  549. partial void OnCreated();
  550. partial void OnNameChanging(string value);
  551. partial void OnNameChanged();
  552. partial void OnRolesChanging(IEnumerable<string> value);
  553. partial void OnRolesChanged();
  554. #endregion
  555. /// <summary>
  556. /// Initializes a new instance of the <see cref="AuthUser"/> class.
  557. /// </summary>
  558. public AuthUser()
  559. {
  560. this.OnCreated();
  561. }
  562. /// <summary>
  563. /// Gets or sets the 'Name' value.
  564. /// </summary>
  565. [DataMember()]
  566. [Editable(false, AllowInitialValue=true)]
  567. [Key()]
  568. [RoundtripOriginal()]
  569. public string Name
  570. {
  571. get
  572. {
  573. return this._name;
  574. }
  575. set
  576. {
  577. if ((this._name != value))
  578. {
  579. this.OnNameChanging(value);
  580. this.ValidateProperty("Name", value);
  581. this._name = value;
  582. this.RaisePropertyChanged("Name");
  583. this.OnNameChanged();
  584. this.RaisePropertyChanged("IsAuthenticated");
  585. }
  586. }
  587. }
  588. /// <summary>
  589. /// Gets or sets the 'Roles' value.
  590. /// </summary>
  591. [DataMember()]
  592. [Editable(false)]
  593. public IEnumerable<string> Roles
  594. {
  595. get
  596. {
  597. return this._roles;
  598. }
  599. set
  600. {
  601. if ((this._roles != value))
  602. {
  603. this.OnRolesChanging(value);
  604. this.ValidateProperty("Roles", value);
  605. this._roles = value;
  606. this.RaisePropertyChanged("Roles");
  607. this.OnRolesChanged();
  608. }
  609. }
  610. }
  611. string global::System.Security.Principal.IIdentity.AuthenticationType
  612. {
  613. get
  614. {
  615. return string.Empty;
  616. }
  617. }
  618. /// <summary>
  619. /// Gets a value indicating whether the identity is authenticated.
  620. /// </summary>
  621. /// <remarks>
  622. /// This value is <c>true</c> if <see cref="Name"/> is not <c>null</c> or empty.
  623. /// </remarks>
  624. public bool IsAuthenticated
  625. {
  626. get
  627. {
  628. return (true != string.IsNullOrEmpty(this.Name));
  629. }
  630. }
  631. string global::System.Security.Principal.IIdentity.Name
  632. {
  633. get
  634. {
  635. return this.Name;
  636. }
  637. }
  638. global::System.Security.Principal.IIdentity global::System.Security.Principal.IPrincipal.Identity
  639. {
  640. get
  641. {
  642. return this;
  643. }
  644. }
  645. /// <summary>
  646. /// Computes a value from the key fields that uniquely identifies this entity instance.
  647. /// </summary>
  648. /// <returns>An object instance that uniquely identifies this entity instance.</returns>
  649. public override object GetIdentity()
  650. {
  651. return this._name;
  652. }
  653. /// <summary>
  654. /// Return whether the principal is in the role.
  655. /// </summary>
  656. /// <remarks>
  657. /// Returns whether the specified role is contained in the roles.
  658. /// This implementation is case sensitive.
  659. /// </remarks>
  660. /// <param name="role">The name of the role for which to check membership.</param>
  661. /// <returns>Whether the principal is in the role.</returns>
  662. public bool IsInRole(string role)
  663. {
  664. if ((this.Roles == null))
  665. {
  666. return false;
  667. }
  668. return global::System.Linq.Enumerable.Contains(this.Roles, role);
  669. }
  670. }
  671. /// <summary>
  672. /// The 'Course' entity class.
  673. /// </summary>
  674. [DataContract(Namespace="http://schemas.datacontract.org/2004/07/glados.Web")]
  675. public sealed partial class Course : Entity
  676. {
  677. private int _id;
  678. private string _name;
  679. private EntityCollection<Participation> _participation;
  680. private byte[] _state;
  681. private string _type;
  682. #region Extensibility Method Definitions
  683. /// <summary>
  684. /// This method is invoked from the constructor once initialization is complete and
  685. /// can be used for further object setup.
  686. /// </summary>
  687. partial void OnCreated();
  688. partial void OnIdChanging(int value);
  689. partial void OnIdChanged();
  690. partial void OnNameChanging(string value);
  691. partial void OnNameChanged();
  692. partial void OnStateChanging(byte[] value);
  693. partial void OnStateChanged();
  694. partial void OnTypeChanging(string value);
  695. partial void OnTypeChanged();
  696. #endregion
  697. /// <summary>
  698. /// Initializes a new instance of the <see cref="Course"/> class.
  699. /// </summary>
  700. public Course()
  701. {
  702. this.OnCreated();
  703. }
  704. /// <summary>
  705. /// Gets or sets the 'Id' value.
  706. /// </summary>
  707. [DataMember()]
  708. [Editable(false, AllowInitialValue=true)]
  709. [Key()]
  710. [RoundtripOriginal()]
  711. public int Id
  712. {
  713. get
  714. {
  715. return this._id;
  716. }
  717. set
  718. {
  719. if ((this._id != value))
  720. {
  721. this.OnIdChanging(value);
  722. this.ValidateProperty("Id", value);
  723. this._id = value;
  724. this.RaisePropertyChanged("Id");
  725. this.OnIdChanged();
  726. }
  727. }
  728. }
  729. /// <summary>
  730. /// Gets or sets the 'Name' value.
  731. /// </summary>
  732. [DataMember()]
  733. [Required()]
  734. public string Name
  735. {
  736. get
  737. {
  738. return this._name;
  739. }
  740. set
  741. {
  742. if ((this._name != value))
  743. {
  744. this.OnNameChanging(value);
  745. this.RaiseDataMemberChanging("Name");
  746. this.ValidateProperty("Name", value);
  747. this._name = value;
  748. this.RaiseDataMemberChanged("Name");
  749. this.OnNameChanged();
  750. }
  751. }
  752. }
  753. /// <summary>
  754. /// Gets the collection of associated <see cref="Participation"/> entity instances.
  755. /// </summary>
  756. [Association("Course_Participation", "Id", "CourseId")]
  757. [XmlIgnore()]
  758. public EntityCollection<Participation> Participation
  759. {
  760. get
  761. {
  762. if ((this._participation == null))
  763. {
  764. this._participation = new EntityCollection<Participation>(this, "Participation", this.FilterParticipation, this.AttachParticipation, this.DetachParticipation);
  765. }
  766. return this._participation;
  767. }
  768. }
  769. /// <summary>
  770. /// Gets or sets the 'State' value.
  771. /// </summary>
  772. [DataMember()]
  773. public byte[] State
  774. {
  775. get
  776. {
  777. return this._state;
  778. }
  779. set
  780. {
  781. if ((this._state != value))
  782. {
  783. this.OnStateChanging(value);
  784. this.RaiseDataMemberChanging("State");
  785. this.ValidateProperty("State", value);
  786. this._state = value;
  787. this.RaiseDataMemberChanged("State");
  788. this.OnStateChanged();
  789. }
  790. }
  791. }
  792. /// <summary>
  793. /// Gets or sets the 'Type' value.
  794. /// </summary>
  795. [DataMember()]
  796. public string Type
  797. {
  798. get
  799. {
  800. return this._type;
  801. }
  802. set
  803. {
  804. if ((this._type != value))
  805. {
  806. this.OnTypeChanging(value);
  807. this.RaiseDataMemberChanging("Type");
  808. this.ValidateProperty("Type", value);
  809. this._type = value;
  810. this.RaiseDataMemberChanged("Type");
  811. this.OnTypeChanged();
  812. }
  813. }
  814. }
  815. private void AttachParticipation(Participation entity)
  816. {
  817. entity.Course = this;
  818. }
  819. private void DetachParticipation(Participation entity)
  820. {
  821. entity.Course = null;
  822. }
  823. private bool FilterParticipation(Participation entity)
  824. {
  825. return (entity.CourseId == this.Id);
  826. }
  827. /// <summary>
  828. /// Computes a value from the key fields that uniquely identifies this entity instance.
  829. /// </summary>
  830. /// <returns>An object instance that uniquely identifies this entity instance.</returns>
  831. public override object GetIdentity()
  832. {
  833. return this._id;
  834. }
  835. }
  836. /// <summary>
  837. /// The 'Group' entity class.
  838. /// </summary>
  839. [DataContract(Namespace="http://schemas.datacontract.org/2004/07/glados.Web")]
  840. public sealed partial class Group : Entity
  841. {
  842. private int _id;
  843. private EntityCollection<Membership> _membership;
  844. private string _name;
  845. #region Extensibility Method Definitions
  846. /// <summary>
  847. /// This method is invoked from the constructor once initialization is complete and
  848. /// can be used for further object setup.
  849. /// </summary>
  850. partial void OnCreated();
  851. partial void OnIdChanging(int value);
  852. partial void OnIdChanged();
  853. partial void OnNameChanging(string value);
  854. partial void OnNameChanged();
  855. #endregion
  856. /// <summary>
  857. /// Initializes a new instance of the <see cref="Group"/> class.
  858. /// </summary>
  859. public Group()
  860. {
  861. this.OnCreated();
  862. }
  863. /// <summary>
  864. /// Gets or sets the 'Id' value.
  865. /// </summary>
  866. [DataMember()]
  867. [Editable(false, AllowInitialValue=true)]
  868. [Key()]
  869. [RoundtripOriginal()]
  870. public int Id
  871. {
  872. get
  873. {
  874. return this._id;
  875. }
  876. set
  877. {
  878. if ((this._id != value))
  879. {
  880. this.OnIdChanging(value);
  881. this.ValidateProperty("Id", value);
  882. this._id = value;
  883. this.RaisePropertyChanged("Id");
  884. this.OnIdChanged();
  885. }
  886. }
  887. }
  888. /// <summary>
  889. /// Gets the collection of associated <see cref="Membership"/> entity instances.
  890. /// </summary>
  891. [Association("Group_Membership", "Id", "GroupId")]
  892. [XmlIgnore()]
  893. public EntityCollection<Membership> Membership
  894. {
  895. get
  896. {
  897. if ((this._membership == null))
  898. {
  899. this._membership = new EntityCollection<Membership>(this, "Membership", this.FilterMembership, this.AttachMembership, this.DetachMembership);
  900. }
  901. return this._membership;
  902. }
  903. }
  904. /// <summary>
  905. /// Gets or sets the 'Name' value.
  906. /// </summary>
  907. [DataMember()]
  908. [Required()]
  909. public string Name
  910. {
  911. get
  912. {
  913. return this._name;
  914. }
  915. set
  916. {
  917. if ((this._name != value))
  918. {
  919. this.OnNameChanging(value);
  920. this.RaiseDataMemberChanging("Name");
  921. this.ValidateProperty("Name", value);
  922. this._name = value;
  923. this.RaiseDataMemberChanged("Name");
  924. this.OnNameChanged();
  925. }
  926. }
  927. }
  928. private void AttachMembership(Membership entity)
  929. {
  930. entity.Group = this;
  931. }
  932. private void DetachMembership(Membership entity)
  933. {
  934. entity.Group = null;
  935. }
  936. private bool FilterMembership(Membership entity)
  937. {
  938. return (entity.GroupId == this.Id);
  939. }
  940. /// <summary>
  941. /// Computes a value from the key fields that uniquely identifies this entity instance.
  942. /// </summary>
  943. /// <returns>An object instance that uniquely identifies this entity instance.</returns>
  944. public override object GetIdentity()
  945. {
  946. return this._id;
  947. }
  948. }
  949. /// <summary>
  950. /// The 'Membership' entity class.
  951. /// </summary>
  952. [DataContract(Namespace="http://schemas.datacontract.org/2004/07/glados.Web")]
  953. public sealed partial class Membership : Entity
  954. {
  955. private EntityRef<Group> _group;
  956. private int _groupId;
  957. private int _id;
  958. private EntityRef<User> _user;
  959. private int _userId;
  960. #region Extensibility Method Definitions
  961. /// <summary>
  962. /// This method is invoked from the constructor once initialization is complete and
  963. /// can be used for further object setup.
  964. /// </summary>
  965. partial void OnCreated();
  966. partial void OnGroupIdChanging(int value);
  967. partial void OnGroupIdChanged();
  968. partial void OnIdChanging(int value);
  969. partial void OnIdChanged();
  970. partial void OnUserIdChanging(int value);
  971. partial void OnUserIdChanged();
  972. #endregion
  973. /// <summary>
  974. /// Initializes a new instance of the <see cref="Membership"/> class.
  975. /// </summary>
  976. public Membership()
  977. {
  978. this.OnCreated();
  979. }
  980. /// <summary>
  981. /// Gets or sets the associated <see cref="Group"/> entity.
  982. /// </summary>
  983. [Association("Group_Membership", "GroupId", "Id", IsForeignKey=true)]
  984. [XmlIgnore()]
  985. public Group Group
  986. {
  987. get
  988. {
  989. if ((this._group == null))
  990. {
  991. this._group = new EntityRef<Group>(this, "Group", this.FilterGroup);
  992. }
  993. return this._group.Entity;
  994. }
  995. set
  996. {
  997. Group previous = this.Group;
  998. if ((previous != value))
  999. {
  1000. this.ValidateProperty("Group", value);
  1001. if ((previous != null))
  1002. {
  1003. this._group.Entity = null;
  1004. previous.Membership.Remove(this);
  1005. }
  1006. if ((value != null))
  1007. {
  1008. this.GroupId = value.Id;
  1009. }
  1010. else
  1011. {
  1012. this.GroupId = default(int);
  1013. }
  1014. this._group.Entity = value;
  1015. if ((value != null))
  1016. {
  1017. value.Membership.Add(this);
  1018. }
  1019. this.RaisePropertyChanged("Group");
  1020. }
  1021. }
  1022. }
  1023. /// <summary>
  1024. /// Gets or sets the 'GroupId' value.
  1025. /// </summary>
  1026. [DataMember()]
  1027. [RoundtripOriginal()]
  1028. public int GroupId
  1029. {
  1030. get
  1031. {
  1032. return this._groupId;
  1033. }
  1034. set
  1035. {
  1036. if ((this._groupId != value))
  1037. {
  1038. this.OnGroupIdChanging(value);
  1039. this.RaiseDataMemberChanging("GroupId");
  1040. this.ValidateProperty("GroupId", value);
  1041. this._groupId = value;
  1042. this.RaiseDataMemberChanged("GroupId");
  1043. this.OnGroupIdChanged();
  1044. }
  1045. }
  1046. }
  1047. /// <summary>
  1048. /// Gets or sets the 'Id' value.
  1049. /// </summary>
  1050. [DataMember()]
  1051. [Editable(false, AllowInitialValue=true)]
  1052. [Key()]
  1053. [RoundtripOriginal()]
  1054. public int Id
  1055. {
  1056. get
  1057. {
  1058. return this._id;
  1059. }
  1060. set
  1061. {
  1062. if ((this._id != value))
  1063. {
  1064. this.OnIdChanging(value);
  1065. this.ValidateProperty("Id", value);
  1066. this._id = value;
  1067. this.RaisePropertyChanged("Id");
  1068. this.OnIdChanged();
  1069. }
  1070. }
  1071. }
  1072. /// <summary>
  1073. /// Gets or sets the associated <see cref="User"/> entity.
  1074. /// </summary>
  1075. [Association("User_Membership", "UserId", "Id", IsForeignKey=true)]
  1076. [XmlIgnore()]
  1077. public User User
  1078. {
  1079. get
  1080. {
  1081. if ((this._user == null))
  1082. {
  1083. this._user = new EntityRef<User>(this, "User", this.FilterUser);
  1084. }
  1085. return this._user.Entity;
  1086. }
  1087. set
  1088. {
  1089. User previous = this.User;
  1090. if ((previous != value))
  1091. {
  1092. this.ValidateProperty("User", value);
  1093. if ((previous != null))
  1094. {
  1095. this._user.Entity = null;
  1096. previous.Membership.Remove(this);
  1097. }
  1098. if ((value != null))
  1099. {
  1100. this.UserId = value.Id;
  1101. }
  1102. else
  1103. {
  1104. this.UserId = default(int);
  1105. }
  1106. this._user.Entity = value;
  1107. if ((value != null))
  1108. {
  1109. value.Membership.Add(this);
  1110. }
  1111. this.RaisePropertyChanged("User");
  1112. }
  1113. }
  1114. }
  1115. /// <summary>
  1116. /// Gets or sets the 'UserId' value.
  1117. /// </summary>
  1118. [DataMember()]
  1119. [RoundtripOriginal()]
  1120. public int UserId
  1121. {
  1122. get
  1123. {
  1124. return this._userId;
  1125. }
  1126. set
  1127. {
  1128. if ((this._userId != value))
  1129. {
  1130. this.OnUserIdChanging(value);
  1131. this.RaiseDataMemberChanging("UserId");
  1132. this.ValidateProperty("UserId", value);
  1133. this._userId = value;
  1134. this.RaiseDataMemberChanged("UserId");
  1135. this.OnUserIdChanged();
  1136. }
  1137. }
  1138. }
  1139. private bool FilterGroup(Group entity)
  1140. {
  1141. return (entity.Id == this.GroupId);
  1142. }
  1143. private bool FilterUser(User entity)
  1144. {
  1145. return (entity.Id == this.UserId);
  1146. }
  1147. /// <summary>
  1148. /// Computes a value from the key fields that uniquely identifies this entity instance.
  1149. /// </summary>
  1150. /// <returns>An object instance that uniquely identifies this entity instance.</returns>
  1151. public override object GetIdentity()
  1152. {
  1153. return this._id;
  1154. }
  1155. }
  1156. /// <summary>
  1157. /// The 'Participation' entity class.
  1158. /// </summary>
  1159. [DataContract(Namespace="http://schemas.datacontract.org/2004/07/glados.Web")]
  1160. public sealed partial class Participation : Entity
  1161. {
  1162. private EntityCollection<Assignment> _assignment;
  1163. private EntityRef<Course> _course;
  1164. private int _courseId;
  1165. private int _id;
  1166. private byte[] _state;
  1167. private EntityRef<User> _user;
  1168. private int _userId;
  1169. #region Extensibility Method Definitions
  1170. /// <summary>
  1171. /// This method is invoked from the constructor once initialization is complete and
  1172. /// can be used for further object setup.
  1173. /// </summary>
  1174. partial void OnCreated();
  1175. partial void OnCourseIdChanging(int value);
  1176. partial void OnCourseIdChanged();
  1177. partial void OnIdChanging(int value);
  1178. partial void OnIdChanged();
  1179. partial void OnStateChanging(byte[] value);
  1180. partial void OnStateChanged();
  1181. partial void OnUserIdChanging(int value);
  1182. partial void OnUserIdChanged();
  1183. #endregion
  1184. /// <summary>
  1185. /// Initializes a new instance of the <see cref="Participation"/> class.
  1186. /// </summary>
  1187. public Participation()
  1188. {
  1189. this.OnCreated();
  1190. }
  1191. /// <summary>
  1192. /// Gets the collection of associated <see cref="Assignment"/> entity instances.
  1193. /// </summary>
  1194. [Association("Participation_Assignment", "Id", "ParticipationId")]
  1195. [XmlIgnore()]
  1196. public EntityCollection<Assignment> Assignment
  1197. {
  1198. get
  1199. {
  1200. if ((this._assignment == null))
  1201. {
  1202. this._assignment = new EntityCollection<Assignment>(this, "Assignment", this.FilterAssignment, this.AttachAssignment, this.DetachAssignment);
  1203. }
  1204. return this._assignment;
  1205. }
  1206. }
  1207. /// <summary>
  1208. /// Gets or sets the associated <see cref="Course"/> entity.
  1209. /// </summary>
  1210. [Association("Course_Participation", "CourseId", "Id", IsForeignKey=true)]
  1211. [XmlIgnore()]
  1212. public Course Course
  1213. {
  1214. get
  1215. {
  1216. if ((this._course == null))
  1217. {
  1218. this._course = new EntityRef<Course>(this, "Course", this.FilterCourse);
  1219. }
  1220. return this._course.Entity;
  1221. }
  1222. set
  1223. {
  1224. Course previous = this.Course;
  1225. if ((previous != value))
  1226. {
  1227. this.ValidateProperty("Course", value);
  1228. if ((previous != null))
  1229. {
  1230. this._course.Entity = null;
  1231. previous.Participation.Remove(this);
  1232. }
  1233. if ((value != null))
  1234. {
  1235. this.CourseId = value.Id;
  1236. }
  1237. else
  1238. {
  1239. this.CourseId = default(int);
  1240. }
  1241. this._course.Entity = value;
  1242. if ((value != null))
  1243. {
  1244. value.Participation.Add(this);
  1245. }
  1246. this.RaisePropertyChanged("Course");
  1247. }
  1248. }
  1249. }
  1250. /// <summary>
  1251. /// Gets or sets the 'CourseId' value.
  1252. /// </summary>
  1253. [DataMember()]
  1254. [RoundtripOriginal()]
  1255. public int CourseId
  1256. {
  1257. get
  1258. {
  1259. return this._courseId;
  1260. }
  1261. set
  1262. {
  1263. if ((this._courseId != value))
  1264. {
  1265. this.OnCourseIdChanging(value);
  1266. this.RaiseDataMemberChanging("CourseId");
  1267. this.ValidateProperty("CourseId", value);
  1268. this._courseId = value;
  1269. this.RaiseDataMemberChanged("CourseId");
  1270. this.OnCourseIdChanged();
  1271. }
  1272. }
  1273. }
  1274. /// <summary>
  1275. /// Gets or sets the 'Id' value.
  1276. /// </summary>
  1277. [DataMember()]
  1278. [Editable(false, AllowInitialValue=true)]
  1279. [Key()]
  1280. [RoundtripOriginal()]
  1281. public int Id
  1282. {
  1283. get
  1284. {
  1285. return this._id;
  1286. }
  1287. set
  1288. {
  1289. if ((this._id != value))
  1290. {
  1291. this.OnIdChanging(value);
  1292. this.ValidateProperty("Id", value);
  1293. this._id = value;
  1294. this.RaisePropertyChanged("Id");
  1295. this.OnIdChanged();
  1296. }
  1297. }
  1298. }
  1299. /// <summary>
  1300. /// Gets or sets the 'State' value.
  1301. /// </summary>
  1302. [DataMember()]
  1303. public byte[] State
  1304. {
  1305. get
  1306. {
  1307. return this._state;
  1308. }
  1309. set
  1310. {
  1311. if ((this._state != value))
  1312. {
  1313. this.OnStateChanging(value);
  1314. this.RaiseDataMemberChanging("State");
  1315. this.ValidateProperty("State", value);
  1316. this._state = value;
  1317. this.RaiseDataMemberChanged("State");
  1318. this.OnStateChanged();
  1319. }
  1320. }
  1321. }
  1322. /// <summary>
  1323. /// Gets or sets the associated <see cref="User"/> entity.
  1324. /// </summary>
  1325. [Association("User_Participation", "UserId", "Id", IsForeignKey=true)]
  1326. [XmlIgnore()]
  1327. public User User
  1328. {
  1329. get
  1330. {
  1331. if ((this._user == null))
  1332. {
  1333. this._user = new EntityRef<User>(this, "User", this.FilterUser);
  1334. }
  1335. return this._user.Entity;
  1336. }
  1337. set
  1338. {
  1339. User previous = this.User;
  1340. if ((previous != value))
  1341. {
  1342. this.ValidateProperty("User", value);
  1343. if ((previous != null))
  1344. {
  1345. this._user.Entity = null;
  1346. previous.Participation.Remove(this);
  1347. }
  1348. if ((value != null))
  1349. {
  1350. this.UserId = value.Id;
  1351. }
  1352. else
  1353. {
  1354. this.UserId = default(int);
  1355. }
  1356. this._user.Entity = value;
  1357. if ((value != null))
  1358. {
  1359. value.Participation.Add(this);
  1360. }
  1361. this.RaisePropertyChanged("User");
  1362. }
  1363. }
  1364. }
  1365. /// <summary>
  1366. /// Gets or sets the 'UserId' value.
  1367. /// </summary>
  1368. [DataMember()]
  1369. [RoundtripOriginal()]
  1370. public int UserId
  1371. {
  1372. get
  1373. {
  1374. return this._userId;
  1375. }
  1376. set
  1377. {
  1378. if ((this._userId != value))
  1379. {
  1380. this.OnUserIdChanging(value);
  1381. this.RaiseDataMemberChanging("UserId");
  1382. this.ValidateProperty("UserId", value);
  1383. this._userId = value;
  1384. this.RaiseDataMemberChanged("UserId");
  1385. this.OnUserIdChanged();
  1386. }
  1387. }
  1388. }
  1389. private void AttachAssignment(Assignment entity)
  1390. {
  1391. entity.Participation = this;
  1392. }
  1393. private void DetachAssignment(Assignment entity)
  1394. {
  1395. entity.Participation = null;
  1396. }
  1397. private bool FilterAssignment(Assignment entity)
  1398. {
  1399. return (entity.ParticipationId == this.Id);
  1400. }
  1401. private bool FilterCourse(Course entity)
  1402. {
  1403. return (entity.Id == this.CourseId);
  1404. }
  1405. private bool FilterUser(User entity)
  1406. {
  1407. return (entity.Id == this.UserId);
  1408. }
  1409. /// <summary>
  1410. /// Computes a value from the key fields that uniquely identifies this entity instance.
  1411. /// </summary>
  1412. /// <returns>An object instance that uniquely identifies this entity instance.</returns>
  1413. public override object GetIdentity()
  1414. {
  1415. return this._id;
  1416. }
  1417. }
  1418. /// <summary>
  1419. /// The 'Problem' entity class.
  1420. /// </summary>
  1421. [DataContract(Namespace="http://schemas.datacontract.org/2004/07/glados.Web")]
  1422. public sealed partial class Problem : Entity
  1423. {
  1424. private EntityCollection<Assignment> _assignment;
  1425. private string _filePath;
  1426. private Nullable<int> _groupId;
  1427. private int _id;
  1428. private string _name;
  1429. private EntityRef<ProblemGroup> _problemGroup;
  1430. #region Extensibility Method Definitions
  1431. /// <summary>
  1432. /// This method is invoked from the constructor once initialization is complete and
  1433. /// can be used for further object setup.
  1434. /// </summary>
  1435. partial void OnCreated();
  1436. partial void OnFilePathChanging(string value);
  1437. partial void OnFilePathChanged();
  1438. partial void OnGroupIdChanging(Nullable<int> value);
  1439. partial void OnGroupIdChanged();
  1440. partial void OnIdChanging(int value);
  1441. partial void OnIdChanged();
  1442. partial void OnNameChanging(string value);
  1443. partial void OnNameChanged();
  1444. #endregion
  1445. /// <summary>
  1446. /// Initializes a new instance of the <see cref="Problem"/> class.
  1447. /// </summary>
  1448. public Problem()
  1449. {
  1450. this.OnCreated();
  1451. }
  1452. /// <summary>
  1453. /// Gets the collection of associated <see cref="Assignment"/> entity instances.
  1454. /// </summary>
  1455. [Association("Problem_Assignment", "Id", "ProblemId")]
  1456. [XmlIgnore()]
  1457. public EntityCollection<Assignment> Assignment
  1458. {
  1459. get
  1460. {
  1461. if ((this._assignment == null))
  1462. {
  1463. this._assignment = new EntityCollection<Assignment>(this, "Assignment", this.FilterAssignment, this.AttachAssignment, this.DetachAssignment);
  1464. }
  1465. return this._assignment;
  1466. }
  1467. }
  1468. /// <summary>
  1469. /// Gets or sets the 'FilePath' value.
  1470. /// </summary>
  1471. [DataMember()]
  1472. public string FilePath
  1473. {
  1474. get
  1475. {
  1476. return this._filePath;
  1477. }
  1478. set
  1479. {
  1480. if ((this._filePath != value))
  1481. {
  1482. this.OnFilePathChanging(value);
  1483. this.RaiseDataMemberChanging("FilePath");
  1484. this.ValidateProperty("FilePath", value);
  1485. this._filePath = value;
  1486. this.RaiseDataMemberChanged("FilePath");
  1487. this.OnFilePathChanged();
  1488. }
  1489. }
  1490. }
  1491. /// <summary>
  1492. /// Gets or sets the 'GroupId' value.
  1493. /// </summary>
  1494. [DataMember()]
  1495. [RoundtripOriginal()]
  1496. public Nullable<int> GroupId
  1497. {
  1498. get
  1499. {
  1500. return this._groupId;
  1501. }
  1502. set
  1503. {
  1504. if ((this._groupId != value))
  1505. {
  1506. this.OnGroupIdChanging(value);
  1507. this.RaiseDataMemberChanging("GroupId");
  1508. this.ValidateProperty("GroupId", value);
  1509. this._groupId = value;
  1510. this.RaiseDataMemberChanged("GroupId");
  1511. this.OnGroupIdChanged();
  1512. }
  1513. }
  1514. }
  1515. /// <summary>
  1516. /// Gets or sets the 'Id' value.
  1517. /// </summary>
  1518. [DataMember()]
  1519. [Editable(false, AllowInitialValue=true)]
  1520. [Key()]
  1521. [RoundtripOriginal()]
  1522. public int Id
  1523. {
  1524. get
  1525. {
  1526. return this._id;
  1527. }
  1528. set
  1529. {
  1530. if ((this._id != value))
  1531. {
  1532. this.OnIdChanging(value);
  1533. this.ValidateProperty("Id", value);
  1534. this._id = value;
  1535. this.RaisePropertyChanged("Id");
  1536. this.OnIdChanged();
  1537. }
  1538. }
  1539. }
  1540. /// <summary>
  1541. /// Gets or sets the 'Name' value.
  1542. /// </summary>
  1543. [DataMember()]
  1544. [Required()]
  1545. public string Name
  1546. {
  1547. get
  1548. {
  1549. return this._name;
  1550. }
  1551. set
  1552. {
  1553. if ((this._name != value))
  1554. {
  1555. this.OnNameChanging(value);
  1556. this.RaiseDataMemberChanging("Name");
  1557. this.ValidateProperty("Name", value);
  1558. this._name = value;
  1559. this.RaiseDataMemberChanged("Name");
  1560. this.OnNameChanged();
  1561. }
  1562. }
  1563. }
  1564. /// <summary>
  1565. /// Gets or sets the associated <see cref="ProblemGroup"/> entity.
  1566. /// </summary>
  1567. [Association("ProblemGroup_Problem", "GroupId", "Id", IsForeignKey=true)]
  1568. [XmlIgnore()]
  1569. public ProblemGroup ProblemGroup
  1570. {
  1571. get
  1572. {
  1573. if ((this._problemGroup == null))
  1574. {
  1575. this._problemGroup = new EntityRef<ProblemGroup>(this, "ProblemGroup", this.FilterProblemGroup);
  1576. }
  1577. return this._problemGroup.Entity;
  1578. }
  1579. set
  1580. {
  1581. ProblemGroup previous = this.ProblemGroup;
  1582. if ((previous != value))
  1583. {
  1584. this.ValidateProperty("ProblemGroup", value);
  1585. if ((previous != null))
  1586. {
  1587. this._problemGroup.Entity = null;
  1588. previous.Problem.Remove(this);
  1589. }
  1590. if ((value != null))
  1591. {
  1592. this.GroupId = value.Id;
  1593. }
  1594. else
  1595. {
  1596. this.GroupId = default(Nullable<int>);
  1597. }
  1598. this._problemGroup.Entity = value;
  1599. if ((value != null))
  1600. {
  1601. value.Problem.Add(this);
  1602. }
  1603. this.RaisePropertyChanged("ProblemGroup");
  1604. }
  1605. }
  1606. }
  1607. private void AttachAssignment(Assignment entity)
  1608. {
  1609. entity.Problem = this;
  1610. }
  1611. private void DetachAssignment(Assignment entity)
  1612. {
  1613. entity.Problem = null;
  1614. }
  1615. private bool FilterAssignment(Assignment entity)
  1616. {
  1617. return (entity.ProblemId == this.Id);
  1618. }
  1619. private bool FilterProblemGroup(ProblemGroup entity)
  1620. {
  1621. return (entity.Id == this.GroupId);
  1622. }
  1623. /// <summary>
  1624. /// Computes a value from the key fields that uniquely identifies this entity instance.
  1625. /// </summary>
  1626. /// <returns>An object instance that uniquely identifies this entity instance.</returns>
  1627. public override object GetIdentity()
  1628. {
  1629. return this._id;
  1630. }
  1631. }
  1632. /// <summary>
  1633. /// The 'ProblemGroup' entity class.
  1634. /// </summary>
  1635. [DataContract(Namespace="http://schemas.datacontract.org/2004/07/glados.Web")]
  1636. public sealed partial class ProblemGroup : Entity
  1637. {
  1638. private EntityCollection<ProblemGroup> _children;
  1639. private int _id;
  1640. private string _name;
  1641. private EntityRef<ProblemGroup> _parent;
  1642. private Nullable<int> _parentId;
  1643. private EntityCollection<Problem> _problem;
  1644. #region Extensibility Method Definitions
  1645. /// <summary>
  1646. /// This method is invoked from the constructor once initialization is complete and
  1647. /// can be used for further object setup.
  1648. /// </summary>
  1649. partial void OnCreated();
  1650. partial void OnIdChanging(int value);
  1651. partial void OnIdChanged();
  1652. partial void OnNameChanging(string value);
  1653. partial void OnNameChanged();
  1654. partial void OnParentIdChanging(Nullable<int> value);
  1655. partial void OnParentIdChanged();
  1656. #endregion
  1657. /// <summary>
  1658. /// Initializes a new instance of the <see cref="ProblemGroup"/> class.
  1659. /// </summary>
  1660. public ProblemGroup()
  1661. {
  1662. this.OnCreated();
  1663. }
  1664. /// <summary>
  1665. /// Gets the collection of associated <see cref="ProblemGroup"/> entity instances.
  1666. /// </summary>
  1667. [Association("ProblemGroup_ProblemGroup", "Id", "ParentId")]
  1668. [XmlIgnore()]
  1669. public EntityCollection<ProblemGroup> Children
  1670. {
  1671. get
  1672. {
  1673. if ((this._children == null))
  1674. {
  1675. this._children = new EntityCollection<ProblemGroup>(this, "Children", this.FilterChildren, this.AttachChildren, this.DetachChildren);
  1676. }
  1677. return this._children;
  1678. }
  1679. }
  1680. /// <summary>
  1681. /// Gets or sets the 'Id' value.
  1682. /// </summary>
  1683. [DataMember()]
  1684. [Editable(false, AllowInitialValue=true)]
  1685. [Key()]
  1686. [RoundtripOriginal()]
  1687. public int Id
  1688. {
  1689. get
  1690. {
  1691. return this._id;
  1692. }
  1693. set
  1694. {
  1695. if ((this._id != value))
  1696. {
  1697. this.OnIdChanging(value);
  1698. this.ValidateProperty("Id", value);
  1699. this._id = value;
  1700. this.RaisePropertyChanged("Id");
  1701. this.OnIdChanged();
  1702. }
  1703. }
  1704. }
  1705. /// <summary>
  1706. /// Gets or sets the 'Name' value.
  1707. /// </summary>
  1708. [DataMember()]
  1709. [Required()]
  1710. public string Name
  1711. {
  1712. get
  1713. {
  1714. return this._name;
  1715. }
  1716. set
  1717. {
  1718. if ((this._name != value))
  1719. {
  1720. this.OnNameChanging(value);
  1721. this.RaiseDataMemberChanging("Name");
  1722. this.ValidateProperty("Name", value);
  1723. this._name = value;
  1724. this.RaiseDataMemberChanged("Name");
  1725. this.OnNameChanged();
  1726. }
  1727. }
  1728. }
  1729. /// <summary>
  1730. /// Gets or sets the associated <see cref="ProblemGroup"/> entity.
  1731. /// </summary>
  1732. [Association("ProblemGroup_ProblemGroup", "ParentId", "Id", IsForeignKey=true)]
  1733. [XmlIgnore()]
  1734. public ProblemGroup Parent
  1735. {
  1736. get
  1737. {
  1738. if ((this._parent == null))
  1739. {
  1740. this._parent = new EntityRef<ProblemGroup>(this, "Parent", this.FilterParent);
  1741. }
  1742. return this._parent.Entity;
  1743. }
  1744. set
  1745. {
  1746. ProblemGroup previous = this.Parent;
  1747. if ((previous != value))
  1748. {
  1749. this.ValidateProperty("Parent", value);
  1750. if ((previous != null))
  1751. {
  1752. this._parent.Entity = null;
  1753. previous.Children.Remove(this);
  1754. }
  1755. if ((value != null))
  1756. {
  1757. this.ParentId = value.Id;
  1758. }
  1759. else
  1760. {
  1761. this.ParentId = default(Nullable<int>);
  1762. }
  1763. this._parent.Entity = value;
  1764. if ((value != null))
  1765. {
  1766. value.Children.Add(this);
  1767. }
  1768. this.RaisePropertyChanged("Parent");
  1769. }
  1770. }
  1771. }
  1772. /// <summary>
  1773. /// Gets or sets the 'ParentId' value.
  1774. /// </summary>
  1775. [DataMember()]
  1776. [RoundtripOriginal()]
  1777. public Nullable<int> ParentId
  1778. {
  1779. get
  1780. {
  1781. return this._parentId;
  1782. }
  1783. set
  1784. {
  1785. if ((this._parentId != value))
  1786. {
  1787. this.OnParentIdChanging(value);
  1788. this.RaiseDataMemberChanging("ParentId");
  1789. this.ValidateProperty("ParentId", value);
  1790. this._parentId = value;
  1791. this.RaiseDataMemberChanged("ParentId");
  1792. this.OnParentIdChanged();
  1793. }
  1794. }
  1795. }
  1796. /// <summary>
  1797. /// Gets the collection of associated <see cref="Problem"/> entity instances.
  1798. /// </summary>
  1799. [Association("ProblemGroup_Problem", "Id", "GroupId")]
  1800. [XmlIgnore()]
  1801. public EntityCollection<Problem> Problem
  1802. {
  1803. get
  1804. {
  1805. if ((this._problem == null))
  1806. {
  1807. this._problem = new EntityCollection<Problem>(this, "Problem", this.FilterProblem, this.AttachProblem, this.DetachProblem);
  1808. }
  1809. return this._problem;
  1810. }
  1811. }
  1812. private void AttachChildren(ProblemGroup entity)
  1813. {
  1814. entity.Parent = this;
  1815. }
  1816. private void DetachChildren(ProblemGroup entity)
  1817. {
  1818. entity.Parent = null;
  1819. }
  1820. private bool FilterChildren(ProblemGroup entity)
  1821. {
  1822. return (entity.ParentId == this.Id);
  1823. }
  1824. private bool FilterParent(ProblemGroup entity)
  1825. {
  1826. return (entity.Id == this.ParentId);
  1827. }
  1828. private void AttachProblem(Problem entity)
  1829. {
  1830. entity.ProblemGroup = this;
  1831. }
  1832. private void DetachProblem(Problem entity)
  1833. {
  1834. entity.ProblemGroup = null;
  1835. }
  1836. private bool FilterProblem(Problem entity)
  1837. {
  1838. return (entity.GroupId == this.Id);
  1839. }
  1840. /// <summary>
  1841. /// Computes a value from the key fields that uniquely identifies this entity instance.
  1842. /// </summary>
  1843. /// <returns>An object instance that uniquely identifies this entity instance.</returns>
  1844. public override object GetIdentity()
  1845. {
  1846. return this._id;
  1847. }
  1848. }
  1849. /// <summary>
  1850. /// The 'Submission' entity class.
  1851. /// </summary>
  1852. [DataContract(Namespace="http://schemas.datacontract.org/2004/07/glados.Web")]
  1853. public sealed partial class Submission : Entity
  1854. {
  1855. private EntityRef<Assignment> _assignment;
  1856. private int _assignmentId;
  1857. private string _filePath;
  1858. private int _id;
  1859. private string _result;
  1860. private DateTime _time;
  1861. #region Extensibility Method Definitions
  1862. /// <summary>
  1863. /// This method is invoked from the constructor once initialization is complete and
  1864. /// can be used for further object setup.
  1865. /// </summary>
  1866. partial void OnCreated();
  1867. partial void OnAssignmentIdChanging(int value);
  1868. partial void OnAssignmentIdChanged();
  1869. partial void OnFilePathChanging(string value);
  1870. partial void OnFilePathChanged();
  1871. partial void OnIdChanging(int value);
  1872. partial void OnIdChanged();
  1873. partial void OnResultChanging(string value);
  1874. partial void OnResultChanged();
  1875. partial void OnTimeChanging(DateTime value);
  1876. partial void OnTimeChanged();
  1877. #endregion
  1878. /// <summary>
  1879. /// Initializes a new instance of the <see cref="Submission"/> class.
  1880. /// </summary>
  1881. public Submission()
  1882. {
  1883. this.OnCreated();
  1884. }
  1885. /// <summary>
  1886. /// Gets or sets the associated <see cref="Assignment"/> entity.
  1887. /// </summary>
  1888. [Association("Assignment_Submission", "AssignmentId", "Id", IsForeignKey=true)]
  1889. [XmlIgnore()]
  1890. public Assignment Assignment
  1891. {
  1892. get
  1893. {
  1894. if ((this._assignment == null))
  1895. {
  1896. this._assignment = new EntityRef<Assignment>(this, "Assignment", this.FilterAssignment);
  1897. }
  1898. return this._assignment.Entity;
  1899. }
  1900. set
  1901. {
  1902. Assignment previous = this.Assignment;
  1903. if ((previous != value))
  1904. {
  1905. this.ValidateProperty("Assignment", value);
  1906. if ((previous != null))
  1907. {
  1908. this._assignment.Entity = null;
  1909. previous.Submission.Remove(this);
  1910. }
  1911. if ((value != null))
  1912. {
  1913. this.AssignmentId = value.Id;
  1914. }
  1915. else
  1916. {
  1917. this.AssignmentId = default(int);
  1918. }
  1919. this._assignment.Entity = value;
  1920. if ((value != null))
  1921. {
  1922. value.Submission.Add(this);
  1923. }
  1924. this.RaisePropertyChanged("Assignment");
  1925. }
  1926. }
  1927. }
  1928. /// <summary>
  1929. /// Gets or sets the 'AssignmentId' value.
  1930. /// </summary>
  1931. [DataMember()]
  1932. [RoundtripOriginal()]
  1933. public int AssignmentId
  1934. {
  1935. get
  1936. {
  1937. return this._assignmentId;
  1938. }
  1939. set
  1940. {
  1941. if ((this._assignmentId != value))
  1942. {
  1943. this.OnAssignmentIdChanging(value);
  1944. this.RaiseDataMemberChanging("AssignmentId");
  1945. this.ValidateProperty("AssignmentId", value);
  1946. this._assignmentId = value;
  1947. this.RaiseDataMemberChanged("AssignmentId");
  1948. this.OnAssignmentIdChanged();
  1949. }
  1950. }
  1951. }
  1952. /// <summary>
  1953. /// Gets or sets the 'FilePath' value.
  1954. /// </summary>
  1955. [DataMember()]
  1956. public string FilePath
  1957. {
  1958. get
  1959. {
  1960. return this._filePath;
  1961. }
  1962. set
  1963. {
  1964. if ((this._filePath != value))
  1965. {
  1966. this.OnFilePathChanging(value);
  1967. this.RaiseDataMemberChanging("FilePath");
  1968. this.ValidateProperty("FilePath", value);
  1969. this._filePath = value;
  1970. this.RaiseDataMemberChanged("FilePath");
  1971. this.OnFilePathChanged();
  1972. }
  1973. }
  1974. }
  1975. /// <summary>
  1976. /// Gets or sets the 'Id' value.
  1977. /// </summary>
  1978. [DataMember()]
  1979. [Editable(false, AllowInitialValue=true)]
  1980. [Key()]
  1981. [RoundtripOriginal()]
  1982. public int Id
  1983. {
  1984. get
  1985. {
  1986. return this._id;
  1987. }
  1988. set
  1989. {
  1990. if ((this._id != value))
  1991. {
  1992. this.OnIdChanging(value);
  1993. this.ValidateProperty("Id", value);
  1994. this._id = value;
  1995. this.RaisePropertyChanged("Id");
  1996. this.OnIdChanged();
  1997. }
  1998. }
  1999. }
  2000. /// <summary>
  2001. /// Gets or sets the 'Result' value.
  2002. /// </summary>
  2003. [DataMember()]
  2004. [Required()]
  2005. public string Result
  2006. {
  2007. get
  2008. {
  2009. return this._result;
  2010. }
  2011. set
  2012. {
  2013. if ((this._result != value))
  2014. {
  2015. this.OnResultChanging(value);
  2016. this.RaiseDataMemberChanging("Result");
  2017. this.ValidateProperty("Result", value);
  2018. this._result = value;
  2019. this.RaiseDataMemberChanged("Result");
  2020. this.OnResultChanged();
  2021. }
  2022. }
  2023. }
  2024. /// <summary>
  2025. /// Gets or sets the 'Time' value.
  2026. /// </summary>
  2027. [DataMember()]
  2028. public DateTime Time
  2029. {
  2030. get
  2031. {
  2032. return this._time;
  2033. }
  2034. set
  2035. {
  2036. if ((this._time != value))
  2037. {
  2038. this.OnTimeChanging(value);
  2039. this.RaiseDataMemberChanging("Time");
  2040. this.ValidateProperty("Time", value);
  2041. this._time = value;
  2042. this.RaiseDataMemberChanged("Time");
  2043. this.OnTimeChanged();
  2044. }
  2045. }
  2046. }
  2047. private bool FilterAssignment(Assignment entity)
  2048. {
  2049. return (entity.Id == this.AssignmentId);
  2050. }
  2051. /// <summary>
  2052. /// Computes a value from the key fields that uniquely identifies this entity instance.
  2053. /// </summary>
  2054. /// <returns>An object instance that uniquely identifies this entity instance.</returns>
  2055. public override object GetIdentity()
  2056. {
  2057. return this._id;
  2058. }
  2059. }
  2060. /// <summary>
  2061. /// The 'User' entity class.
  2062. /// </summary>
  2063. [DataContract(Namespace="http://schemas.datacontract.org/2004/07/glados.Web")]
  2064. public sealed partial class User : Entity
  2065. {
  2066. private int _id;
  2067. private EntityCollection<Membership> _membership;
  2068. private string _name;
  2069. private EntityCollection<Participation> _participation;
  2070. private string _password;
  2071. #region Extensibility Method Definitions
  2072. /// <summary>
  2073. /// This method is invoked from the constructor once initialization is complete and
  2074. /// can be used for further object setup.
  2075. /// </summary>
  2076. partial void OnCreated();
  2077. partial void OnIdChanging(int value);
  2078. partial void OnIdChanged();
  2079. partial void OnNameChanging(string value);
  2080. partial void OnNameChanged();
  2081. partial void OnPasswordChanging(string value);
  2082. partial void OnPasswordChanged();
  2083. #endregion
  2084. /// <summary>
  2085. /// Initializes a new instance of the <see cref="User"/> class.
  2086. /// </summary>
  2087. public User()
  2088. {
  2089. this.OnCreated();
  2090. }
  2091. /// <summary>
  2092. /// Gets or sets the 'Id' value.
  2093. /// </summary>
  2094. [DataMember()]
  2095. [Editable(false, AllowInitialValue=true)]
  2096. [Key()]
  2097. [RoundtripOriginal()]
  2098. public int Id
  2099. {
  2100. get
  2101. {
  2102. return this._id;
  2103. }
  2104. set
  2105. {
  2106. if ((this._id != value))
  2107. {
  2108. this.OnIdChanging(value);
  2109. this.ValidateProperty("Id", value);
  2110. this._id = value;
  2111. this.RaisePropertyChanged("Id");
  2112. this.OnIdChanged();
  2113. }
  2114. }
  2115. }
  2116. /// <summary>
  2117. /// Gets the collection of associated <see cref="Membership"/> entity instances.
  2118. /// </summary>
  2119. [Association("User_Membership", "Id", "UserId")]
  2120. [XmlIgnore()]
  2121. public EntityCollection<Membership> Membership
  2122. {
  2123. get
  2124. {
  2125. if ((this._membership == null))
  2126. {
  2127. this._membership = new EntityCollection<Membership>(this, "Membership", this.FilterMembership, this.AttachMembership, this.DetachMembership);
  2128. }
  2129. return this._membership;
  2130. }
  2131. }
  2132. /// <summary>
  2133. /// Gets or sets the 'Name' value.
  2134. /// </summary>
  2135. [DataMember()]
  2136. [Required()]
  2137. public string Name
  2138. {
  2139. get
  2140. {
  2141. return this._name;
  2142. }
  2143. set
  2144. {
  2145. if ((this._name != value))
  2146. {
  2147. this.OnNameChanging(value);
  2148. this.RaiseDataMemberChanging("Name");
  2149. this.ValidateProperty("Name", value);
  2150. this._name = value;
  2151. this.RaiseDataMemberChanged("Name");
  2152. this.OnNameChanged();
  2153. }
  2154. }
  2155. }
  2156. /// <summary>
  2157. /// Gets the collection of associated <see cref="Participation"/> entity instances.
  2158. /// </summary>
  2159. [Association("User_Participation", "Id", "UserId")]
  2160. [XmlIgnore()]
  2161. public EntityCollection<Participation> Participation
  2162. {
  2163. get
  2164. {
  2165. if ((this._participation == null))
  2166. {
  2167. this._participation = new EntityCollection<Participation>(this, "Participation", this.FilterParticipation, this.AttachParticipation, this.DetachParticipation);
  2168. }
  2169. return this._participation;
  2170. }
  2171. }
  2172. /// <summary>
  2173. /// Gets or sets the 'Password' value.
  2174. /// </summary>
  2175. [DataMember()]
  2176. [Required()]
  2177. public string Password
  2178. {
  2179. get
  2180. {
  2181. return this._password;
  2182. }
  2183. set
  2184. {
  2185. if ((this._password != value))
  2186. {
  2187. this.OnPasswordChanging(value);
  2188. this.RaiseDataMemberChanging("Password");
  2189. this.ValidateProperty("Password", value);
  2190. this._password = value;
  2191. this.RaiseDataMemberChanged("Password");
  2192. this.OnPasswordChanged();
  2193. }
  2194. }
  2195. }
  2196. private void AttachMembership(Membership entity)
  2197. {
  2198. entity.User = this;
  2199. }
  2200. private void DetachMembership(Membership entity)
  2201. {
  2202. entity.User = null;
  2203. }
  2204. private bool FilterMembership(Membership entity)
  2205. {
  2206. return (entity.UserId == this.Id);
  2207. }
  2208. private void AttachParticipation(Participation entity)
  2209. {
  2210. entity.User = this;
  2211. }
  2212. private void DetachParticipation(Participation entity)
  2213. {
  2214. entity.User = null;
  2215. }
  2216. private bool FilterParticipation(Participation entity)
  2217. {
  2218. return (entity.UserId == this.Id);
  2219. }
  2220. /// <summary>
  2221. /// Computes a value from the key fields that uniquely identifies this entity instance.
  2222. /// </summary>
  2223. /// <returns>An object instance that uniquely identifies this entity instance.</returns>
  2224. public override object GetIdentity()
  2225. {
  2226. return this._id;
  2227. }
  2228. }
  2229. }
  2230. namespace glados.Web.Services
  2231. {
  2232. using System;
  2233. using System.Collections.Generic;
  2234. using System.ComponentModel;
  2235. using System.ComponentModel.DataAnnotations;
  2236. using System.Linq;
  2237. using System.ServiceModel;
  2238. using System.ServiceModel.DomainServices;
  2239. using System.ServiceModel.DomainServices.Client;
  2240. using System.ServiceModel.DomainServices.Client.ApplicationServices;
  2241. using System.ServiceModel.Web;
  2242. using glados.Web;
  2243. using glados.Web.Services.Entities;
  2244. /// <summary>
  2245. /// The DomainContext corresponding to the 'StatusService' DomainService.
  2246. /// </summary>
  2247. public sealed partial class StatusContext : DomainContext
  2248. {
  2249. #region Extensibility Method Definitions
  2250. /// <summary>
  2251. /// This method is invoked from the constructor once initialization is complete and
  2252. /// can be used for further object setup.
  2253. /// </summary>
  2254. partial void OnCreated();
  2255. #endregion
  2256. /// <summary>
  2257. /// Initializes a new instance of the <see cref="StatusContext"/> class.
  2258. /// </summary>
  2259. public StatusContext() :
  2260. this(new WebDomainClient<IStatusServiceContract>(new Uri("glados-Web-Services-StatusService.svc", UriKind.Relative)))
  2261. {
  2262. }
  2263. /// <summary>
  2264. /// Initializes a new instance of the <see cref="StatusContext"/> class with the specified service URI.
  2265. /// </summary>
  2266. /// <param name="serviceUri">The StatusService service URI.</param>
  2267. public StatusContext(Uri serviceUri) :
  2268. this(new WebDomainClient<IStatusServiceContract>(serviceUri))
  2269. {
  2270. }
  2271. /// <summary>
  2272. /// Initializes a new instance of the <see cref="StatusContext"/> class with the specified <paramref name="domainClient"/>.
  2273. /// </summary>
  2274. /// <param name="domainClient">The DomainClient instance to use for this DomainContext.</param>
  2275. public StatusContext(DomainClient domainClient) :
  2276. base(domainClient)
  2277. {
  2278. this.OnCreated();
  2279. }
  2280. /// <summary>
  2281. /// Gets the set of <see cref="TestingMachineEntity"/> entity instances that have been loaded into this <see cref="StatusContext"/> instance.
  2282. /// </summary>
  2283. public EntitySet<TestingMachineEntity> TestingMachineEntities
  2284. {
  2285. get
  2286. {
  2287. return base.EntityContainer.GetEntitySet<TestingMachineEntity>();
  2288. }
  2289. }
  2290. /// <summary>
  2291. /// Gets an EntityQuery instance that can be used to load <see cref="TestingMachineEntity"/> entity instances using the 'GetTesterStatus' query.
  2292. /// </summary>
  2293. /// <returns>An EntityQuery that can be loaded to retrieve <see cref="TestingMachineEntity"/> entity instances.</returns>
  2294. public EntityQuery<TestingMachineEntity> GetTesterStatusQuery()
  2295. {
  2296. this.ValidateMethod("GetTesterStatusQuery", null);
  2297. return base.CreateQuery<TestingMachineEntity>("GetTesterStatus", null, false, true);
  2298. }
  2299. /// <summary>
  2300. /// Asynchronously invokes the 'ReloadProblemsIntoDb' method of the DomainService.
  2301. /// </summary>
  2302. /// <param name="callback">Callback to invoke when the operation completes.</param>
  2303. /// <param name="userState">Value to pass to the callback. It can be <c>null</c>.</param>
  2304. /// <returns>An operation instance that can be used to manage the asynchronous request.</returns>
  2305. public InvokeOperation ReloadProblemsIntoDb(Action<InvokeOperation> callback, object userState)
  2306. {
  2307. this.ValidateMethod("ReloadProblemsIntoDb", null);
  2308. return this.InvokeOperation("ReloadProblemsIntoDb", typeof(void), null, true, callback, userState);
  2309. }
  2310. /// <summary>
  2311. /// Asynchronously invokes the 'ReloadProblemsIntoDb' method of the DomainService.
  2312. /// </summary>
  2313. /// <returns>An operation instance that can be used to manage the asynchronous request.</returns>
  2314. public InvokeOperation ReloadProblemsIntoDb()
  2315. {
  2316. this.ValidateMethod("ReloadProblemsIntoDb", null);
  2317. return this.InvokeOperation("ReloadProblemsIntoDb", typeof(void), null, true, null, null);
  2318. }
  2319. /// <summary>
  2320. /// Asynchronously invokes the 'RetestSubmission' method of the DomainService.
  2321. /// </summary>
  2322. /// <param name="id">The value for the 'id' parameter of this action.</param>
  2323. /// <param name="callback">Callback to invoke when the operation completes.</param>
  2324. /// <param name="userState">Value to pass to the callback. It can be <c>null</c>.</param>
  2325. /// <returns>An operation instance that can be used to manage the asynchronous request.</returns>
  2326. public InvokeOperation RetestSubmission(int id, Action<InvokeOperation> callback, object userState)
  2327. {
  2328. Dictionary<string, object> parameters = new Dictionary<string, object>();
  2329. parameters.Add("id", id);
  2330. this.ValidateMethod("RetestSubmission", parameters);
  2331. return this.InvokeOperation("RetestSubmission", typeof(void), parameters, true, callback, userState);
  2332. }
  2333. /// <summary>
  2334. /// Asynchronously invokes the 'RetestSubmission' method of the DomainService.
  2335. /// </summary>
  2336. /// <param name="id">The value for the 'id' parameter of this action.</param>
  2337. /// <returns>An operation instance that can be used to manage the asynchronous request.</returns>
  2338. public InvokeOperation RetestSubmission(int id)
  2339. {
  2340. Dictionary<string, object> parameters = new Dictionary<string, object>();
  2341. parameters.Add("id", id);
  2342. this.ValidateMethod("RetestSubmission", parameters);
  2343. return this.InvokeOperation("RetestSubmission", typeof(void), parameters, true, null, null);
  2344. }
  2345. /// <summary>
  2346. /// Creates a new EntityContainer for this DomainContext's EntitySets.
  2347. /// </summary>
  2348. /// <returns>A new container instance.</returns>
  2349. protected override EntityContainer CreateEntityContainer()
  2350. {
  2351. return new StatusContextEntityContainer();
  2352. }
  2353. /// <summary>
  2354. /// Service contract for the 'StatusService' DomainService.
  2355. /// </summary>
  2356. [ServiceContract()]
  2357. public interface IStatusServiceContract
  2358. {
  2359. /// <summary>
  2360. /// Asynchronously invokes the 'GetTesterStatus' operation.
  2361. /// </summary>
  2362. /// <param name="callback">Callback to invoke on completion.</param>
  2363. /// <param name="asyncState">Optional state object.</param>
  2364. /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
  2365. [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/StatusService/GetTesterStatusDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
  2366. [OperationContract(AsyncPattern=true, Action="http://tempuri.org/StatusService/GetTesterStatus", ReplyAction="http://tempuri.org/StatusService/GetTesterStatusResponse")]
  2367. [WebGet()]
  2368. IAsyncResult BeginGetTesterStatus(AsyncCallback callback, object asyncState);
  2369. /// <summary>
  2370. /// Completes the asynchronous operation begun by 'BeginGetTesterStatus'.
  2371. /// </summary>
  2372. /// <param name="result">The IAsyncResult returned from 'BeginGetTesterStatus'.</param>
  2373. /// <returns>The 'QueryResult' returned from the 'GetTesterStatus' operation.</returns>
  2374. QueryResult<TestingMachineEntity> EndGetTesterStatus(IAsyncResult result);
  2375. /// <summary>
  2376. /// Asynchronously invokes the 'ReloadProblemsIntoDb' operation.
  2377. /// </summary>
  2378. /// <param name="callback">Callback to invoke on completion.</param>
  2379. /// <param name="asyncState">Optional state object.</param>
  2380. /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
  2381. [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/StatusService/ReloadProblemsIntoDbDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
  2382. [OperationContract(AsyncPattern=true, Action="http://tempuri.org/StatusService/ReloadProblemsIntoDb", ReplyAction="http://tempuri.org/StatusService/ReloadProblemsIntoDbResponse")]
  2383. IAsyncResult BeginReloadProblemsIntoDb(AsyncCallback callback, object asyncState);
  2384. /// <summary>
  2385. /// Completes the asynchronous operation begun by 'BeginReloadProblemsIntoDb'.
  2386. /// </summary>
  2387. /// <param name="result">The IAsyncResult returned from 'BeginReloadProblemsIntoDb'.</param>
  2388. void EndReloadProblemsIntoDb(IAsyncResult result);
  2389. /// <summary>
  2390. /// Asynchronously invokes the 'RetestSubmission' operation.
  2391. /// </summary>
  2392. /// <param name="id">The value for the 'id' parameter of this action.</param>
  2393. /// <param name="callback">Callback to invoke on completion.</param>
  2394. /// <param name="asyncState">Optional state object.</param>
  2395. /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
  2396. [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/StatusService/RetestSubmissionDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
  2397. [OperationContract(AsyncPattern=true, Action="http://tempuri.org/StatusService/RetestSubmission", ReplyAction="http://tempuri.org/StatusService/RetestSubmissionResponse")]
  2398. IAsyncResult BeginRetestSubmission(int id, AsyncCallback callback, object asyncState);
  2399. /// <summary>
  2400. /// Completes the asynchronous operation begun by 'BeginRetestSubmission'.
  2401. /// </summary>
  2402. /// <param name="result">The IAsyncResult returned from 'BeginRetestSubmission'.</param>
  2403. void EndRetestSubmission(IAsyncResult result);
  2404. }
  2405. internal sealed class StatusContextEntityContainer : EntityContainer
  2406. {
  2407. public StatusContextEntityContainer()
  2408. {
  2409. this.CreateEntitySet<TestingMachineEntity>(EntitySetOperations.None);
  2410. }
  2411. }
  2412. }
  2413. /// <summary>
  2414. /// The DomainContext corresponding to the 'TaskStructureService' DomainService.
  2415. /// </summary>
  2416. public sealed partial class TaskStructureContext : DomainContext
  2417. {
  2418. #region Extensibility Method Definitions
  2419. /// <summary>
  2420. /// This method is invoked from the constructor once initialization is complete and
  2421. /// can be used for further object setup.
  2422. /// </summary>
  2423. partial void OnCreated();
  2424. #endregion
  2425. /// <summary>
  2426. /// Initializes a new instance of the <see cref="TaskStructureContext"/> class.
  2427. /// </summary>
  2428. public TaskStructureContext() :
  2429. this(new WebDomainClient<ITaskStructureServiceContract>(new Uri("glados-Web-Services-TaskStructureService.svc", UriKind.Relative)))
  2430. {
  2431. }
  2432. /// <summary>
  2433. /// Initializes a new instance of the <see cref="TaskStructureContext"/> class with the specified service URI.
  2434. /// </summary>
  2435. /// <param name="serviceUri">The TaskStructureService service URI.</param>
  2436. public TaskStructureContext(Uri serviceUri) :
  2437. this(new WebDomainClient<ITaskStructureServiceContract>(serviceUri))
  2438. {
  2439. }
  2440. /// <summary>
  2441. /// Initializes a new instance of the <see cref="TaskStructureContext"/> class with the specified <paramref name="domainClient"/>.
  2442. /// </summary>
  2443. /// <param name="domainClient">The DomainClient instance to use for this DomainContext.</param>
  2444. public TaskStructureContext(DomainClient domainClient) :
  2445. base(domainClient)
  2446. {
  2447. this.OnCreated();
  2448. }
  2449. /// <summary>
  2450. /// Gets the set of <see cref="Assignment"/> entity instances that have been loaded into this <see cref="TaskStructureContext"/> instance.
  2451. /// </summary>
  2452. public EntitySet<Assignment> Assignments
  2453. {
  2454. get
  2455. {
  2456. return base.EntityContainer.GetEntitySet<Assignment>();
  2457. }
  2458. }
  2459. /// <summary>
  2460. /// Gets the set of <see cref="Course"/> entity instances that have been loaded into this <see cref="TaskStructureContext"/> instance.
  2461. /// </summary>
  2462. public EntitySet<Course> Courses
  2463. {
  2464. get
  2465. {
  2466. return base.EntityContainer.GetEntitySet<Course>();
  2467. }
  2468. }
  2469. /// <summary>
  2470. /// Gets the set of <see cref="Group"/> entity instances that have been loaded into this <see cref="TaskStructureContext"/> instance.
  2471. /// </summary>
  2472. public EntitySet<Group> Groups
  2473. {
  2474. get
  2475. {
  2476. return base.EntityContainer.GetEntitySet<Group>();
  2477. }
  2478. }
  2479. /// <summary>
  2480. /// Gets the set of <see cref="Membership"/> entity instances that have been loaded into this <see cref="TaskStructureContext"/> instance.
  2481. /// </summary>
  2482. public EntitySet<Membership> Memberships
  2483. {
  2484. get
  2485. {
  2486. return base.EntityContainer.GetEntitySet<Membership>();
  2487. }
  2488. }
  2489. /// <summary>
  2490. /// Gets the set of <see cref="Participation"/> entity instances that have been loaded into this <see cref="TaskStructureContext"/> instance.
  2491. /// </summary>
  2492. public EntitySet<Participation> Participations
  2493. {
  2494. get
  2495. {
  2496. return base.EntityContainer.GetEntitySet<Participation>();
  2497. }
  2498. }
  2499. /// <summary>
  2500. /// Gets the set of <see cref="ProblemGroup"/> entity instances that have been loaded into this <see cref="TaskStructureContext"/> instance.
  2501. /// </summary>
  2502. public EntitySet<ProblemGroup> ProblemGroups
  2503. {
  2504. get
  2505. {
  2506. return base.EntityContainer.GetEntitySet<ProblemGroup>();
  2507. }
  2508. }
  2509. /// <summary>
  2510. /// Gets the set of <see cref="Problem"/> entity instances that have been loaded into this <see cref="TaskStructureContext"/> instance.
  2511. /// </summary>
  2512. public EntitySet<Problem> Problems
  2513. {
  2514. get
  2515. {
  2516. return base.EntityContainer.GetEntitySet<Problem>();
  2517. }
  2518. }
  2519. /// <summary>
  2520. /// Gets the set of <see cref="Submission"/> entity instances that have been loaded into this <see cref="TaskStructureContext"/> instance.
  2521. /// </summary>
  2522. public EntitySet<Submission> Submissions
  2523. {
  2524. get
  2525. {
  2526. return base.EntityContainer.GetEntitySet<Submission>();
  2527. }
  2528. }
  2529. /// <summary>
  2530. /// Gets the set of <see cref="User"/> entity instances that have been loaded into this <see cref="TaskStructureContext"/> instance.
  2531. /// </summary>
  2532. public EntitySet<User> Users
  2533. {
  2534. get
  2535. {
  2536. return base.EntityContainer.GetEntitySet<User>();
  2537. }
  2538. }
  2539. /// <summary>
  2540. /// Gets an EntityQuery instance that can be used to load <see cref="Assignment"/> entity instances using the 'GetAssignmentSet' query.
  2541. /// </summary>
  2542. /// <returns>An EntityQuery that can be loaded to retrieve <see cref="Assignment"/> entity instances.</returns>
  2543. public EntityQuery<Assignment> GetAssignmentSetQuery()
  2544. {
  2545. this.ValidateMethod("GetAssignmentSetQuery", null);
  2546. return base.CreateQuery<Assignment>("GetAssignmentSet", null, false, true);
  2547. }
  2548. /// <summary>
  2549. /// Gets an EntityQuery instance that can be used to load <see cref="Assignment"/> entity instances using the 'GetAssignmentsForMe' query.
  2550. /// </summary>
  2551. /// <returns>An EntityQuery that can be loaded to retrieve <see cref="Assignment"/> entity instances.</returns>
  2552. public EntityQuery<Assignment> GetAssignmentsForMeQuery()
  2553. {
  2554. this.ValidateMethod("GetAssignmentsForMeQuery", null);
  2555. return base.CreateQuery<Assignment>("GetAssignmentsForMe", null, false, true);
  2556. }
  2557. /// <summary>
  2558. /// Gets an EntityQuery instance that can be used to load <see cref="Course"/> entity instances using the 'GetCourseSet' query.
  2559. /// </summary>
  2560. /// <returns>An EntityQuery that can be loaded to retrieve <see cref="Course"/> entity instances.</returns>
  2561. public EntityQuery<Course> GetCourseSetQuery()
  2562. {
  2563. this.ValidateMethod("GetCourseSetQuery", null);
  2564. return base.CreateQuery<Course>("GetCourseSet", null, false, true);
  2565. }
  2566. /// <summary>
  2567. /// Gets an EntityQuery instance that can be used to load <see cref="Group"/> entity instances using the 'GetGroupSet' query.
  2568. /// </summary>
  2569. /// <returns>An EntityQuery that can be loaded to retrieve <see cref="Group"/> entity instances.</returns>
  2570. public EntityQuery<Group> GetGroupSetQuery()
  2571. {
  2572. this.ValidateMethod("GetGroupSetQuery", null);
  2573. return base.CreateQuery<Group>("GetGroupSet", null, false, true);
  2574. }
  2575. /// <summary>
  2576. /// Gets an EntityQuery instance that can be used to load <see cref="Membership"/> entity instances using the 'GetMembershipSet' query.
  2577. /// </summary>
  2578. /// <returns>An EntityQuery that can be loaded to retrieve <see cref="Membership"/> entity instances.</returns>
  2579. public EntityQuery<Membership> GetMembershipSetQuery()
  2580. {
  2581. this.ValidateMethod("GetMembershipSetQuery", null);
  2582. return base.CreateQuery<Membership>("GetMembershipSet", null, false, true);
  2583. }
  2584. /// <summary>
  2585. /// Gets an EntityQuery instance that can be used to load <see cref="Participation"/> entity instances using the 'GetParticipationSet' query.
  2586. /// </summary>
  2587. /// <returns>An EntityQuery that can be loaded to retrieve <see cref="Participation"/> entity instances.</returns>
  2588. public EntityQuery<Participation> GetParticipationSetQuery()
  2589. {
  2590. this.ValidateMethod("GetParticipationSetQuery", null);
  2591. return base.CreateQuery<Participation>("GetParticipationSet", null, false, true);
  2592. }
  2593. /// <summary>
  2594. /// Gets an EntityQuery instance that can be used to load <see cref="ProblemGroup"/> entity instances using the 'GetProblemGroupSet' query.
  2595. /// </summary>
  2596. /// <returns>An EntityQuery that can be loaded to retrieve <see cref="ProblemGroup"/> entity instances.</returns>
  2597. public EntityQuery<ProblemGroup> GetProblemGroupSetQuery()
  2598. {
  2599. this.ValidateMethod("GetProblemGroupSetQuery", null);
  2600. return base.CreateQuery<ProblemGroup>("GetProblemGroupSet", null, false, true);
  2601. }
  2602. /// <summary>
  2603. /// Gets an EntityQuery instance that can be used to load <see cref="Problem"/> entity instances using the 'GetProblemSet' query.
  2604. /// </summary>
  2605. /// <returns>An EntityQuery that can be loaded to retrieve <see cref="Problem"/> entity instances.</returns>
  2606. public EntityQuery<Problem> GetProblemSetQuery()
  2607. {
  2608. this.ValidateMethod("GetProblemSetQuery", null);
  2609. return base.CreateQuery<Problem>("GetProblemSet", null, false, true);
  2610. }
  2611. /// <summary>
  2612. /// Gets an EntityQuery instance that can be used to load <see cref="Problem"/> entity instances using the 'GetProblemSetByGroupId' query.
  2613. /// </summary>
  2614. /// <param name="id">The value for the 'id' parameter of the query.</param>
  2615. /// <returns>An EntityQuery that can be loaded to retrieve <see cref="Problem"/> entity instances.</returns>
  2616. public EntityQuery<Problem> GetProblemSetByGroupIdQuery(int id)
  2617. {
  2618. Dictionary<string, object> parameters = new Dictionary<string, object>();
  2619. parameters.Add("id", id);
  2620. this.ValidateMethod("GetProblemSetByGroupIdQuery", parameters);
  2621. return base.CreateQuery<Problem>("GetProblemSetByGroupId", parameters, false, true);
  2622. }
  2623. /// <summary>
  2624. /// Gets an EntityQuery instance that can be used to load <see cref="Submission"/> entity instances using the 'GetSubmissionSet' query.
  2625. /// </summary>
  2626. /// <returns>An EntityQuery that can be loaded to retrieve <see cref="Submission"/> entity instances.</returns>
  2627. public EntityQuery<Submission> GetSubmissionSetQuery()
  2628. {
  2629. this.ValidateMethod("GetSubmissionSetQuery", null);
  2630. return base.CreateQuery<Submission>("GetSubmissionSet", null, false, true);
  2631. }
  2632. /// <summary>
  2633. /// Gets an EntityQuery instance that can be used to load <see cref="User"/> entity instances using the 'GetUsers' query.
  2634. /// </summary>
  2635. /// <returns>An EntityQuery that can be loaded to retrieve <see cref="User"/> entity instances.</returns>
  2636. public EntityQuery<User> GetUsersQuery()
  2637. {
  2638. this.ValidateMethod("GetUsersQuery", null);
  2639. return base.CreateQuery<User>("GetUsers", null, false, true);
  2640. }
  2641. /// <summary>
  2642. /// Creates a new EntityContainer for this DomainContext's EntitySets.
  2643. /// </summary>
  2644. /// <returns>A new container instance.</returns>
  2645. protected override EntityContainer CreateEntityContainer()
  2646. {
  2647. return new TaskStructureContextEntityContainer();
  2648. }
  2649. /// <summary>
  2650. /// Service contract for the 'TaskStructureService' DomainService.
  2651. /// </summary>
  2652. [ServiceContract()]
  2653. public interface ITaskStructureServiceContract
  2654. {
  2655. /// <summary>
  2656. /// Asynchronously invokes the 'GetAssignmentSet' operation.
  2657. /// </summary>
  2658. /// <param name="callback">Callback to invoke on completion.</param>
  2659. /// <param name="asyncState">Optional state object.</param>
  2660. /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
  2661. [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/TaskStructureService/GetAssignmentSetDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
  2662. [OperationContract(AsyncPattern=true, Action="http://tempuri.org/TaskStructureService/GetAssignmentSet", ReplyAction="http://tempuri.org/TaskStructureService/GetAssignmentSetResponse")]
  2663. [WebGet()]
  2664. IAsyncResult BeginGetAssignmentSet(AsyncCallback callback, object asyncState);
  2665. /// <summary>
  2666. /// Completes the asynchronous operation begun by 'BeginGetAssignmentSet'.
  2667. /// </summary>
  2668. /// <param name="result">The IAsyncResult returned from 'BeginGetAssignmentSet'.</param>
  2669. /// <returns>The 'QueryResult' returned from the 'GetAssignmentSet' operation.</returns>
  2670. QueryResult<Assignment> EndGetAssignmentSet(IAsyncResult result);
  2671. /// <summary>
  2672. /// Asynchronously invokes the 'GetAssignmentsForMe' operation.
  2673. /// </summary>
  2674. /// <param name="callback">Callback to invoke on completion.</param>
  2675. /// <param name="asyncState">Optional state object.</param>
  2676. /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
  2677. [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/TaskStructureService/GetAssignmentsForMeDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
  2678. [OperationContract(AsyncPattern=true, Action="http://tempuri.org/TaskStructureService/GetAssignmentsForMe", ReplyAction="http://tempuri.org/TaskStructureService/GetAssignmentsForMeResponse")]
  2679. [WebGet()]
  2680. IAsyncResult BeginGetAssignmentsForMe(AsyncCallback callback, object asyncState);
  2681. /// <summary>
  2682. /// Completes the asynchronous operation begun by 'BeginGetAssignmentsForMe'.
  2683. /// </summary>
  2684. /// <param name="result">The IAsyncResult returned from 'BeginGetAssignmentsForMe'.</param>
  2685. /// <returns>The 'QueryResult' returned from the 'GetAssignmentsForMe' operation.</returns>
  2686. QueryResult<Assignment> EndGetAssignmentsForMe(IAsyncResult result);
  2687. /// <summary>
  2688. /// Asynchronously invokes the 'GetCourseSet' operation.
  2689. /// </summary>
  2690. /// <param name="callback">Callback to invoke on completion.</param>
  2691. /// <param name="asyncState">Optional state object.</param>
  2692. /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
  2693. [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/TaskStructureService/GetCourseSetDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
  2694. [OperationContract(AsyncPattern=true, Action="http://tempuri.org/TaskStructureService/GetCourseSet", ReplyAction="http://tempuri.org/TaskStructureService/GetCourseSetResponse")]
  2695. [WebGet()]
  2696. IAsyncResult BeginGetCourseSet(AsyncCallback callback, object asyncState);
  2697. /// <summary>
  2698. /// Completes the asynchronous operation begun by 'BeginGetCourseSet'.
  2699. /// </summary>
  2700. /// <param name="result">The IAsyncResult returned from 'BeginGetCourseSet'.</param>
  2701. /// <returns>The 'QueryResult' returned from the 'GetCourseSet' operation.</returns>
  2702. QueryResult<Course> EndGetCourseSet(IAsyncResult result);
  2703. /// <summary>
  2704. /// Asynchronously invokes the 'GetGroupSet' operation.
  2705. /// </summary>
  2706. /// <param name="callback">Callback to invoke on completion.</param>
  2707. /// <param name="asyncState">Optional state object.</param>
  2708. /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
  2709. [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/TaskStructureService/GetGroupSetDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
  2710. [OperationContract(AsyncPattern=true, Action="http://tempuri.org/TaskStructureService/GetGroupSet", ReplyAction="http://tempuri.org/TaskStructureService/GetGroupSetResponse")]
  2711. [WebGet()]
  2712. IAsyncResult BeginGetGroupSet(AsyncCallback callback, object asyncState);
  2713. /// <summary>
  2714. /// Completes the asynchronous operation begun by 'BeginGetGroupSet'.
  2715. /// </summary>
  2716. /// <param name="result">The IAsyncResult returned from 'BeginGetGroupSet'.</param>
  2717. /// <returns>The 'QueryResult' returned from the 'GetGroupSet' operation.</returns>
  2718. QueryResult<Group> EndGetGroupSet(IAsyncResult result);
  2719. /// <summary>
  2720. /// Asynchronously invokes the 'GetMembershipSet' operation.
  2721. /// </summary>
  2722. /// <param name="callback">Callback to invoke on completion.</param>
  2723. /// <param name="asyncState">Optional state object.</param>
  2724. /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
  2725. [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/TaskStructureService/GetMembershipSetDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
  2726. [OperationContract(AsyncPattern=true, Action="http://tempuri.org/TaskStructureService/GetMembershipSet", ReplyAction="http://tempuri.org/TaskStructureService/GetMembershipSetResponse")]
  2727. [WebGet()]
  2728. IAsyncResult BeginGetMembershipSet(AsyncCallback callback, object asyncState);
  2729. /// <summary>
  2730. /// Completes the asynchronous operation begun by 'BeginGetMembershipSet'.
  2731. /// </summary>
  2732. /// <param name="result">The IAsyncResult returned from 'BeginGetMembershipSet'.</param>
  2733. /// <returns>The 'QueryResult' returned from the 'GetMembershipSet' operation.</returns>
  2734. QueryResult<Membership> EndGetMembershipSet(IAsyncResult result);
  2735. /// <summary>
  2736. /// Asynchronously invokes the 'GetParticipationSet' operation.
  2737. /// </summary>
  2738. /// <param name="callback">Callback to invoke on completion.</param>
  2739. /// <param name="asyncState">Optional state object.</param>
  2740. /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
  2741. [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/TaskStructureService/GetParticipationSetDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
  2742. [OperationContract(AsyncPattern=true, Action="http://tempuri.org/TaskStructureService/GetParticipationSet", ReplyAction="http://tempuri.org/TaskStructureService/GetParticipationSetResponse")]
  2743. [WebGet()]
  2744. IAsyncResult BeginGetParticipationSet(AsyncCallback callback, object asyncState);
  2745. /// <summary>
  2746. /// Completes the asynchronous operation begun by 'BeginGetParticipationSet'.
  2747. /// </summary>
  2748. /// <param name="result">The IAsyncResult returned from 'BeginGetParticipationSet'.</param>
  2749. /// <returns>The 'QueryResult' returned from the 'GetParticipationSet' operation.</returns>
  2750. QueryResult<Participation> EndGetParticipationSet(IAsyncResult result);
  2751. /// <summary>
  2752. /// Asynchronously invokes the 'GetProblemGroupSet' operation.
  2753. /// </summary>
  2754. /// <param name="callback">Callback to invoke on completion.</param>
  2755. /// <param name="asyncState">Optional state object.</param>
  2756. /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
  2757. [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/TaskStructureService/GetProblemGroupSetDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
  2758. [OperationContract(AsyncPattern=true, Action="http://tempuri.org/TaskStructureService/GetProblemGroupSet", ReplyAction="http://tempuri.org/TaskStructureService/GetProblemGroupSetResponse")]
  2759. [WebGet()]
  2760. IAsyncResult BeginGetProblemGroupSet(AsyncCallback callback, object asyncState);
  2761. /// <summary>
  2762. /// Completes the asynchronous operation begun by 'BeginGetProblemGroupSet'.
  2763. /// </summary>
  2764. /// <param name="result">The IAsyncResult returned from 'BeginGetProblemGroupSet'.</param>
  2765. /// <returns>The 'QueryResult' returned from the 'GetProblemGroupSet' operation.</returns>
  2766. QueryResult<ProblemGroup> EndGetProblemGroupSet(IAsyncResult result);
  2767. /// <summary>
  2768. /// Asynchronously invokes the 'GetProblemSet' operation.
  2769. /// </summary>
  2770. /// <param name="callback">Callback to invoke on completion.</param>
  2771. /// <param name="asyncState">Optional state object.</param>
  2772. /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
  2773. [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/TaskStructureService/GetProblemSetDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
  2774. [OperationContract(AsyncPattern=true, Action="http://tempuri.org/TaskStructureService/GetProblemSet", ReplyAction="http://tempuri.org/TaskStructureService/GetProblemSetResponse")]
  2775. [WebGet()]
  2776. IAsyncResult BeginGetProblemSet(AsyncCallback callback, object asyncState);
  2777. /// <summary>
  2778. /// Completes the asynchronous operation begun by 'BeginGetProblemSet'.
  2779. /// </summary>
  2780. /// <param name="result">The IAsyncResult returned from 'BeginGetProblemSet'.</param>
  2781. /// <returns>The 'QueryResult' returned from the 'GetProblemSet' operation.</returns>
  2782. QueryResult<Problem> EndGetProblemSet(IAsyncResult result);
  2783. /// <summary>
  2784. /// Asynchronously invokes the 'GetProblemSetByGroupId' operation.
  2785. /// </summary>
  2786. /// <param name="id">The value for the 'id' parameter of this action.</param>
  2787. /// <param name="callback">Callback to invoke on completion.</param>
  2788. /// <param name="asyncState">Optional state object.</param>
  2789. /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
  2790. [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/TaskStructureService/GetProblemSetByGroupIdDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
  2791. [OperationContract(AsyncPattern=true, Action="http://tempuri.org/TaskStructureService/GetProblemSetByGroupId", ReplyAction="http://tempuri.org/TaskStructureService/GetProblemSetByGroupIdResponse")]
  2792. [WebGet()]
  2793. IAsyncResult BeginGetProblemSetByGroupId(int id, AsyncCallback callback, object asyncState);
  2794. /// <summary>
  2795. /// Completes the asynchronous operation begun by 'BeginGetProblemSetByGroupId'.
  2796. /// </summary>
  2797. /// <param name="result">The IAsyncResult returned from 'BeginGetProblemSetByGroupId'.</param>
  2798. /// <returns>The 'QueryResult' returned from the 'GetProblemSetByGroupId' operation.</returns>
  2799. QueryResult<Problem> EndGetProblemSetByGroupId(IAsyncResult result);
  2800. /// <summary>
  2801. /// Asynchronously invokes the 'GetSubmissionSet' operation.
  2802. /// </summary>
  2803. /// <param name="callback">Callback to invoke on completion.</param>
  2804. /// <param name="asyncState">Optional state object.</param>
  2805. /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
  2806. [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/TaskStructureService/GetSubmissionSetDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
  2807. [OperationContract(AsyncPattern=true, Action="http://tempuri.org/TaskStructureService/GetSubmissionSet", ReplyAction="http://tempuri.org/TaskStructureService/GetSubmissionSetResponse")]
  2808. [WebGet()]
  2809. IAsyncResult BeginGetSubmissionSet(AsyncCallback callback, object asyncState);
  2810. /// <summary>
  2811. /// Completes the asynchronous operation begun by 'BeginGetSubmissionSet'.
  2812. /// </summary>
  2813. /// <param name="result">The IAsyncResult returned from 'BeginGetSubmissionSet'.</param>
  2814. /// <returns>The 'QueryResult' returned from the 'GetSubmissionSet' operation.</returns>
  2815. QueryResult<Submission> EndGetSubmissionSet(IAsyncResult result);
  2816. /// <summary>
  2817. /// Asynchronously invokes the 'GetUsers' operation.
  2818. /// </summary>
  2819. /// <param name="callback">Callback to invoke on completion.</param>
  2820. /// <param name="asyncState">Optional state object.</param>
  2821. /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
  2822. [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/TaskStructureService/GetUsersDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
  2823. [OperationContract(AsyncPattern=true, Action="http://tempuri.org/TaskStructureService/GetUsers", ReplyAction="http://tempuri.org/TaskStructureService/GetUsersResponse")]
  2824. [WebGet()]
  2825. IAsyncResult BeginGetUsers(AsyncCallback callback, object asyncState);
  2826. /// <summary>
  2827. /// Completes the asynchronous operation begun by 'BeginGetUsers'.
  2828. /// </summary>
  2829. /// <param name="result">The IAsyncResult returned from 'BeginGetUsers'.</param>
  2830. /// <returns>The 'QueryResult' returned from the 'GetUsers' operation.</returns>
  2831. QueryResult<User> EndGetUsers(IAsyncResult result);
  2832. /// <summary>
  2833. /// Asynchronously invokes the 'SubmitChanges' operation.
  2834. /// </summary>
  2835. /// <param name="changeSet">The change-set to submit.</param>
  2836. /// <param name="callback">Callback to invoke on completion.</param>
  2837. /// <param name="asyncState">Optional state object.</param>
  2838. /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
  2839. [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/TaskStructureService/SubmitChangesDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
  2840. [OperationContract(AsyncPattern=true, Action="http://tempuri.org/TaskStructureService/SubmitChanges", ReplyAction="http://tempuri.org/TaskStructureService/SubmitChangesResponse")]
  2841. IAsyncResult BeginSubmitChanges(IEnumerable<ChangeSetEntry> changeSet, AsyncCallback callback, object asyncState);
  2842. /// <summary>
  2843. /// Completes the asynchronous operation begun by 'BeginSubmitChanges'.
  2844. /// </summary>
  2845. /// <param name="result">The IAsyncResult returned from 'BeginSubmitChanges'.</param>
  2846. /// <returns>The collection of change-set entry elements returned from 'SubmitChanges'.</returns>
  2847. IEnumerable<ChangeSetEntry> EndSubmitChanges(IAsyncResult result);
  2848. }
  2849. internal sealed class TaskStructureContextEntityContainer : EntityContainer
  2850. {
  2851. public TaskStructureContextEntityContainer()
  2852. {
  2853. this.CreateEntitySet<Assignment>(EntitySetOperations.All);
  2854. this.CreateEntitySet<Course>(EntitySetOperations.All);
  2855. this.CreateEntitySet<Group>(EntitySetOperations.All);
  2856. this.CreateEntitySet<Membership>(EntitySetOperations.All);
  2857. this.CreateEntitySet<Participation>(EntitySetOperations.All);
  2858. this.CreateEntitySet<Problem>(EntitySetOperations.All);
  2859. this.CreateEntitySet<ProblemGroup>(EntitySetOperations.All);
  2860. this.CreateEntitySet<Submission>(EntitySetOperations.All);
  2861. this.CreateEntitySet<User>(EntitySetOperations.All);
  2862. }
  2863. }
  2864. }
  2865. }
  2866. namespace glados.Web.Services.Entities
  2867. {
  2868. using System;
  2869. using System.Collections.Generic;
  2870. using System.ComponentModel;
  2871. using System.ComponentModel.DataAnnotations;
  2872. using System.Linq;
  2873. using System.Runtime.Serialization;
  2874. using System.ServiceModel.DomainServices;
  2875. using System.ServiceModel.DomainServices.Client;
  2876. using System.ServiceModel.DomainServices.Client.ApplicationServices;
  2877. using System.Xml.Serialization;
  2878. using Glados.TestingModule.Interfaces;
  2879. /// <summary>
  2880. /// The 'ProblemDetails' class.
  2881. /// </summary>
  2882. [DataContract(Namespace="http://schemas.datacontract.org/2004/07/glados.Web.Services.Entities")]
  2883. [XmlRoot(ElementName="task")]
  2884. public sealed partial class ProblemDetails : ComplexObject
  2885. {
  2886. private string[] _compilers;
  2887. private int _id;
  2888. private string _name;
  2889. private string _statementPath;
  2890. private TestingInformation _testingInformation;
  2891. #region Extensibility Method Definitions
  2892. /// <summary>
  2893. /// This method is invoked from the constructor once initialization is complete and
  2894. /// can be used for further object setup.
  2895. /// </summary>
  2896. partial void OnCreated();
  2897. partial void OnCompilersChanging(string[] value);
  2898. partial void OnCompilersChanged();
  2899. partial void OnIdChanging(int value);
  2900. partial void OnIdChanged();
  2901. partial void OnNameChanging(string value);
  2902. partial void OnNameChanged();
  2903. partial void OnStatementPathChanging(string value);
  2904. partial void OnStatementPathChanged();
  2905. partial void OnTestingInformationChanging(TestingInformation value);
  2906. partial void OnTestingInformationChanged();
  2907. #endregion
  2908. /// <summary>
  2909. /// Initializes a new instance of the <see cref="ProblemDetails"/> class.
  2910. /// </summary>
  2911. public ProblemDetails()
  2912. {
  2913. this.OnCreated();
  2914. }
  2915. /// <summary>
  2916. /// Gets or sets the 'Compilers' value.
  2917. /// </summary>
  2918. [DataMember()]
  2919. [XmlIgnore()]
  2920. public string[] Compilers
  2921. {
  2922. get
  2923. {
  2924. return this._compilers;
  2925. }
  2926. set
  2927. {
  2928. if ((this._compilers != value))
  2929. {
  2930. this.OnCompilersChanging(value);
  2931. this.RaiseDataMemberChanging("Compilers");
  2932. this.ValidateProperty("Compilers", value);
  2933. this._compilers = value;
  2934. this.RaiseDataMemberChanged("Compilers");
  2935. this.OnCompilersChanged();
  2936. }
  2937. }
  2938. }
  2939. /// <summary>
  2940. /// Gets or sets the 'Id' value.
  2941. /// </summary>
  2942. [DataMember()]
  2943. [XmlIgnore()]
  2944. public int Id
  2945. {
  2946. get
  2947. {
  2948. return this._id;
  2949. }
  2950. set
  2951. {
  2952. if ((this._id != value))
  2953. {
  2954. this.OnIdChanging(value);
  2955. this.RaiseDataMemberChanging("Id");
  2956. this.ValidateProperty("Id", value);
  2957. this._id = value;
  2958. this.RaiseDataMemberChanged("Id");
  2959. this.OnIdChanged();
  2960. }
  2961. }
  2962. }
  2963. /// <summary>
  2964. /// Gets or sets the 'Name' value.
  2965. /// </summary>
  2966. [DataMember()]
  2967. [XmlElement(ElementName="name")]
  2968. public string Name
  2969. {
  2970. get
  2971. {
  2972. return this._name;
  2973. }
  2974. set
  2975. {
  2976. if ((this._name != value))
  2977. {
  2978. this.OnNameChanging(value);
  2979. this.RaiseDataMemberChanging("Name");
  2980. this.ValidateProperty("Name", value);
  2981. this._name = value;
  2982. this.RaiseDataMemberChanged("Name");
  2983. this.OnNameChanged();
  2984. }
  2985. }
  2986. }
  2987. /// <summary>
  2988. /// Gets or sets the 'StatementPath' value.
  2989. /// </summary>
  2990. [DataMember()]
  2991. [XmlIgnore()]
  2992. public string StatementPath
  2993. {
  2994. get
  2995. {
  2996. return this._statementPath;
  2997. }
  2998. set
  2999. {
  3000. if ((this._statementPath != value))
  3001. {
  3002. this.OnStatementPathChanging(value);
  3003. this.RaiseDataMemberChanging("StatementPath");
  3004. this.ValidateProperty("StatementPath", value);
  3005. this._statementPath = value;
  3006. this.RaiseDataMemberChanged("StatementPath");
  3007. this.OnStatementPathChanged();
  3008. }
  3009. }
  3010. }
  3011. /// <summary>
  3012. /// Gets or sets the 'TestingInformation' value.
  3013. /// </summary>
  3014. [DataMember()]
  3015. [Display(AutoGenerateField=false)]
  3016. [XmlElement(ElementName="testingInfo")]
  3017. public TestingInformation TestingInformation
  3018. {
  3019. get
  3020. {
  3021. return this._testingInformation;
  3022. }
  3023. set
  3024. {
  3025. if ((this._testingInformation != value))
  3026. {
  3027. this.OnTestingInformationChanging(value);
  3028. this.RaiseDataMemberChanging("TestingInformation");
  3029. this.ValidateProperty("TestingInformation", value);
  3030. this._testingInformation = value;
  3031. this.RaiseDataMemberChanged("TestingInformation");
  3032. this.OnTestingInformationChanged();
  3033. }
  3034. }
  3035. }
  3036. }
  3037. /// <summary>
  3038. /// The 'TaskIOFile' class.
  3039. /// </summary>
  3040. [DataContract(Namespace="http://schemas.datacontract.org/2004/07/glados.Web.Services.Entities")]
  3041. public sealed partial class TaskIOFile : ComplexObject
  3042. {
  3043. private string _name;
  3044. private string _type;
  3045. #region Extensibility Method Definitions
  3046. /// <summary>
  3047. /// This method is invoked from the constructor once initialization is complete and
  3048. /// can be used for further object setup.
  3049. /// </summary>
  3050. partial void OnCreated();
  3051. partial void OnNameChanging(string value);
  3052. partial void OnNameChanged();
  3053. partial void OnTypeChanging(string value);
  3054. partial void OnTypeChanged();
  3055. #endregion
  3056. /// <summary>
  3057. /// Initializes a new instance of the <see cref="TaskIOFile"/> class.
  3058. /// </summary>
  3059. public TaskIOFile()
  3060. {
  3061. this.OnCreated();
  3062. }
  3063. /// <summary>
  3064. /// Gets or sets the 'Name' value.
  3065. /// </summary>
  3066. [DataMember()]
  3067. [XmlText()]
  3068. public string Name
  3069. {
  3070. get
  3071. {
  3072. return this._name;
  3073. }
  3074. set
  3075. {
  3076. if ((this._name != value))
  3077. {
  3078. this.OnNameChanging(value);
  3079. this.RaiseDataMemberChanging("Name");
  3080. this.ValidateProperty("Name", value);
  3081. this._name = value;
  3082. this.RaiseDataMemberChanged("Name");
  3083. this.OnNameChanged();
  3084. }
  3085. }
  3086. }
  3087. /// <summary>
  3088. /// Gets or sets the 'Type' value.
  3089. /// </summary>
  3090. [DataMember()]
  3091. [XmlAttribute(AttributeName="type")]
  3092. public string Type
  3093. {
  3094. get
  3095. {
  3096. return this._type;
  3097. }
  3098. set
  3099. {
  3100. if ((this._type != value))
  3101. {
  3102. this.OnTypeChanging(value);
  3103. this.RaiseDataMemberChanging("Type");
  3104. this.ValidateProperty("Type", value);
  3105. this._type = value;
  3106. this.RaiseDataMemberChanged("Type");
  3107. this.OnTypeChanged();
  3108. }
  3109. }
  3110. }
  3111. }
  3112. /// <summary>
  3113. /// The 'TestDescriptor' class.
  3114. /// </summary>
  3115. [DataContract(Namespace="http://schemas.datacontract.org/2004/07/glados.Web.Services.Entities")]
  3116. public sealed partial class TestDescriptor : ComplexObject
  3117. {
  3118. private int _id;
  3119. private int _memoryLimitMb;
  3120. private float _timeLimitSec;
  3121. #region Extensibility Method Definitions
  3122. /// <summary>
  3123. /// This method is invoked from the constructor once initialization is complete and
  3124. /// can be used for further object setup.
  3125. /// </summary>
  3126. partial void OnCreated();
  3127. partial void OnIdChanging(int value);
  3128. partial void OnIdChanged();
  3129. partial void OnMemoryLimitMbChanging(int value);
  3130. partial void OnMemoryLimitMbChanged();
  3131. partial void OnTimeLimitSecChanging(float value);
  3132. partial void OnTimeLimitSecChanged();
  3133. #endregion
  3134. /// <summary>
  3135. /// Initializes a new instance of the <see cref="TestDescriptor"/> class.
  3136. /// </summary>
  3137. public TestDescriptor()
  3138. {
  3139. this.OnCreated();
  3140. }
  3141. /// <summary>
  3142. /// Gets or sets the 'Id' value.
  3143. /// </summary>
  3144. [DataMember()]
  3145. [XmlAttribute(AttributeName="id")]
  3146. public int Id
  3147. {
  3148. get
  3149. {
  3150. return this._id;
  3151. }
  3152. set
  3153. {
  3154. if ((this._id != value))
  3155. {
  3156. this.OnIdChanging(value);
  3157. this.RaiseDataMemberChanging("Id");
  3158. this.ValidateProperty("Id", value);
  3159. this._id = value;
  3160. this.RaiseDataMemberChanged("Id");
  3161. this.OnIdChanged();
  3162. }
  3163. }
  3164. }
  3165. /// <summary>
  3166. /// Gets or sets the 'MemoryLimitMb' value.
  3167. /// </summary>
  3168. [DataMember()]
  3169. [XmlAttribute(AttributeName="memoryLimit")]
  3170. public int MemoryLimitMb
  3171. {
  3172. get
  3173. {
  3174. return this._memoryLimitMb;
  3175. }
  3176. set
  3177. {
  3178. if ((this._memoryLimitMb != value))
  3179. {
  3180. this.OnMemoryLimitMbChanging(value);
  3181. this.RaiseDataMemberChanging("MemoryLimitMb");
  3182. this.ValidateProperty("MemoryLimitMb", value);
  3183. this._memoryLimitMb = value;
  3184. this.RaiseDataMemberChanged("MemoryLimitMb");
  3185. this.OnMemoryLimitMbChanged();
  3186. }
  3187. }
  3188. }
  3189. /// <summary>
  3190. /// Gets or sets the 'TimeLimitSec' value.
  3191. /// </summary>
  3192. [DataMember()]
  3193. [XmlAttribute(AttributeName="timeLimit")]
  3194. public float TimeLimitSec
  3195. {
  3196. get
  3197. {
  3198. return this._timeLimitSec;
  3199. }
  3200. set
  3201. {
  3202. if ((this._timeLimitSec != value))
  3203. {
  3204. this.OnTimeLimitSecChanging(value);
  3205. this.RaiseDataMemberChanging("TimeLimitSec");
  3206. this.ValidateProperty("TimeLimitSec", value);
  3207. this._timeLimitSec = value;
  3208. this.RaiseDataMemberChanged("TimeLimitSec");
  3209. this.OnTimeLimitSecChanged();
  3210. }
  3211. }
  3212. }
  3213. }
  3214. /// <summary>
  3215. /// The 'TestingInformation' class.
  3216. /// </summary>
  3217. [DataContract(Namespace="http://schemas.datacontract.org/2004/07/glados.Web.Services.Entities")]
  3218. public sealed partial class TestingInformation : ComplexObject
  3219. {
  3220. private TaskIOFile[] _ioFiles;
  3221. private TestDescriptor[] _tests;
  3222. #region Extensibility Method Definitions
  3223. /// <summary>
  3224. /// This method is invoked from the constructor once initialization is complete and
  3225. /// can be used for further object setup.
  3226. /// </summary>
  3227. partial void OnCreated();
  3228. partial void OnIOFilesChanging(TaskIOFile[] value);
  3229. partial void OnIOFilesChanged();
  3230. partial void OnTestsChanging(TestDescriptor[] value);
  3231. partial void OnTestsChanged();
  3232. #endregion
  3233. /// <summary>
  3234. /// Initializes a new instance of the <see cref="TestingInformation"/> class.
  3235. /// </summary>
  3236. public TestingInformation()
  3237. {
  3238. this.OnCreated();
  3239. }
  3240. /// <summary>
  3241. /// Gets or sets the 'IOFiles' value.
  3242. /// </summary>
  3243. [DataMember()]
  3244. [Display(AutoGenerateField=false)]
  3245. [XmlArray(ElementName="files")]
  3246. [XmlArrayItem(ElementName="file")]
  3247. public TaskIOFile[] IOFiles
  3248. {
  3249. get
  3250. {
  3251. return this._ioFiles;
  3252. }
  3253. set
  3254. {
  3255. if ((this._ioFiles != value))
  3256. {
  3257. this.OnIOFilesChanging(value);
  3258. this.RaiseDataMemberChanging("IOFiles");
  3259. this.ValidateProperty("IOFiles", value);
  3260. this._ioFiles = value;
  3261. this.RaiseDataMemberChanged("IOFiles");
  3262. this.OnIOFilesChanged();
  3263. }
  3264. }
  3265. }
  3266. /// <summary>
  3267. /// Gets or sets the 'Tests' value.
  3268. /// </summary>
  3269. [DataMember()]
  3270. [Display(AutoGenerateField=false)]
  3271. [XmlArray(ElementName="tests")]
  3272. [XmlArrayItem(ElementName="test")]
  3273. public TestDescriptor[] Tests
  3274. {
  3275. get
  3276. {
  3277. return this._tests;
  3278. }
  3279. set
  3280. {
  3281. if ((this._tests != value))
  3282. {
  3283. this.OnTestsChanging(value);
  3284. this.RaiseDataMemberChanging("Tests");
  3285. this.ValidateProperty("Tests", value);
  3286. this._tests = value;
  3287. this.RaiseDataMemberChanged("Tests");
  3288. this.OnTestsChanged();
  3289. }
  3290. }
  3291. }
  3292. }
  3293. /// <summary>
  3294. /// The 'TestingMachineEntity' entity class.
  3295. /// </summary>
  3296. [DataContract(Namespace="http://schemas.datacontract.org/2004/07/glados.Web.Services.Entities")]
  3297. public sealed partial class TestingMachineEntity : Entity
  3298. {
  3299. private string _name;
  3300. private ServerStatus _status;
  3301. #region Extensibility Method Definitions
  3302. /// <summary>
  3303. /// This method is invoked from the constructor once initialization is complete and
  3304. /// can be used for further object setup.
  3305. /// </summary>
  3306. partial void OnCreated();
  3307. partial void OnNameChanging(string value);
  3308. partial void OnNameChanged();
  3309. partial void OnStatusChanging(ServerStatus value);
  3310. partial void OnStatusChanged();
  3311. #endregion
  3312. /// <summary>
  3313. /// Initializes a new instance of the <see cref="TestingMachineEntity"/> class.
  3314. /// </summary>
  3315. public TestingMachineEntity()
  3316. {
  3317. this.OnCreated();
  3318. }
  3319. /// <summary>
  3320. /// Gets or sets the 'Name' value.
  3321. /// </summary>
  3322. [DataMember()]
  3323. [Editable(false, AllowInitialValue=true)]
  3324. [Key()]
  3325. [RoundtripOriginal()]
  3326. public string Name
  3327. {
  3328. get
  3329. {
  3330. return this._name;
  3331. }
  3332. set
  3333. {
  3334. if ((this._name != value))
  3335. {
  3336. this.OnNameChanging(value);
  3337. this.ValidateProperty("Name", value);
  3338. this._name = value;
  3339. this.RaisePropertyChanged("Name");
  3340. this.OnNameChanged();
  3341. }
  3342. }
  3343. }
  3344. /// <summary>
  3345. /// Gets or sets the 'Status' value.
  3346. /// </summary>
  3347. [DataMember()]
  3348. public ServerStatus Status
  3349. {
  3350. get
  3351. {
  3352. return this._status;
  3353. }
  3354. set
  3355. {
  3356. if ((this._status != value))
  3357. {
  3358. this.OnStatusChanging(value);
  3359. this.RaiseDataMemberChanging("Status");
  3360. this.ValidateProperty("Status", value);
  3361. this._status = value;
  3362. this.RaiseDataMemberChanged("Status");
  3363. this.OnStatusChanged();
  3364. }
  3365. }
  3366. }
  3367. /// <summary>
  3368. /// Computes a value from the key fields that uniquely identifies this entity instance.
  3369. /// </summary>
  3370. /// <returns>An object instance that uniquely identifies this entity instance.</returns>
  3371. public override object GetIdentity()
  3372. {
  3373. return this._name;
  3374. }
  3375. }
  3376. }
  3377. namespace glados.Web.Services.RIAServices
  3378. {
  3379. using System;
  3380. using System.Collections.Generic;
  3381. using System.ComponentModel;
  3382. using System.ComponentModel.DataAnnotations;
  3383. using System.Linq;
  3384. using System.ServiceModel;
  3385. using System.ServiceModel.DomainServices;
  3386. using System.ServiceModel.DomainServices.Client;
  3387. using System.ServiceModel.DomainServices.Client.ApplicationServices;
  3388. using glados.Web.Services.Entities;
  3389. /// <summary>
  3390. /// The DomainContext corresponding to the 'CompetitionAdminService' DomainService.
  3391. /// </summary>
  3392. public sealed partial class CompetitionAdminContext : DomainContext
  3393. {
  3394. #region Extensibility Method Definitions
  3395. /// <summary>
  3396. /// This method is invoked from the constructor once initialization is complete and
  3397. /// can be used for further object setup.
  3398. /// </summary>
  3399. partial void OnCreated();
  3400. #endregion
  3401. /// <summary>
  3402. /// Initializes a new instance of the <see cref="CompetitionAdminContext"/> class.
  3403. /// </summary>
  3404. public CompetitionAdminContext() :
  3405. this(new WebDomainClient<ICompetitionAdminServiceContract>(new Uri("glados-Web-Services-RIAServices-CompetitionAdminService.svc", UriKind.Relative)))
  3406. {
  3407. }
  3408. /// <summary>
  3409. /// Initializes a new instance of the <see cref="CompetitionAdminContext"/> class with the specified service URI.
  3410. /// </summary>
  3411. /// <param name="serviceUri">The CompetitionAdminService service URI.</param>
  3412. public CompetitionAdminContext(Uri serviceUri) :
  3413. this(new WebDomainClient<ICompetitionAdminServiceContract>(serviceUri))
  3414. {
  3415. }
  3416. /// <summary>
  3417. /// Initializes a new instance of the <see cref="CompetitionAdminContext"/> class with the specified <paramref name="domainClient"/>.
  3418. /// </summary>
  3419. /// <param name="domainClient">The DomainClient instance to use for this DomainContext.</param>
  3420. public CompetitionAdminContext(DomainClient domainClient) :
  3421. base(domainClient)
  3422. {
  3423. this.OnCreated();
  3424. }
  3425. /// <summary>
  3426. /// Asynchronously invokes the 'CreateCompetition' method of the DomainService.
  3427. /// </summary>
  3428. /// <param name="name">The value for the 'name' parameter of this action.</param>
  3429. /// <param name="typeName">The value for the 'typeName' parameter of this action.</param>
  3430. /// <param name="callback">Callback to invoke when the operation completes.</param>
  3431. /// <param name="userState">Value to pass to the callback. It can be <c>null</c>.</param>
  3432. /// <returns>An operation instance that can be used to manage the asynchronous request.</returns>
  3433. public InvokeOperation<int> CreateCompetition(string name, string typeName, Action<InvokeOperation<int>> callback, object userState)
  3434. {
  3435. Dictionary<string, object> parameters = new Dictionary<string, object>();
  3436. parameters.Add("name", name);
  3437. parameters.Add("typeName", typeName);
  3438. this.ValidateMethod("CreateCompetition", parameters);
  3439. return ((InvokeOperation<int>)(this.InvokeOperation("CreateCompetition", typeof(int), parameters, true, callback, userState)));
  3440. }
  3441. /// <summary>
  3442. /// Asynchronously invokes the 'CreateCompetition' method of the DomainService.
  3443. /// </summary>
  3444. /// <param name="name">The value for the 'name' parameter of this action.</param>
  3445. /// <param name="typeName">The value for the 'typeName' parameter of this action.</param>
  3446. /// <returns>An operation instance that can be used to manage the asynchronous request.</returns>
  3447. public InvokeOperation<int> CreateCompetition(string name, string typeName)
  3448. {
  3449. Dictionary<string, object> parameters = new Dictionary<string, object>();
  3450. parameters.Add("name", name);
  3451. parameters.Add("typeName", typeName);
  3452. this.ValidateMethod("CreateCompetition", parameters);
  3453. return ((InvokeOperation<int>)(this.InvokeOperation("CreateCompetition", typeof(int), parameters, true, null, null)));
  3454. }
  3455. /// <summary>
  3456. /// Asynchronously invokes the 'DeleteCompetition' method of the DomainService.
  3457. /// </summary>
  3458. /// <param name="id">The value for the 'id' parameter of this action.</param>
  3459. /// <param name="callback">Callback to invoke when the operation completes.</param>
  3460. /// <param name="userState">Value to pass to the callback. It can be <c>null</c>.</param>
  3461. /// <returns>An operation instance that can be used to manage the asynchronous request.</returns>
  3462. public InvokeOperation DeleteCompetition(int id, Action<InvokeOperation> callback, object userState)
  3463. {
  3464. Dictionary<string, object> parameters = new Dictionary<string, object>();
  3465. parameters.Add("id", id);
  3466. this.ValidateMethod("DeleteCompetition", parameters);
  3467. return this.InvokeOperation("DeleteCompetition", typeof(void), parameters, true, callback, userState);
  3468. }
  3469. /// <summary>
  3470. /// Asynchronously invokes the 'DeleteCompetition' method of the DomainService.
  3471. /// </summary>
  3472. /// <param name="id">The value for the 'id' parameter of this action.</param>
  3473. /// <returns>An operation instance that can be used to manage the asynchronous request.</returns>
  3474. public InvokeOperation DeleteCompetition(int id)
  3475. {
  3476. Dictionary<string, object> parameters = new Dictionary<string, object>();
  3477. parameters.Add("id", id);
  3478. this.ValidateMethod("DeleteCompetition", parameters);
  3479. return this.InvokeOperation("DeleteCompetition", typeof(void), parameters, true, null, null);
  3480. }
  3481. /// <summary>
  3482. /// Asynchronously invokes the 'GetCompetitionMainPage' method of the DomainService.
  3483. /// </summary>
  3484. /// <param name="id">The value for the 'id' parameter of this action.</param>
  3485. /// <param name="callback">Callback to invoke when the operation completes.</param>
  3486. /// <param name="userState">Value to pass to the callback. It can be <c>null</c>.</param>
  3487. /// <returns>An operation instance that can be used to manage the asynchronous request.</returns>
  3488. public InvokeOperation<Uri> GetCompetitionMainPage(int id, Action<InvokeOperation<Uri>> callback, object userState)
  3489. {
  3490. Dictionary<string, object> parameters = new Dictionary<string, object>();
  3491. parameters.Add("id", id);
  3492. this.ValidateMethod("GetCompetitionMainPage", parameters);
  3493. return ((InvokeOperation<Uri>)(this.InvokeOperation("GetCompetitionMainPage", typeof(Uri), parameters, true, callback, userState)));
  3494. }
  3495. /// <summary>
  3496. /// Asynchronously invokes the 'GetCompetitionMainPage' method of the DomainService.
  3497. /// </summary>
  3498. /// <param name="id">The value for the 'id' parameter of this action.</param>
  3499. /// <returns>An operation instance that can be used to manage the asynchronous request.</returns>
  3500. public InvokeOperation<Uri> GetCompetitionMainPage(int id)
  3501. {
  3502. Dictionary<string, object> parameters = new Dictionary<string, object>();
  3503. parameters.Add("id", id);
  3504. this.ValidateMethod("GetCompetitionMainPage", parameters);
  3505. return ((InvokeOperation<Uri>)(this.InvokeOperation("GetCompetitionMainPage", typeof(Uri), parameters, true, null, null)));
  3506. }
  3507. /// <summary>
  3508. /// Asynchronously invokes the 'GetCompetitionTypeList' method of the DomainService.
  3509. /// </summary>
  3510. /// <param name="callback">Callback to invoke when the operation completes.</param>
  3511. /// <param name="userState">Value to pass to the callback. It can be <c>null</c>.</param>
  3512. /// <returns>An operation instance that can be used to manage the asynchronous request.</returns>
  3513. public InvokeOperation<IEnumerable<string>> GetCompetitionTypeList(Action<InvokeOperation<IEnumerable<string>>> callback, object userState)
  3514. {
  3515. this.ValidateMethod("GetCompetitionTypeList", null);
  3516. return ((InvokeOperation<IEnumerable<string>>)(this.InvokeOperation("GetCompetitionTypeList", typeof(IEnumerable<string>), null, true, callback, userState)));
  3517. }
  3518. /// <summary>
  3519. /// Asynchronously invokes the 'GetCompetitionTypeList' method of the DomainService.
  3520. /// </summary>
  3521. /// <returns>An operation instance that can be used to manage the asynchronous request.</returns>
  3522. public InvokeOperation<IEnumerable<string>> GetCompetitionTypeList()
  3523. {
  3524. this.ValidateMethod("GetCompetitionTypeList", null);
  3525. return ((InvokeOperation<IEnumerable<string>>)(this.InvokeOperation("GetCompetitionTypeList", typeof(IEnumerable<string>), null, true, null, null)));
  3526. }
  3527. /// <summary>
  3528. /// Creates a new EntityContainer for this DomainContext's EntitySets.
  3529. /// </summary>
  3530. /// <returns>A new container instance.</returns>
  3531. protected override EntityContainer CreateEntityContainer()
  3532. {
  3533. return new CompetitionAdminContextEntityContainer();
  3534. }
  3535. /// <summary>
  3536. /// Service contract for the 'CompetitionAdminService' DomainService.
  3537. /// </summary>
  3538. [ServiceContract()]
  3539. public interface ICompetitionAdminServiceContract
  3540. {
  3541. /// <summary>
  3542. /// Asynchronously invokes the 'CreateCompetition' operation.
  3543. /// </summary>
  3544. /// <param name="name">The value for the 'name' parameter of this action.</param>
  3545. /// <param name="typeName">The value for the 'typeName' parameter of this action.</param>
  3546. /// <param name="callback">Callback to invoke on completion.</param>
  3547. /// <param name="asyncState">Optional state object.</param>
  3548. /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
  3549. [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/CompetitionAdminService/CreateCompetitionDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
  3550. [OperationContract(AsyncPattern=true, Action="http://tempuri.org/CompetitionAdminService/CreateCompetition", ReplyAction="http://tempuri.org/CompetitionAdminService/CreateCompetitionResponse")]
  3551. IAsyncResult BeginCreateCompetition(string name, string typeName, AsyncCallback callback, object asyncState);
  3552. /// <summary>
  3553. /// Completes the asynchronous operation begun by 'BeginCreateCompetition'.
  3554. /// </summary>
  3555. /// <param name="result">The IAsyncResult returned from 'BeginCreateCompetition'.</param>
  3556. /// <returns>The 'Int32' returned from the 'CreateCompetition' operation.</returns>
  3557. int EndCreateCompetition(IAsyncResult result);
  3558. /// <summary>
  3559. /// Asynchronously invokes the 'DeleteCompetition' operation.
  3560. /// </summary>
  3561. /// <param name="id">The value for the 'id' parameter of this action.</param>
  3562. /// <param name="callback">Callback to invoke on completion.</param>
  3563. /// <param name="asyncState">Optional state object.</param>
  3564. /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
  3565. [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/CompetitionAdminService/DeleteCompetitionDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
  3566. [OperationContract(AsyncPattern=true, Action="http://tempuri.org/CompetitionAdminService/DeleteCompetition", ReplyAction="http://tempuri.org/CompetitionAdminService/DeleteCompetitionResponse")]
  3567. IAsyncResult BeginDeleteCompetition(int id, AsyncCallback callback, object asyncState);
  3568. /// <summary>
  3569. /// Completes the asynchronous operation begun by 'BeginDeleteCompetition'.
  3570. /// </summary>
  3571. /// <param name="result">The IAsyncResult returned from 'BeginDeleteCompetition'.</param>
  3572. void EndDeleteCompetition(IAsyncResult result);
  3573. /// <summary>
  3574. /// Asynchronously invokes the 'GetCompetitionMainPage' operation.
  3575. /// </summary>
  3576. /// <param name="id">The value for the 'id' parameter of this action.</param>
  3577. /// <param name="callback">Callback to invoke on completion.</param>
  3578. /// <param name="asyncState">Optional state object.</param>
  3579. /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
  3580. [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/CompetitionAdminService/GetCompetitionMainPageDomainServiceFau" +
  3581. "lt", Name="DomainServiceFault", Namespace="DomainServices")]
  3582. [OperationContract(AsyncPattern=true, Action="http://tempuri.org/CompetitionAdminService/GetCompetitionMainPage", ReplyAction="http://tempuri.org/CompetitionAdminService/GetCompetitionMainPageResponse")]
  3583. IAsyncResult BeginGetCompetitionMainPage(int id, AsyncCallback callback, object asyncState);
  3584. /// <summary>
  3585. /// Completes the asynchronous operation begun by 'BeginGetCompetitionMainPage'.
  3586. /// </summary>
  3587. /// <param name="result">The IAsyncResult returned from 'BeginGetCompetitionMainPage'.</param>
  3588. /// <returns>The 'Uri' returned from the 'GetCompetitionMainPage' operation.</returns>
  3589. Uri EndGetCompetitionMainPage(IAsyncResult result);
  3590. /// <summary>
  3591. /// Asynchronously invokes the 'GetCompetitionTypeList' operation.
  3592. /// </summary>
  3593. /// <param name="callback">Callback to invoke on completion.</param>
  3594. /// <param name="asyncState">Optional state object.</param>
  3595. /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
  3596. [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/CompetitionAdminService/GetCompetitionTypeListDomainServiceFau" +
  3597. "lt", Name="DomainServiceFault", Namespace="DomainServices")]
  3598. [OperationContract(AsyncPattern=true, Action="http://tempuri.org/CompetitionAdminService/GetCompetitionTypeList", ReplyAction="http://tempuri.org/CompetitionAdminService/GetCompetitionTypeListResponse")]
  3599. IAsyncResult BeginGetCompetitionTypeList(AsyncCallback callback, object asyncState);
  3600. /// <summary>
  3601. /// Completes the asynchronous operation begun by 'BeginGetCompetitionTypeList'.
  3602. /// </summary>
  3603. /// <param name="result">The IAsyncResult returned from 'BeginGetCompetitionTypeList'.</param>
  3604. /// <returns>The 'IEnumerable`1' returned from the 'GetCompetitionTypeList' operation.</returns>
  3605. IEnumerable<string> EndGetCompetitionTypeList(IAsyncResult result);
  3606. }
  3607. internal sealed class CompetitionAdminContextEntityContainer : EntityContainer
  3608. {
  3609. public CompetitionAdminContextEntityContainer()
  3610. {
  3611. }
  3612. }
  3613. }
  3614. /// <summary>
  3615. /// The DomainContext corresponding to the 'ParticipationService' DomainService.
  3616. /// </summary>
  3617. public sealed partial class ParticipationContext : DomainContext
  3618. {
  3619. #region Extensibility Method Definitions
  3620. /// <summary>
  3621. /// This method is invoked from the constructor once initialization is complete and
  3622. /// can be used for further object setup.
  3623. /// </summary>
  3624. partial void OnCreated();
  3625. #endregion
  3626. /// <summary>
  3627. /// Initializes a new instance of the <see cref="ParticipationContext"/> class.
  3628. /// </summary>
  3629. public ParticipationContext() :
  3630. this(new WebDomainClient<IParticipationServiceContract>(new Uri("glados-Web-Services-RIAServices-ParticipationService.svc", UriKind.Relative)))
  3631. {
  3632. }
  3633. /// <summary>
  3634. /// Initializes a new instance of the <see cref="ParticipationContext"/> class with the specified service URI.
  3635. /// </summary>
  3636. /// <param name="serviceUri">The ParticipationService service URI.</param>
  3637. public ParticipationContext(Uri serviceUri) :
  3638. this(new WebDomainClient<IParticipationServiceContract>(serviceUri))
  3639. {
  3640. }
  3641. /// <summary>
  3642. /// Initializes a new instance of the <see cref="ParticipationContext"/> class with the specified <paramref name="domainClient"/>.
  3643. /// </summary>
  3644. /// <param name="domainClient">The DomainClient instance to use for this DomainContext.</param>
  3645. public ParticipationContext(DomainClient domainClient) :
  3646. base(domainClient)
  3647. {
  3648. this.OnCreated();
  3649. }
  3650. /// <summary>
  3651. /// Asynchronously invokes the 'GetProblemByAssignmentId' method of the DomainService.
  3652. /// </summary>
  3653. /// <param name="assignmentId">The value for the 'assignmentId' parameter of this action.</param>
  3654. /// <param name="callback">Callback to invoke when the operation completes.</param>
  3655. /// <param name="userState">Value to pass to the callback. It can be <c>null</c>.</param>
  3656. /// <returns>An operation instance that can be used to manage the asynchronous request.</returns>
  3657. public InvokeOperation<ProblemDetails> GetProblemByAssignmentId(int assignmentId, Action<InvokeOperation<ProblemDetails>> callback, object userState)
  3658. {
  3659. Dictionary<string, object> parameters = new Dictionary<string, object>();
  3660. parameters.Add("assignmentId", assignmentId);
  3661. this.ValidateMethod("GetProblemByAssignmentId", parameters);
  3662. return ((InvokeOperation<ProblemDetails>)(this.InvokeOperation("GetProblemByAssignmentId", typeof(ProblemDetails), parameters, true, callback, userState)));
  3663. }
  3664. /// <summary>
  3665. /// Asynchronously invokes the 'GetProblemByAssignmentId' method of the DomainService.
  3666. /// </summary>
  3667. /// <param name="assignmentId">The value for the 'assignmentId' parameter of this action.</param>
  3668. /// <returns>An operation instance that can be used to manage the asynchronous request.</returns>
  3669. public InvokeOperation<ProblemDetails> GetProblemByAssignmentId(int assignmentId)
  3670. {
  3671. Dictionary<string, object> parameters = new Dictionary<string, object>();
  3672. parameters.Add("assignmentId", assignmentId);
  3673. this.ValidateMethod("GetProblemByAssignmentId", parameters);
  3674. return ((InvokeOperation<ProblemDetails>)(this.InvokeOperation("GetProblemByAssignmentId", typeof(ProblemDetails), parameters, true, null, null)));
  3675. }
  3676. /// <summary>
  3677. /// Asynchronously invokes the 'GetProblemDetails' method of the DomainService.
  3678. /// </summary>
  3679. /// <param name="problemId">The value for the 'problemId' parameter of this action.</param>
  3680. /// <param name="callback">Callback to invoke when the operation completes.</param>
  3681. /// <param name="userState">Value to pass to the callback. It can be <c>null</c>.</param>
  3682. /// <returns>An operation instance that can be used to manage the asynchronous request.</returns>
  3683. public InvokeOperation<ProblemDetails> GetProblemDetails(int problemId, Action<InvokeOperation<ProblemDetails>> callback, object userState)
  3684. {
  3685. Dictionary<string, object> parameters = new Dictionary<string, object>();
  3686. parameters.Add("problemId", problemId);
  3687. this.ValidateMethod("GetProblemDetails", parameters);
  3688. return ((InvokeOperation<ProblemDetails>)(this.InvokeOperation("GetProblemDetails", typeof(ProblemDetails), parameters, true, callback, userState)));
  3689. }
  3690. /// <summary>
  3691. /// Asynchronously invokes the 'GetProblemDetails' method of the DomainService.
  3692. /// </summary>
  3693. /// <param name="problemId">The value for the 'problemId' parameter of this action.</param>
  3694. /// <returns>An operation instance that can be used to manage the asynchronous request.</returns>
  3695. public InvokeOperation<ProblemDetails> GetProblemDetails(int problemId)
  3696. {
  3697. Dictionary<string, object> parameters = new Dictionary<string, object>();
  3698. parameters.Add("problemId", problemId);
  3699. this.ValidateMethod("GetProblemDetails", parameters);
  3700. return ((InvokeOperation<ProblemDetails>)(this.InvokeOperation("GetProblemDetails", typeof(ProblemDetails), parameters, true, null, null)));
  3701. }
  3702. /// <summary>
  3703. /// Asynchronously invokes the 'SubmitSolution' method of the DomainService.
  3704. /// </summary>
  3705. /// <param name="assignmentId">The value for the 'assignmentId' parameter of this action.</param>
  3706. /// <param name="compilerName">The value for the 'compilerName' parameter of this action.</param>
  3707. /// <param name="source">The value for the 'source' parameter of this action.</param>
  3708. /// <param name="callback">Callback to invoke when the operation completes.</param>
  3709. /// <param name="userState">Value to pass to the callback. It can be <c>null</c>.</param>
  3710. /// <returns>An operation instance that can be used to manage the asynchronous request.</returns>
  3711. public InvokeOperation<int> SubmitSolution(int assignmentId, string compilerName, byte[] source, Action<InvokeOperation<int>> callback, object userState)
  3712. {
  3713. Dictionary<string, object> parameters = new Dictionary<string, object>();
  3714. parameters.Add("assignmentId", assignmentId);
  3715. parameters.Add("compilerName", compilerName);
  3716. parameters.Add("source", source);
  3717. this.ValidateMethod("SubmitSolution", parameters);
  3718. return ((InvokeOperation<int>)(this.InvokeOperation("SubmitSolution", typeof(int), parameters, true, callback, userState)));
  3719. }
  3720. /// <summary>
  3721. /// Asynchronously invokes the 'SubmitSolution' method of the DomainService.
  3722. /// </summary>
  3723. /// <param name="assignmentId">The value for the 'assignmentId' parameter of this action.</param>
  3724. /// <param name="compilerName">The value for the 'compilerName' parameter of this action.</param>
  3725. /// <param name="source">The value for the 'source' parameter of this action.</param>
  3726. /// <returns>An operation instance that can be used to manage the asynchronous request.</returns>
  3727. public InvokeOperation<int> SubmitSolution(int assignmentId, string compilerName, byte[] source)
  3728. {
  3729. Dictionary<string, object> parameters = new Dictionary<string, object>();
  3730. parameters.Add("assignmentId", assignmentId);
  3731. parameters.Add("compilerName", compilerName);
  3732. parameters.Add("source", source);
  3733. this.ValidateMethod("SubmitSolution", parameters);
  3734. return ((InvokeOperation<int>)(this.InvokeOperation("SubmitSolution", typeof(int), parameters, true, null, null)));
  3735. }
  3736. /// <summary>
  3737. /// Creates a new EntityContainer for this DomainContext's EntitySets.
  3738. /// </summary>
  3739. /// <returns>A new container instance.</returns>
  3740. protected override EntityContainer CreateEntityContainer()
  3741. {
  3742. return new ParticipationContextEntityContainer();
  3743. }
  3744. /// <summary>
  3745. /// Service contract for the 'ParticipationService' DomainService.
  3746. /// </summary>
  3747. [ServiceContract()]
  3748. public interface IParticipationServiceContract
  3749. {
  3750. /// <summary>
  3751. /// Asynchronously invokes the 'GetProblemByAssignmentId' operation.
  3752. /// </summary>
  3753. /// <param name="assignmentId">The value for the 'assignmentId' parameter of this action.</param>
  3754. /// <param name="callback">Callback to invoke on completion.</param>
  3755. /// <param name="asyncState">Optional state object.</param>
  3756. /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
  3757. [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/ParticipationService/GetProblemByAssignmentIdDomainServiceFaul" +
  3758. "t", Name="DomainServiceFault", Namespace="DomainServices")]
  3759. [OperationContract(AsyncPattern=true, Action="http://tempuri.org/ParticipationService/GetProblemByAssignmentId", ReplyAction="http://tempuri.org/ParticipationService/GetProblemByAssignmentIdResponse")]
  3760. IAsyncResult BeginGetProblemByAssignmentId(int assignmentId, AsyncCallback callback, object asyncState);
  3761. /// <summary>
  3762. /// Completes the asynchronous operation begun by 'BeginGetProblemByAssignmentId'.
  3763. /// </summary>
  3764. /// <param name="result">The IAsyncResult returned from 'BeginGetProblemByAssignmentId'.</param>
  3765. /// <returns>The 'ProblemDetails' returned from the 'GetProblemByAssignmentId' operation.</returns>
  3766. ProblemDetails EndGetProblemByAssignmentId(IAsyncResult result);
  3767. /// <summary>
  3768. /// Asynchronously invokes the 'GetProblemDetails' operation.
  3769. /// </summary>
  3770. /// <param name="problemId">The value for the 'problemId' parameter of this action.</param>
  3771. /// <param name="callback">Callback to invoke on completion.</param>
  3772. /// <param name="asyncState">Optional state object.</param>
  3773. /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
  3774. [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/ParticipationService/GetProblemDetailsDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
  3775. [OperationContract(AsyncPattern=true, Action="http://tempuri.org/ParticipationService/GetProblemDetails", ReplyAction="http://tempuri.org/ParticipationService/GetProblemDetailsResponse")]
  3776. IAsyncResult BeginGetProblemDetails(int problemId, AsyncCallback callback, object asyncState);
  3777. /// <summary>
  3778. /// Completes the asynchronous operation begun by 'BeginGetProblemDetails'.
  3779. /// </summary>
  3780. /// <param name="result">The IAsyncResult returned from 'BeginGetProblemDetails'.</param>
  3781. /// <returns>The 'ProblemDetails' returned from the 'GetProblemDetails' operation.</returns>
  3782. ProblemDetails EndGetProblemDetails(IAsyncResult result);
  3783. /// <summary>
  3784. /// Asynchronously invokes the 'SubmitSolution' operation.
  3785. /// </summary>
  3786. /// <param name="assignmentId">The value for the 'assignmentId' parameter of this action.</param>
  3787. /// <param name="compilerName">The value for the 'compilerName' parameter of this action.</param>
  3788. /// <param name="source">The value for the 'source' parameter of this action.</param>
  3789. /// <param name="callback">Callback to invoke on completion.</param>
  3790. /// <param name="asyncState">Optional state object.</param>
  3791. /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
  3792. [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/ParticipationService/SubmitSolutionDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
  3793. [OperationContract(AsyncPattern=true, Action="http://tempuri.org/ParticipationService/SubmitSolution", ReplyAction="http://tempuri.org/ParticipationService/SubmitSolutionResponse")]
  3794. IAsyncResult BeginSubmitSolution(int assignmentId, string compilerName, byte[] source, AsyncCallback callback, object asyncState);
  3795. /// <summary>
  3796. /// Completes the asynchronous operation begun by 'BeginSubmitSolution'.
  3797. /// </summary>
  3798. /// <param name="result">The IAsyncResult returned from 'BeginSubmitSolution'.</param>
  3799. /// <returns>The 'Int32' returned from the 'SubmitSolution' operation.</returns>
  3800. int EndSubmitSolution(IAsyncResult result);
  3801. }
  3802. internal sealed class ParticipationContextEntityContainer : EntityContainer
  3803. {
  3804. public ParticipationContextEntityContainer()
  3805. {
  3806. }
  3807. }
  3808. }
  3809. }