PageRenderTime 65ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 1ms

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

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