PageRenderTime 68ms CodeModel.GetById 27ms RepoModel.GetById 1ms app.codeStats 0ms

/glados_proto/glados_proto/Generated_Code/glados.Web.g.cs-82f061dc

https://bitbucket.org/s_vladimir/tsys
Unknown | 2851 lines | 2543 code | 308 blank | 0 comment | 0 complexity | baaf8a2f180c6eef30fcdbc5523fbd59 MD5 | raw file
  1. //------------------------------------------------------------------------------
  2. // <auto-generated>
  3. // This code was generated by a tool.
  4. // Runtime Version:4.0.30319.431
  5. //
  6. // Changes to this file may cause incorrect behavior and will be lost if
  7. // the code is regenerated.
  8. // </auto-generated>
  9. //------------------------------------------------------------------------------
  10. namespace glados
  11. {
  12. using System;
  13. using System.Collections.Generic;
  14. using System.ComponentModel;
  15. using System.ComponentModel.DataAnnotations;
  16. using System.Linq;
  17. using System.ServiceModel.DomainServices;
  18. using System.ServiceModel.DomainServices.Client;
  19. using System.ServiceModel.DomainServices.Client.ApplicationServices;
  20. using glados.Web;
  21. /// <summary>
  22. /// Context for the RIA application.
  23. /// </summary>
  24. /// <remarks>
  25. /// This context extends the base to make application services and types available
  26. /// for consumption from code and xaml.
  27. /// </remarks>
  28. public sealed partial class WebContext : WebContextBase
  29. {
  30. #region Extensibility Method Definitions
  31. /// <summary>
  32. /// This method is invoked from the constructor once initialization is complete and
  33. /// can be used for further object setup.
  34. /// </summary>
  35. partial void OnCreated();
  36. #endregion
  37. /// <summary>
  38. /// Initializes a new instance of the WebContext class.
  39. /// </summary>
  40. public WebContext()
  41. {
  42. this.OnCreated();
  43. }
  44. /// <summary>
  45. /// Gets the context that is registered as a lifetime object with the current application.
  46. /// </summary>
  47. /// <exception cref="InvalidOperationException"> is thrown if there is no current application,
  48. /// no contexts have been added, or more than one context has been added.
  49. /// </exception>
  50. /// <seealso cref="System.Windows.Application.ApplicationLifetimeObjects"/>
  51. public new static WebContext Current
  52. {
  53. get
  54. {
  55. return ((WebContext)(WebContextBase.Current));
  56. }
  57. }
  58. /// <summary>
  59. /// Gets a user representing the authenticated identity.
  60. /// </summary>
  61. public new AuthUser User
  62. {
  63. get
  64. {
  65. return ((AuthUser)(base.User));
  66. }
  67. }
  68. }
  69. }
  70. namespace Glados.TestingModule.Interfaces
  71. {
  72. using System;
  73. using System.Collections.Generic;
  74. using System.ComponentModel;
  75. using System.ComponentModel.DataAnnotations;
  76. using System.Linq;
  77. using System.ServiceModel.DomainServices;
  78. using System.ServiceModel.DomainServices.Client;
  79. using System.ServiceModel.DomainServices.Client.ApplicationServices;
  80. public enum ServerStatus
  81. {
  82. Idle = 0,
  83. Busy = 1,
  84. InternalError = 2,
  85. Unavailable = 3,
  86. Down = 4,
  87. }
  88. }
  89. namespace glados.Web
  90. {
  91. using System;
  92. using System.Collections.Generic;
  93. using System.ComponentModel;
  94. using System.ComponentModel.DataAnnotations;
  95. using System.Linq;
  96. using System.Runtime.Serialization;
  97. using System.ServiceModel;
  98. using System.ServiceModel.DomainServices;
  99. using System.ServiceModel.DomainServices.Client;
  100. using System.ServiceModel.DomainServices.Client.ApplicationServices;
  101. using System.ServiceModel.Web;
  102. using System.Xml.Serialization;
  103. /// <summary>
  104. /// The 'Assignment' entity class.
  105. /// </summary>
  106. [DataContract(Namespace="http://schemas.datacontract.org/2004/07/glados.Web")]
  107. public sealed partial class Assignment : Entity
  108. {
  109. private int _id;
  110. private EntityRef<Participation> _participation;
  111. private int _participationId;
  112. private EntityRef<Problem> _problem;
  113. private int _problemId;
  114. private EntityCollection<Submission> _submission;
  115. #region Extensibility Method Definitions
  116. /// <summary>
  117. /// This method is invoked from the constructor once initialization is complete and
  118. /// can be used for further object setup.
  119. /// </summary>
  120. partial void OnCreated();
  121. partial void OnIdChanging(int value);
  122. partial void OnIdChanged();
  123. partial void OnParticipationIdChanging(int value);
  124. partial void OnParticipationIdChanged();
  125. partial void OnProblemIdChanging(int value);
  126. partial void OnProblemIdChanged();
  127. #endregion
  128. /// <summary>
  129. /// Initializes a new instance of the <see cref="Assignment"/> class.
  130. /// </summary>
  131. public Assignment()
  132. {
  133. this.OnCreated();
  134. }
  135. /// <summary>
  136. /// Gets or sets the 'Id' value.
  137. /// </summary>
  138. [DataMember()]
  139. [Editable(false, AllowInitialValue=true)]
  140. [Key()]
  141. [RoundtripOriginal()]
  142. public int Id
  143. {
  144. get
  145. {
  146. return this._id;
  147. }
  148. set
  149. {
  150. if ((this._id != value))
  151. {
  152. this.OnIdChanging(value);
  153. this.ValidateProperty("Id", value);
  154. this._id = value;
  155. this.RaisePropertyChanged("Id");
  156. this.OnIdChanged();
  157. }
  158. }
  159. }
  160. /// <summary>
  161. /// Gets or sets the associated <see cref="Participation"/> entity.
  162. /// </summary>
  163. [Association("Participation_Assignment", "ParticipationId", "Id", IsForeignKey=true)]
  164. [XmlIgnore()]
  165. public Participation Participation
  166. {
  167. get
  168. {
  169. if ((this._participation == null))
  170. {
  171. this._participation = new EntityRef<Participation>(this, "Participation", this.FilterParticipation);
  172. }
  173. return this._participation.Entity;
  174. }
  175. set
  176. {
  177. Participation previous = this.Participation;
  178. if ((previous != value))
  179. {
  180. this.ValidateProperty("Participation", value);
  181. if ((previous != null))
  182. {
  183. this._participation.Entity = null;
  184. previous.Assignment.Remove(this);
  185. }
  186. if ((value != null))
  187. {
  188. this.ParticipationId = value.Id;
  189. }
  190. else
  191. {
  192. this.ParticipationId = default(int);
  193. }
  194. this._participation.Entity = value;
  195. if ((value != null))
  196. {
  197. value.Assignment.Add(this);
  198. }
  199. this.RaisePropertyChanged("Participation");
  200. }
  201. }
  202. }
  203. /// <summary>
  204. /// Gets or sets the 'ParticipationId' value.
  205. /// </summary>
  206. [DataMember()]
  207. [RoundtripOriginal()]
  208. public int ParticipationId
  209. {
  210. get
  211. {
  212. return this._participationId;
  213. }
  214. set
  215. {
  216. if ((this._participationId != value))
  217. {
  218. this.OnParticipationIdChanging(value);
  219. this.RaiseDataMemberChanging("ParticipationId");
  220. this.ValidateProperty("ParticipationId", value);
  221. this._participationId = value;
  222. this.RaiseDataMemberChanged("ParticipationId");
  223. this.OnParticipationIdChanged();
  224. }
  225. }
  226. }
  227. /// <summary>
  228. /// Gets or sets the associated <see cref="Problem"/> entity.
  229. /// </summary>
  230. [Association("Problem_Assignment", "ProblemId", "Id", IsForeignKey=true)]
  231. [XmlIgnore()]
  232. public Problem Problem
  233. {
  234. get
  235. {
  236. if ((this._problem == null))
  237. {
  238. this._problem = new EntityRef<Problem>(this, "Problem", this.FilterProblem);
  239. }
  240. return this._problem.Entity;
  241. }
  242. set
  243. {
  244. Problem previous = this.Problem;
  245. if ((previous != value))
  246. {
  247. this.ValidateProperty("Problem", value);
  248. if ((previous != null))
  249. {
  250. this._problem.Entity = null;
  251. previous.Assignment.Remove(this);
  252. }
  253. if ((value != null))
  254. {
  255. this.ProblemId = value.Id;
  256. }
  257. else
  258. {
  259. this.ProblemId = default(int);
  260. }
  261. this._problem.Entity = value;
  262. if ((value != null))
  263. {
  264. value.Assignment.Add(this);
  265. }
  266. this.RaisePropertyChanged("Problem");
  267. }
  268. }
  269. }
  270. /// <summary>
  271. /// Gets or sets the 'ProblemId' value.
  272. /// </summary>
  273. [DataMember()]
  274. [RoundtripOriginal()]
  275. public int ProblemId
  276. {
  277. get
  278. {
  279. return this._problemId;
  280. }
  281. set
  282. {
  283. if ((this._problemId != value))
  284. {
  285. this.OnProblemIdChanging(value);
  286. this.RaiseDataMemberChanging("ProblemId");
  287. this.ValidateProperty("ProblemId", value);
  288. this._problemId = value;
  289. this.RaiseDataMemberChanged("ProblemId");
  290. this.OnProblemIdChanged();
  291. }
  292. }
  293. }
  294. /// <summary>
  295. /// Gets the collection of associated <see cref="Submission"/> entities.
  296. /// </summary>
  297. [Association("Assignment_Submission", "Id", "AssignmentId")]
  298. [XmlIgnore()]
  299. public EntityCollection<Submission> Submission
  300. {
  301. get
  302. {
  303. if ((this._submission == null))
  304. {
  305. this._submission = new EntityCollection<Submission>(this, "Submission", this.FilterSubmission, this.AttachSubmission, this.DetachSubmission);
  306. }
  307. return this._submission;
  308. }
  309. }
  310. private bool FilterParticipation(Participation entity)
  311. {
  312. return (entity.Id == this.ParticipationId);
  313. }
  314. private bool FilterProblem(Problem entity)
  315. {
  316. return (entity.Id == this.ProblemId);
  317. }
  318. private void AttachSubmission(Submission entity)
  319. {
  320. entity.Assignment = this;
  321. }
  322. private void DetachSubmission(Submission entity)
  323. {
  324. entity.Assignment = null;
  325. }
  326. private bool FilterSubmission(Submission entity)
  327. {
  328. return (entity.AssignmentId == this.Id);
  329. }
  330. /// <summary>
  331. /// Computes a value from the key fields that uniquely identifies this entity instance.
  332. /// </summary>
  333. /// <returns>An object instance that uniquely identifies this entity instance.</returns>
  334. public override object GetIdentity()
  335. {
  336. return this._id;
  337. }
  338. }
  339. /// <summary>
  340. /// The domain context corresponding to the 'AuthenticationDomainService' domain service.
  341. /// </summary>
  342. public sealed partial class AuthenticationDomainContext : global::System.ServiceModel.DomainServices.Client.ApplicationServices.AuthenticationDomainContextBase
  343. {
  344. #region Extensibility Method Definitions
  345. /// <summary>
  346. /// This method is invoked from the constructor once initialization is complete and
  347. /// can be used for further object setup.
  348. /// </summary>
  349. partial void OnCreated();
  350. #endregion
  351. /// <summary>
  352. /// Initializes a new instance of the <see cref="AuthenticationDomainContext"/> class.
  353. /// </summary>
  354. public AuthenticationDomainContext() :
  355. this(new WebDomainClient<IAuthenticationDomainServiceContract>(new Uri("glados-Web-AuthenticationDomainService.svc", UriKind.Relative)))
  356. {
  357. }
  358. /// <summary>
  359. /// Initializes a new instance of the <see cref="AuthenticationDomainContext"/> class with the specified service URI.
  360. /// </summary>
  361. /// <param name="serviceUri">The AuthenticationDomainService service URI.</param>
  362. public AuthenticationDomainContext(Uri serviceUri) :
  363. this(new WebDomainClient<IAuthenticationDomainServiceContract>(serviceUri))
  364. {
  365. }
  366. /// <summary>
  367. /// Initializes a new instance of the <see cref="AuthenticationDomainContext"/> class with the specified <paramref name="domainClient"/>.
  368. /// </summary>
  369. /// <param name="domainClient">The DomainClient instance to use for this domain context.</param>
  370. public AuthenticationDomainContext(DomainClient domainClient) :
  371. base(domainClient)
  372. {
  373. this.OnCreated();
  374. }
  375. /// <summary>
  376. /// Gets the set of <see cref="AuthUser"/> entities that have been loaded into this <see cref="AuthenticationDomainContext"/> instance.
  377. /// </summary>
  378. public EntitySet<AuthUser> AuthUsers
  379. {
  380. get
  381. {
  382. return base.EntityContainer.GetEntitySet<AuthUser>();
  383. }
  384. }
  385. /// <summary>
  386. /// Gets an EntityQuery instance that can be used to load <see cref="AuthUser"/> entities using the 'GetUser' query.
  387. /// </summary>
  388. /// <returns>An EntityQuery that can be loaded to retrieve <see cref="AuthUser"/> entities.</returns>
  389. public EntityQuery<AuthUser> GetUserQuery()
  390. {
  391. this.ValidateMethod("GetUserQuery", null);
  392. return base.CreateQuery<AuthUser>("GetUser", null, false, false);
  393. }
  394. /// <summary>
  395. /// Gets an EntityQuery instance that can be used to load <see cref="AuthUser"/> entities using the 'Login' query.
  396. /// </summary>
  397. /// <param name="userName">The value for the 'userName' parameter of the query.</param>
  398. /// <param name="password">The value for the 'password' parameter of the query.</param>
  399. /// <param name="isPersistent">The value for the 'isPersistent' parameter of the query.</param>
  400. /// <param name="customData">The value for the 'customData' parameter of the query.</param>
  401. /// <returns>An EntityQuery that can be loaded to retrieve <see cref="AuthUser"/> entities.</returns>
  402. public EntityQuery<AuthUser> LoginQuery(string userName, string password, bool isPersistent, string customData)
  403. {
  404. Dictionary<string, object> parameters = new Dictionary<string, object>();
  405. parameters.Add("userName", userName);
  406. parameters.Add("password", password);
  407. parameters.Add("isPersistent", isPersistent);
  408. parameters.Add("customData", customData);
  409. this.ValidateMethod("LoginQuery", parameters);
  410. return base.CreateQuery<AuthUser>("Login", parameters, true, false);
  411. }
  412. /// <summary>
  413. /// Gets an EntityQuery instance that can be used to load <see cref="AuthUser"/> entities using the 'Logout' query.
  414. /// </summary>
  415. /// <returns>An EntityQuery that can be loaded to retrieve <see cref="AuthUser"/> entities.</returns>
  416. public EntityQuery<AuthUser> LogoutQuery()
  417. {
  418. this.ValidateMethod("LogoutQuery", null);
  419. return base.CreateQuery<AuthUser>("Logout", null, true, false);
  420. }
  421. /// <summary>
  422. /// Creates a new entity container for this domain context's entity sets.
  423. /// </summary>
  424. /// <returns>A new container instance.</returns>
  425. protected override EntityContainer CreateEntityContainer()
  426. {
  427. return new AuthenticationDomainContextEntityContainer();
  428. }
  429. /// <summary>
  430. /// Service contract for the 'AuthenticationDomainService' domain service.
  431. /// </summary>
  432. [ServiceContract()]
  433. public interface IAuthenticationDomainServiceContract
  434. {
  435. /// <summary>
  436. /// Asynchronously invokes the 'GetUser' operation.
  437. /// </summary>
  438. /// <param name="callback">Callback to invoke on completion.</param>
  439. /// <param name="asyncState">Optional state object.</param>
  440. /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
  441. [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/AuthenticationDomainService/GetUserDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
  442. [OperationContract(AsyncPattern=true, Action="http://tempuri.org/AuthenticationDomainService/GetUser", ReplyAction="http://tempuri.org/AuthenticationDomainService/GetUserResponse")]
  443. [WebGet()]
  444. IAsyncResult BeginGetUser(AsyncCallback callback, object asyncState);
  445. /// <summary>
  446. /// Completes the asynchronous operation begun by 'BeginGetUser'.
  447. /// </summary>
  448. /// <param name="result">The IAsyncResult returned from 'BeginGetUser'.</param>
  449. /// <returns>The 'QueryResult' returned from the 'GetUser' operation.</returns>
  450. QueryResult<AuthUser> EndGetUser(IAsyncResult result);
  451. /// <summary>
  452. /// Asynchronously invokes the 'Login' operation.
  453. /// </summary>
  454. /// <param name="userName">The value for the 'userName' parameter of this action.</param>
  455. /// <param name="password">The value for the 'password' parameter of this action.</param>
  456. /// <param name="isPersistent">The value for the 'isPersistent' parameter of this action.</param>
  457. /// <param name="customData">The value for the 'customData' parameter of this action.</param>
  458. /// <param name="callback">Callback to invoke on completion.</param>
  459. /// <param name="asyncState">Optional state object.</param>
  460. /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
  461. [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/AuthenticationDomainService/LoginDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
  462. [OperationContract(AsyncPattern=true, Action="http://tempuri.org/AuthenticationDomainService/Login", ReplyAction="http://tempuri.org/AuthenticationDomainService/LoginResponse")]
  463. IAsyncResult BeginLogin(string userName, string password, bool isPersistent, string customData, AsyncCallback callback, object asyncState);
  464. /// <summary>
  465. /// Completes the asynchronous operation begun by 'BeginLogin'.
  466. /// </summary>
  467. /// <param name="result">The IAsyncResult returned from 'BeginLogin'.</param>
  468. /// <returns>The 'QueryResult' returned from the 'Login' operation.</returns>
  469. QueryResult<AuthUser> EndLogin(IAsyncResult result);
  470. /// <summary>
  471. /// Asynchronously invokes the 'Logout' operation.
  472. /// </summary>
  473. /// <param name="callback">Callback to invoke on completion.</param>
  474. /// <param name="asyncState">Optional state object.</param>
  475. /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
  476. [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/AuthenticationDomainService/LogoutDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
  477. [OperationContract(AsyncPattern=true, Action="http://tempuri.org/AuthenticationDomainService/Logout", ReplyAction="http://tempuri.org/AuthenticationDomainService/LogoutResponse")]
  478. IAsyncResult BeginLogout(AsyncCallback callback, object asyncState);
  479. /// <summary>
  480. /// Completes the asynchronous operation begun by 'BeginLogout'.
  481. /// </summary>
  482. /// <param name="result">The IAsyncResult returned from 'BeginLogout'.</param>
  483. /// <returns>The 'QueryResult' returned from the 'Logout' operation.</returns>
  484. QueryResult<AuthUser> EndLogout(IAsyncResult result);
  485. /// <summary>
  486. /// Asynchronously invokes the 'SubmitChanges' operation.
  487. /// </summary>
  488. /// <param name="changeSet">The change-set to submit.</param>
  489. /// <param name="callback">Callback to invoke on completion.</param>
  490. /// <param name="asyncState">Optional state object.</param>
  491. /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
  492. [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/AuthenticationDomainService/SubmitChangesDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
  493. [OperationContract(AsyncPattern=true, Action="http://tempuri.org/AuthenticationDomainService/SubmitChanges", ReplyAction="http://tempuri.org/AuthenticationDomainService/SubmitChangesResponse")]
  494. IAsyncResult BeginSubmitChanges(IEnumerable<ChangeSetEntry> changeSet, AsyncCallback callback, object asyncState);
  495. /// <summary>
  496. /// Completes the asynchronous operation begun by 'BeginSubmitChanges'.
  497. /// </summary>
  498. /// <param name="result">The IAsyncResult returned from 'BeginSubmitChanges'.</param>
  499. /// <returns>The collection of change-set entry elements returned from 'SubmitChanges'.</returns>
  500. IEnumerable<ChangeSetEntry> EndSubmitChanges(IAsyncResult result);
  501. }
  502. internal sealed class AuthenticationDomainContextEntityContainer : EntityContainer
  503. {
  504. public AuthenticationDomainContextEntityContainer()
  505. {
  506. this.CreateEntitySet<AuthUser>(EntitySetOperations.Edit);
  507. }
  508. }
  509. }
  510. /// <summary>
  511. /// The 'AuthUser' entity class.
  512. /// </summary>
  513. [DataContract(Namespace="http://schemas.datacontract.org/2004/07/glados.Web")]
  514. public sealed partial class AuthUser : Entity, global::System.Security.Principal.IIdentity, global::System.Security.Principal.IPrincipal
  515. {
  516. private string _name = string.Empty;
  517. private IEnumerable<string> _roles;
  518. #region Extensibility Method Definitions
  519. /// <summary>
  520. /// This method is invoked from the constructor once initialization is complete and
  521. /// can be used for further object setup.
  522. /// </summary>
  523. partial void OnCreated();
  524. partial void OnNameChanging(string value);
  525. partial void OnNameChanged();
  526. partial void OnRolesChanging(IEnumerable<string> value);
  527. partial void OnRolesChanged();
  528. #endregion
  529. /// <summary>
  530. /// Initializes a new instance of the <see cref="AuthUser"/> class.
  531. /// </summary>
  532. public AuthUser()
  533. {
  534. this.OnCreated();
  535. }
  536. /// <summary>
  537. /// Gets or sets the 'Name' value.
  538. /// </summary>
  539. [DataMember()]
  540. [Editable(false, AllowInitialValue=true)]
  541. [Key()]
  542. [RoundtripOriginal()]
  543. public string Name
  544. {
  545. get
  546. {
  547. return this._name;
  548. }
  549. set
  550. {
  551. if ((this._name != value))
  552. {
  553. this.OnNameChanging(value);
  554. this.ValidateProperty("Name", value);
  555. this._name = value;
  556. this.RaisePropertyChanged("Name");
  557. this.OnNameChanged();
  558. this.RaisePropertyChanged("IsAuthenticated");
  559. }
  560. }
  561. }
  562. /// <summary>
  563. /// Gets or sets the 'Roles' value.
  564. /// </summary>
  565. [DataMember()]
  566. [Editable(false)]
  567. public IEnumerable<string> Roles
  568. {
  569. get
  570. {
  571. return this._roles;
  572. }
  573. set
  574. {
  575. if ((this._roles != value))
  576. {
  577. this.OnRolesChanging(value);
  578. this.ValidateProperty("Roles", value);
  579. this._roles = value;
  580. this.RaisePropertyChanged("Roles");
  581. this.OnRolesChanged();
  582. }
  583. }
  584. }
  585. string global::System.Security.Principal.IIdentity.AuthenticationType
  586. {
  587. get
  588. {
  589. return string.Empty;
  590. }
  591. }
  592. /// <summary>
  593. /// Gets a value indicating whether the identity is authenticated.
  594. /// </summary>
  595. /// <remarks>
  596. /// This value is <c>true</c> if <see cref="Name"/> is not <c>null</c> or empty.
  597. /// </remarks>
  598. public bool IsAuthenticated
  599. {
  600. get
  601. {
  602. return (true != string.IsNullOrEmpty(this.Name));
  603. }
  604. }
  605. string global::System.Security.Principal.IIdentity.Name
  606. {
  607. get
  608. {
  609. return this.Name;
  610. }
  611. }
  612. global::System.Security.Principal.IIdentity global::System.Security.Principal.IPrincipal.Identity
  613. {
  614. get
  615. {
  616. return this;
  617. }
  618. }
  619. /// <summary>
  620. /// Computes a value from the key fields that uniquely identifies this entity instance.
  621. /// </summary>
  622. /// <returns>An object instance that uniquely identifies this entity instance.</returns>
  623. public override object GetIdentity()
  624. {
  625. return this._name;
  626. }
  627. /// <summary>
  628. /// Return whether the principal is in the role.
  629. /// </summary>
  630. /// <remarks>
  631. /// Returns whether the specified role is contained in the roles.
  632. /// This implementation is case sensitive.
  633. /// </remarks>
  634. /// <param name="role">The name of the role for which to check membership.</param>
  635. /// <returns>Whether the principal is in the role.</returns>
  636. public bool IsInRole(string role)
  637. {
  638. if ((this.Roles == null))
  639. {
  640. return false;
  641. }
  642. return global::System.Linq.Enumerable.Contains(this.Roles, role);
  643. }
  644. }
  645. /// <summary>
  646. /// The 'Course' entity class.
  647. /// </summary>
  648. [DataContract(Namespace="http://schemas.datacontract.org/2004/07/glados.Web")]
  649. public sealed partial class Course : Entity
  650. {
  651. private int _id;
  652. private string _name;
  653. private EntityCollection<Participation> _participation;
  654. #region Extensibility Method Definitions
  655. /// <summary>
  656. /// This method is invoked from the constructor once initialization is complete and
  657. /// can be used for further object setup.
  658. /// </summary>
  659. partial void OnCreated();
  660. partial void OnIdChanging(int value);
  661. partial void OnIdChanged();
  662. partial void OnNameChanging(string value);
  663. partial void OnNameChanged();
  664. #endregion
  665. /// <summary>
  666. /// Initializes a new instance of the <see cref="Course"/> class.
  667. /// </summary>
  668. public Course()
  669. {
  670. this.OnCreated();
  671. }
  672. /// <summary>
  673. /// Gets or sets the 'Id' value.
  674. /// </summary>
  675. [DataMember()]
  676. [Editable(false, AllowInitialValue=true)]
  677. [Key()]
  678. [RoundtripOriginal()]
  679. public int Id
  680. {
  681. get
  682. {
  683. return this._id;
  684. }
  685. set
  686. {
  687. if ((this._id != value))
  688. {
  689. this.OnIdChanging(value);
  690. this.ValidateProperty("Id", value);
  691. this._id = value;
  692. this.RaisePropertyChanged("Id");
  693. this.OnIdChanged();
  694. }
  695. }
  696. }
  697. /// <summary>
  698. /// Gets or sets the 'Name' value.
  699. /// </summary>
  700. [DataMember()]
  701. [Required()]
  702. public string Name
  703. {
  704. get
  705. {
  706. return this._name;
  707. }
  708. set
  709. {
  710. if ((this._name != value))
  711. {
  712. this.OnNameChanging(value);
  713. this.RaiseDataMemberChanging("Name");
  714. this.ValidateProperty("Name", value);
  715. this._name = value;
  716. this.RaiseDataMemberChanged("Name");
  717. this.OnNameChanged();
  718. }
  719. }
  720. }
  721. /// <summary>
  722. /// Gets the collection of associated <see cref="Participation"/> entities.
  723. /// </summary>
  724. [Association("Course_Participation", "Id", "CourseId")]
  725. [XmlIgnore()]
  726. public EntityCollection<Participation> Participation
  727. {
  728. get
  729. {
  730. if ((this._participation == null))
  731. {
  732. this._participation = new EntityCollection<Participation>(this, "Participation", this.FilterParticipation, this.AttachParticipation, this.DetachParticipation);
  733. }
  734. return this._participation;
  735. }
  736. }
  737. private void AttachParticipation(Participation entity)
  738. {
  739. entity.Course = this;
  740. }
  741. private void DetachParticipation(Participation entity)
  742. {
  743. entity.Course = null;
  744. }
  745. private bool FilterParticipation(Participation entity)
  746. {
  747. return (entity.CourseId == this.Id);
  748. }
  749. /// <summary>
  750. /// Computes a value from the key fields that uniquely identifies this entity instance.
  751. /// </summary>
  752. /// <returns>An object instance that uniquely identifies this entity instance.</returns>
  753. public override object GetIdentity()
  754. {
  755. return this._id;
  756. }
  757. }
  758. /// <summary>
  759. /// The 'Group' entity class.
  760. /// </summary>
  761. [DataContract(Namespace="http://schemas.datacontract.org/2004/07/glados.Web")]
  762. public sealed partial class Group : Entity
  763. {
  764. private int _id;
  765. private EntityCollection<Membership> _membership;
  766. private string _name;
  767. #region Extensibility Method Definitions
  768. /// <summary>
  769. /// This method is invoked from the constructor once initialization is complete and
  770. /// can be used for further object setup.
  771. /// </summary>
  772. partial void OnCreated();
  773. partial void OnIdChanging(int value);
  774. partial void OnIdChanged();
  775. partial void OnNameChanging(string value);
  776. partial void OnNameChanged();
  777. #endregion
  778. /// <summary>
  779. /// Initializes a new instance of the <see cref="Group"/> class.
  780. /// </summary>
  781. public Group()
  782. {
  783. this.OnCreated();
  784. }
  785. /// <summary>
  786. /// Gets or sets the 'Id' value.
  787. /// </summary>
  788. [DataMember()]
  789. [Editable(false, AllowInitialValue=true)]
  790. [Key()]
  791. [RoundtripOriginal()]
  792. public int Id
  793. {
  794. get
  795. {
  796. return this._id;
  797. }
  798. set
  799. {
  800. if ((this._id != value))
  801. {
  802. this.OnIdChanging(value);
  803. this.ValidateProperty("Id", value);
  804. this._id = value;
  805. this.RaisePropertyChanged("Id");
  806. this.OnIdChanged();
  807. }
  808. }
  809. }
  810. /// <summary>
  811. /// Gets the collection of associated <see cref="Membership"/> entities.
  812. /// </summary>
  813. [Association("Group_Membership", "Id", "GroupId")]
  814. [XmlIgnore()]
  815. public EntityCollection<Membership> Membership
  816. {
  817. get
  818. {
  819. if ((this._membership == null))
  820. {
  821. this._membership = new EntityCollection<Membership>(this, "Membership", this.FilterMembership, this.AttachMembership, this.DetachMembership);
  822. }
  823. return this._membership;
  824. }
  825. }
  826. /// <summary>
  827. /// Gets or sets the 'Name' value.
  828. /// </summary>
  829. [DataMember()]
  830. [Required()]
  831. public string Name
  832. {
  833. get
  834. {
  835. return this._name;
  836. }
  837. set
  838. {
  839. if ((this._name != value))
  840. {
  841. this.OnNameChanging(value);
  842. this.RaiseDataMemberChanging("Name");
  843. this.ValidateProperty("Name", value);
  844. this._name = value;
  845. this.RaiseDataMemberChanged("Name");
  846. this.OnNameChanged();
  847. }
  848. }
  849. }
  850. private void AttachMembership(Membership entity)
  851. {
  852. entity.Group = this;
  853. }
  854. private void DetachMembership(Membership entity)
  855. {
  856. entity.Group = null;
  857. }
  858. private bool FilterMembership(Membership entity)
  859. {
  860. return (entity.GroupId == this.Id);
  861. }
  862. /// <summary>
  863. /// Computes a value from the key fields that uniquely identifies this entity instance.
  864. /// </summary>
  865. /// <returns>An object instance that uniquely identifies this entity instance.</returns>
  866. public override object GetIdentity()
  867. {
  868. return this._id;
  869. }
  870. }
  871. /// <summary>
  872. /// The 'Membership' entity class.
  873. /// </summary>
  874. [DataContract(Namespace="http://schemas.datacontract.org/2004/07/glados.Web")]
  875. public sealed partial class Membership : Entity
  876. {
  877. private EntityRef<Group> _group;
  878. private int _groupId;
  879. private int _id;
  880. private EntityRef<User> _user;
  881. private int _userId;
  882. #region Extensibility Method Definitions
  883. /// <summary>
  884. /// This method is invoked from the constructor once initialization is complete and
  885. /// can be used for further object setup.
  886. /// </summary>
  887. partial void OnCreated();
  888. partial void OnGroupIdChanging(int value);
  889. partial void OnGroupIdChanged();
  890. partial void OnIdChanging(int value);
  891. partial void OnIdChanged();
  892. partial void OnUserIdChanging(int value);
  893. partial void OnUserIdChanged();
  894. #endregion
  895. /// <summary>
  896. /// Initializes a new instance of the <see cref="Membership"/> class.
  897. /// </summary>
  898. public Membership()
  899. {
  900. this.OnCreated();
  901. }
  902. /// <summary>
  903. /// Gets or sets the associated <see cref="Group"/> entity.
  904. /// </summary>
  905. [Association("Group_Membership", "GroupId", "Id", IsForeignKey=true)]
  906. [XmlIgnore()]
  907. public Group Group
  908. {
  909. get
  910. {
  911. if ((this._group == null))
  912. {
  913. this._group = new EntityRef<Group>(this, "Group", this.FilterGroup);
  914. }
  915. return this._group.Entity;
  916. }
  917. set
  918. {
  919. Group previous = this.Group;
  920. if ((previous != value))
  921. {
  922. this.ValidateProperty("Group", value);
  923. if ((previous != null))
  924. {
  925. this._group.Entity = null;
  926. previous.Membership.Remove(this);
  927. }
  928. if ((value != null))
  929. {
  930. this.GroupId = value.Id;
  931. }
  932. else
  933. {
  934. this.GroupId = default(int);
  935. }
  936. this._group.Entity = value;
  937. if ((value != null))
  938. {
  939. value.Membership.Add(this);
  940. }
  941. this.RaisePropertyChanged("Group");
  942. }
  943. }
  944. }
  945. /// <summary>
  946. /// Gets or sets the 'GroupId' value.
  947. /// </summary>
  948. [DataMember()]
  949. [RoundtripOriginal()]
  950. public int GroupId
  951. {
  952. get
  953. {
  954. return this._groupId;
  955. }
  956. set
  957. {
  958. if ((this._groupId != value))
  959. {
  960. this.OnGroupIdChanging(value);
  961. this.RaiseDataMemberChanging("GroupId");
  962. this.ValidateProperty("GroupId", value);
  963. this._groupId = value;
  964. this.RaiseDataMemberChanged("GroupId");
  965. this.OnGroupIdChanged();
  966. }
  967. }
  968. }
  969. /// <summary>
  970. /// Gets or sets the 'Id' value.
  971. /// </summary>
  972. [DataMember()]
  973. [Editable(false, AllowInitialValue=true)]
  974. [Key()]
  975. [RoundtripOriginal()]
  976. public int Id
  977. {
  978. get
  979. {
  980. return this._id;
  981. }
  982. set
  983. {
  984. if ((this._id != value))
  985. {
  986. this.OnIdChanging(value);
  987. this.ValidateProperty("Id", value);
  988. this._id = value;
  989. this.RaisePropertyChanged("Id");
  990. this.OnIdChanged();
  991. }
  992. }
  993. }
  994. /// <summary>
  995. /// Gets or sets the associated <see cref="User"/> entity.
  996. /// </summary>
  997. [Association("User_Membership", "UserId", "Id", IsForeignKey=true)]
  998. [XmlIgnore()]
  999. public User User
  1000. {
  1001. get
  1002. {
  1003. if ((this._user == null))
  1004. {
  1005. this._user = new EntityRef<User>(this, "User", this.FilterUser);
  1006. }
  1007. return this._user.Entity;
  1008. }
  1009. set
  1010. {
  1011. User previous = this.User;
  1012. if ((previous != value))
  1013. {
  1014. this.ValidateProperty("User", value);
  1015. if ((previous != null))
  1016. {
  1017. this._user.Entity = null;
  1018. previous.Membership.Remove(this);
  1019. }
  1020. if ((value != null))
  1021. {
  1022. this.UserId = value.Id;
  1023. }
  1024. else
  1025. {
  1026. this.UserId = default(int);
  1027. }
  1028. this._user.Entity = value;
  1029. if ((value != null))
  1030. {
  1031. value.Membership.Add(this);
  1032. }
  1033. this.RaisePropertyChanged("User");
  1034. }
  1035. }
  1036. }
  1037. /// <summary>
  1038. /// Gets or sets the 'UserId' value.
  1039. /// </summary>
  1040. [DataMember()]
  1041. [RoundtripOriginal()]
  1042. public int UserId
  1043. {
  1044. get
  1045. {
  1046. return this._userId;
  1047. }
  1048. set
  1049. {
  1050. if ((this._userId != value))
  1051. {
  1052. this.OnUserIdChanging(value);
  1053. this.RaiseDataMemberChanging("UserId");
  1054. this.ValidateProperty("UserId", value);
  1055. this._userId = value;
  1056. this.RaiseDataMemberChanged("UserId");
  1057. this.OnUserIdChanged();
  1058. }
  1059. }
  1060. }
  1061. private bool FilterGroup(Group entity)
  1062. {
  1063. return (entity.Id == this.GroupId);
  1064. }
  1065. private bool FilterUser(User entity)
  1066. {
  1067. return (entity.Id == this.UserId);
  1068. }
  1069. /// <summary>
  1070. /// Computes a value from the key fields that uniquely identifies this entity instance.
  1071. /// </summary>
  1072. /// <returns>An object instance that uniquely identifies this entity instance.</returns>
  1073. public override object GetIdentity()
  1074. {
  1075. return this._id;
  1076. }
  1077. }
  1078. /// <summary>
  1079. /// The 'Participation' entity class.
  1080. /// </summary>
  1081. [DataContract(Namespace="http://schemas.datacontract.org/2004/07/glados.Web")]
  1082. public sealed partial class Participation : Entity
  1083. {
  1084. private EntityCollection<Assignment> _assignment;
  1085. private EntityRef<Course> _course;
  1086. private int _courseId;
  1087. private int _id;
  1088. private EntityRef<User> _user;
  1089. private int _userId;
  1090. #region Extensibility Method Definitions
  1091. /// <summary>
  1092. /// This method is invoked from the constructor once initialization is complete and
  1093. /// can be used for further object setup.
  1094. /// </summary>
  1095. partial void OnCreated();
  1096. partial void OnCourseIdChanging(int value);
  1097. partial void OnCourseIdChanged();
  1098. partial void OnIdChanging(int value);
  1099. partial void OnIdChanged();
  1100. partial void OnUserIdChanging(int value);
  1101. partial void OnUserIdChanged();
  1102. #endregion
  1103. /// <summary>
  1104. /// Initializes a new instance of the <see cref="Participation"/> class.
  1105. /// </summary>
  1106. public Participation()
  1107. {
  1108. this.OnCreated();
  1109. }
  1110. /// <summary>
  1111. /// Gets the collection of associated <see cref="Assignment"/> entities.
  1112. /// </summary>
  1113. [Association("Participation_Assignment", "Id", "ParticipationId")]
  1114. [XmlIgnore()]
  1115. public EntityCollection<Assignment> Assignment
  1116. {
  1117. get
  1118. {
  1119. if ((this._assignment == null))
  1120. {
  1121. this._assignment = new EntityCollection<Assignment>(this, "Assignment", this.FilterAssignment, this.AttachAssignment, this.DetachAssignment);
  1122. }
  1123. return this._assignment;
  1124. }
  1125. }
  1126. /// <summary>
  1127. /// Gets or sets the associated <see cref="Course"/> entity.
  1128. /// </summary>
  1129. [Association("Course_Participation", "CourseId", "Id", IsForeignKey=true)]
  1130. [XmlIgnore()]
  1131. public Course Course
  1132. {
  1133. get
  1134. {
  1135. if ((this._course == null))
  1136. {
  1137. this._course = new EntityRef<Course>(this, "Course", this.FilterCourse);
  1138. }
  1139. return this._course.Entity;
  1140. }
  1141. set
  1142. {
  1143. Course previous = this.Course;
  1144. if ((previous != value))
  1145. {
  1146. this.ValidateProperty("Course", value);
  1147. if ((previous != null))
  1148. {
  1149. this._course.Entity = null;
  1150. previous.Participation.Remove(this);
  1151. }
  1152. if ((value != null))
  1153. {
  1154. this.CourseId = value.Id;
  1155. }
  1156. else
  1157. {
  1158. this.CourseId = default(int);
  1159. }
  1160. this._course.Entity = value;
  1161. if ((value != null))
  1162. {
  1163. value.Participation.Add(this);
  1164. }
  1165. this.RaisePropertyChanged("Course");
  1166. }
  1167. }
  1168. }
  1169. /// <summary>
  1170. /// Gets or sets the 'CourseId' value.
  1171. /// </summary>
  1172. [DataMember()]
  1173. [RoundtripOriginal()]
  1174. public int CourseId
  1175. {
  1176. get
  1177. {
  1178. return this._courseId;
  1179. }
  1180. set
  1181. {
  1182. if ((this._courseId != value))
  1183. {
  1184. this.OnCourseIdChanging(value);
  1185. this.RaiseDataMemberChanging("CourseId");
  1186. this.ValidateProperty("CourseId", value);
  1187. this._courseId = value;
  1188. this.RaiseDataMemberChanged("CourseId");
  1189. this.OnCourseIdChanged();
  1190. }
  1191. }
  1192. }
  1193. /// <summary>
  1194. /// Gets or sets the 'Id' value.
  1195. /// </summary>
  1196. [DataMember()]
  1197. [Editable(false, AllowInitialValue=true)]
  1198. [Key()]
  1199. [RoundtripOriginal()]
  1200. public int Id
  1201. {
  1202. get
  1203. {
  1204. return this._id;
  1205. }
  1206. set
  1207. {
  1208. if ((this._id != value))
  1209. {
  1210. this.OnIdChanging(value);
  1211. this.ValidateProperty("Id", value);
  1212. this._id = value;
  1213. this.RaisePropertyChanged("Id");
  1214. this.OnIdChanged();
  1215. }
  1216. }
  1217. }
  1218. /// <summary>
  1219. /// Gets or sets the associated <see cref="User"/> entity.
  1220. /// </summary>
  1221. [Association("User_Participation", "UserId", "Id", IsForeignKey=true)]
  1222. [XmlIgnore()]
  1223. public User User
  1224. {
  1225. get
  1226. {
  1227. if ((this._user == null))
  1228. {
  1229. this._user = new EntityRef<User>(this, "User", this.FilterUser);
  1230. }
  1231. return this._user.Entity;
  1232. }
  1233. set
  1234. {
  1235. User previous = this.User;
  1236. if ((previous != value))
  1237. {
  1238. this.ValidateProperty("User", value);
  1239. if ((previous != null))
  1240. {
  1241. this._user.Entity = null;
  1242. previous.Participation.Remove(this);
  1243. }
  1244. if ((value != null))
  1245. {
  1246. this.UserId = value.Id;
  1247. }
  1248. else
  1249. {
  1250. this.UserId = default(int);
  1251. }
  1252. this._user.Entity = value;
  1253. if ((value != null))
  1254. {
  1255. value.Participation.Add(this);
  1256. }
  1257. this.RaisePropertyChanged("User");
  1258. }
  1259. }
  1260. }
  1261. /// <summary>
  1262. /// Gets or sets the 'UserId' value.
  1263. /// </summary>
  1264. [DataMember()]
  1265. [RoundtripOriginal()]
  1266. public int UserId
  1267. {
  1268. get
  1269. {
  1270. return this._userId;
  1271. }
  1272. set
  1273. {
  1274. if ((this._userId != value))
  1275. {
  1276. this.OnUserIdChanging(value);
  1277. this.RaiseDataMemberChanging("UserId");
  1278. this.ValidateProperty("UserId", value);
  1279. this._userId = value;
  1280. this.RaiseDataMemberChanged("UserId");
  1281. this.OnUserIdChanged();
  1282. }
  1283. }
  1284. }
  1285. private void AttachAssignment(Assignment entity)
  1286. {
  1287. entity.Participation = this;
  1288. }
  1289. private void DetachAssignment(Assignment entity)
  1290. {
  1291. entity.Participation = null;
  1292. }
  1293. private bool FilterAssignment(Assignment entity)
  1294. {
  1295. return (entity.ParticipationId == this.Id);
  1296. }
  1297. private bool FilterCourse(Course entity)
  1298. {
  1299. return (entity.Id == this.CourseId);
  1300. }
  1301. private bool FilterUser(User entity)
  1302. {
  1303. return (entity.Id == this.UserId);
  1304. }
  1305. /// <summary>
  1306. /// Computes a value from the key fields that uniquely identifies this entity instance.
  1307. /// </summary>
  1308. /// <returns>An object instance that uniquely identifies this entity instance.</returns>
  1309. public override object GetIdentity()
  1310. {
  1311. return this._id;
  1312. }
  1313. }
  1314. /// <summary>
  1315. /// The 'Problem' entity class.
  1316. /// </summary>
  1317. [DataContract(Namespace="http://schemas.datacontract.org/2004/07/glados.Web")]
  1318. public sealed partial class Problem : Entity
  1319. {
  1320. private EntityCollection<Assignment> _assignment;
  1321. private string _filePath;
  1322. private Nullable<int> _groupId;
  1323. private int _id;
  1324. private string _name;
  1325. #region Extensibility Method Definitions
  1326. /// <summary>
  1327. /// This method is invoked from the constructor once initialization is complete and
  1328. /// can be used for further object setup.
  1329. /// </summary>
  1330. partial void OnCreated();
  1331. partial void OnFilePathChanging(string value);
  1332. partial void OnFilePathChanged();
  1333. partial void OnGroupIdChanging(Nullable<int> value);
  1334. partial void OnGroupIdChanged();
  1335. partial void OnIdChanging(int value);
  1336. partial void OnIdChanged();
  1337. partial void OnNameChanging(string value);
  1338. partial void OnNameChanged();
  1339. #endregion
  1340. /// <summary>
  1341. /// Initializes a new instance of the <see cref="Problem"/> class.
  1342. /// </summary>
  1343. public Problem()
  1344. {
  1345. this.OnCreated();
  1346. }
  1347. /// <summary>
  1348. /// Gets the collection of associated <see cref="Assignment"/> entities.
  1349. /// </summary>
  1350. [Association("Problem_Assignment", "Id", "ProblemId")]
  1351. [XmlIgnore()]
  1352. public EntityCollection<Assignment> Assignment
  1353. {
  1354. get
  1355. {
  1356. if ((this._assignment == null))
  1357. {
  1358. this._assignment = new EntityCollection<Assignment>(this, "Assignment", this.FilterAssignment, this.AttachAssignment, this.DetachAssignment);
  1359. }
  1360. return this._assignment;
  1361. }
  1362. }
  1363. /// <summary>
  1364. /// Gets or sets the 'FilePath' value.
  1365. /// </summary>
  1366. [DataMember()]
  1367. public string FilePath
  1368. {
  1369. get
  1370. {
  1371. return this._filePath;
  1372. }
  1373. set
  1374. {
  1375. if ((this._filePath != value))
  1376. {
  1377. this.OnFilePathChanging(value);
  1378. this.RaiseDataMemberChanging("FilePath");
  1379. this.ValidateProperty("FilePath", value);
  1380. this._filePath = value;
  1381. this.RaiseDataMemberChanged("FilePath");
  1382. this.OnFilePathChanged();
  1383. }
  1384. }
  1385. }
  1386. /// <summary>
  1387. /// Gets or sets the 'GroupId' value.
  1388. /// </summary>
  1389. [DataMember()]
  1390. [RoundtripOriginal()]
  1391. public Nullable<int> GroupId
  1392. {
  1393. get
  1394. {
  1395. return this._groupId;
  1396. }
  1397. set
  1398. {
  1399. if ((this._groupId != value))
  1400. {
  1401. this.OnGroupIdChanging(value);
  1402. this.RaiseDataMemberChanging("GroupId");
  1403. this.ValidateProperty("GroupId", value);
  1404. this._groupId = value;
  1405. this.RaiseDataMemberChanged("GroupId");
  1406. this.OnGroupIdChanged();
  1407. }
  1408. }
  1409. }
  1410. /// <summary>
  1411. /// Gets or sets the 'Id' value.
  1412. /// </summary>
  1413. [DataMember()]
  1414. [Editable(false, AllowInitialValue=true)]
  1415. [Key()]
  1416. [RoundtripOriginal()]
  1417. public int Id
  1418. {
  1419. get
  1420. {
  1421. return this._id;
  1422. }
  1423. set
  1424. {
  1425. if ((this._id != value))
  1426. {
  1427. this.OnIdChanging(value);
  1428. this.ValidateProperty("Id", value);
  1429. this._id = value;
  1430. this.RaisePropertyChanged("Id");
  1431. this.OnIdChanged();
  1432. }
  1433. }
  1434. }
  1435. /// <summary>
  1436. /// Gets or sets the 'Name' value.
  1437. /// </summary>
  1438. [DataMember()]
  1439. [Required()]
  1440. public string Name
  1441. {
  1442. get
  1443. {
  1444. return this._name;
  1445. }
  1446. set
  1447. {
  1448. if ((this._name != value))
  1449. {
  1450. this.OnNameChanging(value);
  1451. this.RaiseDataMemberChanging("Name");
  1452. this.ValidateProperty("Name", value);
  1453. this._name = value;
  1454. this.RaiseDataMemberChanged("Name");
  1455. this.OnNameChanged();
  1456. }
  1457. }
  1458. }
  1459. private void AttachAssignment(Assignment entity)
  1460. {
  1461. entity.Problem = this;
  1462. }
  1463. private void DetachAssignment(Assignment entity)
  1464. {
  1465. entity.Problem = null;
  1466. }
  1467. private bool FilterAssignment(Assignment entity)
  1468. {
  1469. return (entity.ProblemId == this.Id);
  1470. }
  1471. /// <summary>
  1472. /// Computes a value from the key fields that uniquely identifies this entity instance.
  1473. /// </summary>
  1474. /// <returns>An object instance that uniquely identifies this entity instance.</returns>
  1475. public override object GetIdentity()
  1476. {
  1477. return this._id;
  1478. }
  1479. }
  1480. /// <summary>
  1481. /// The 'Submission' entity class.
  1482. /// </summary>
  1483. [DataContract(Namespace="http://schemas.datacontract.org/2004/07/glados.Web")]
  1484. public sealed partial class Submission : Entity
  1485. {
  1486. private EntityRef<Assignment> _assignment;
  1487. private int _assignmentId;
  1488. private string _filePath;
  1489. private int _id;
  1490. private string _result;
  1491. private DateTime _time;
  1492. #region Extensibility Method Definitions
  1493. /// <summary>
  1494. /// This method is invoked from the constructor once initialization is complete and
  1495. /// can be used for further object setup.
  1496. /// </summary>
  1497. partial void OnCreated();
  1498. partial void OnAssignmentIdChanging(int value);
  1499. partial void OnAssignmentIdChanged();
  1500. partial void OnFilePathChanging(string value);
  1501. partial void OnFilePathChanged();
  1502. partial void OnIdChanging(int value);
  1503. partial void OnIdChanged();
  1504. partial void OnResultChanging(string value);
  1505. partial void OnResultChanged();
  1506. partial void OnTimeChanging(DateTime value);
  1507. partial void OnTimeChanged();
  1508. #endregion
  1509. /// <summary>
  1510. /// Initializes a new instance of the <see cref="Submission"/> class.
  1511. /// </summary>
  1512. public Submission()
  1513. {
  1514. this.OnCreated();
  1515. }
  1516. /// <summary>
  1517. /// Gets or sets the associated <see cref="Assignment"/> entity.
  1518. /// </summary>
  1519. [Association("Assignment_Submission", "AssignmentId", "Id", IsForeignKey=true)]
  1520. [XmlIgnore()]
  1521. public Assignment Assignment
  1522. {
  1523. get
  1524. {
  1525. if ((this._assignment == null))
  1526. {
  1527. this._assignment = new EntityRef<Assignment>(this, "Assignment", this.FilterAssignment);
  1528. }
  1529. return this._assignment.Entity;
  1530. }
  1531. set
  1532. {
  1533. Assignment previous = this.Assignment;
  1534. if ((previous != value))
  1535. {
  1536. this.ValidateProperty("Assignment", value);
  1537. if ((previous != null))
  1538. {
  1539. this._assignment.Entity = null;
  1540. previous.Submission.Remove(this);
  1541. }
  1542. if ((value != null))
  1543. {
  1544. this.AssignmentId = value.Id;
  1545. }
  1546. else
  1547. {
  1548. this.AssignmentId = default(int);
  1549. }
  1550. this._assignment.Entity = value;
  1551. if ((value != null))
  1552. {
  1553. value.Submission.Add(this);
  1554. }
  1555. this.RaisePropertyChanged("Assignment");
  1556. }
  1557. }
  1558. }
  1559. /// <summary>
  1560. /// Gets or sets the 'AssignmentId' value.
  1561. /// </summary>
  1562. [DataMember()]
  1563. [RoundtripOriginal()]
  1564. public int AssignmentId
  1565. {
  1566. get
  1567. {
  1568. return this._assignmentId;
  1569. }
  1570. set
  1571. {
  1572. if ((this._assignmentId != value))
  1573. {
  1574. this.OnAssignmentIdChanging(value);
  1575. this.RaiseDataMemberChanging("AssignmentId");
  1576. this.ValidateProperty("AssignmentId", value);
  1577. this._assignmentId = value;
  1578. this.RaiseDataMemberChanged("AssignmentId");
  1579. this.OnAssignmentIdChanged();
  1580. }
  1581. }
  1582. }
  1583. /// <summary>
  1584. /// Gets or sets the 'FilePath' value.
  1585. /// </summary>
  1586. [DataMember()]
  1587. public string FilePath
  1588. {
  1589. get
  1590. {
  1591. return this._filePath;
  1592. }
  1593. set
  1594. {
  1595. if ((this._filePath != value))
  1596. {
  1597. this.OnFilePathChanging(value);
  1598. this.RaiseDataMemberChanging("FilePath");
  1599. this.ValidateProperty("FilePath", value);
  1600. this._filePath = value;
  1601. this.RaiseDataMemberChanged("FilePath");
  1602. this.OnFilePathChanged();
  1603. }
  1604. }
  1605. }
  1606. /// <summary>
  1607. /// Gets or sets the 'Id' value.
  1608. /// </summary>
  1609. [DataMember()]
  1610. [Editable(false, AllowInitialValue=true)]
  1611. [Key()]
  1612. [RoundtripOriginal()]
  1613. public int Id
  1614. {
  1615. get
  1616. {
  1617. return this._id;
  1618. }
  1619. set
  1620. {
  1621. if ((this._id != value))
  1622. {
  1623. this.OnIdChanging(value);
  1624. this.ValidateProperty("Id", value);
  1625. this._id = value;
  1626. this.RaisePropertyChanged("Id");
  1627. this.OnIdChanged();
  1628. }
  1629. }
  1630. }
  1631. /// <summary>
  1632. /// Gets or sets the 'Result' value.
  1633. /// </summary>
  1634. [DataMember()]
  1635. [Required()]
  1636. public string Result
  1637. {
  1638. get
  1639. {
  1640. return this._result;
  1641. }
  1642. set
  1643. {
  1644. if ((this._result != value))
  1645. {
  1646. this.OnResultChanging(value);
  1647. this.RaiseDataMemberChanging("Result");
  1648. this.ValidateProperty("Result", value);
  1649. this._result = value;
  1650. this.RaiseDataMemberChanged("Result");
  1651. this.OnResultChanged();
  1652. }
  1653. }
  1654. }
  1655. /// <summary>
  1656. /// Gets or sets the 'Time' value.
  1657. /// </summary>
  1658. [DataMember()]
  1659. public DateTime Time
  1660. {
  1661. get
  1662. {
  1663. return this._time;
  1664. }
  1665. set
  1666. {
  1667. if ((this._time != value))
  1668. {
  1669. this.OnTimeChanging(value);
  1670. this.RaiseDataMemberChanging("Time");
  1671. this.ValidateProperty("Time", value);
  1672. this._time = value;
  1673. this.RaiseDataMemberChanged("Time");
  1674. this.OnTimeChanged();
  1675. }
  1676. }
  1677. }
  1678. private bool FilterAssignment(Assignment entity)
  1679. {
  1680. return (entity.Id == this.AssignmentId);
  1681. }
  1682. /// <summary>
  1683. /// Computes a value from the key fields that uniquely identifies this entity instance.
  1684. /// </summary>
  1685. /// <returns>An object instance that uniquely identifies this entity instance.</returns>
  1686. public override object GetIdentity()
  1687. {
  1688. return this._id;
  1689. }
  1690. }
  1691. /// <summary>
  1692. /// The 'User' entity class.
  1693. /// </summary>
  1694. [DataContract(Namespace="http://schemas.datacontract.org/2004/07/glados.Web")]
  1695. public sealed partial class User : Entity
  1696. {
  1697. private int _id;
  1698. private EntityCollection<Membership> _membership;
  1699. private string _name;
  1700. private EntityCollection<Participation> _participation;
  1701. private string _password;
  1702. #region Extensibility Method Definitions
  1703. /// <summary>
  1704. /// This method is invoked from the constructor once initialization is complete and
  1705. /// can be used for further object setup.
  1706. /// </summary>
  1707. partial void OnCreated();
  1708. partial void OnIdChanging(int value);
  1709. partial void OnIdChanged();
  1710. partial void OnNameChanging(string value);
  1711. partial void OnNameChanged();
  1712. partial void OnPasswordChanging(string value);
  1713. partial void OnPasswordChanged();
  1714. #endregion
  1715. /// <summary>
  1716. /// Initializes a new instance of the <see cref="User"/> class.
  1717. /// </summary>
  1718. public User()
  1719. {
  1720. this.OnCreated();
  1721. }
  1722. /// <summary>
  1723. /// Gets or sets the 'Id' value.
  1724. /// </summary>
  1725. [DataMember()]
  1726. [Editable(false, AllowInitialValue=true)]
  1727. [Key()]
  1728. [RoundtripOriginal()]
  1729. public int Id
  1730. {
  1731. get
  1732. {
  1733. return this._id;
  1734. }
  1735. set
  1736. {
  1737. if ((this._id != value))
  1738. {
  1739. this.OnIdChanging(value);
  1740. this.ValidateProperty("Id", value);
  1741. this._id = value;
  1742. this.RaisePropertyChanged("Id");
  1743. this.OnIdChanged();
  1744. }
  1745. }
  1746. }
  1747. /// <summary>
  1748. /// Gets the collection of associated <see cref="Membership"/> entities.
  1749. /// </summary>
  1750. [Association("User_Membership", "Id", "UserId")]
  1751. [XmlIgnore()]
  1752. public EntityCollection<Membership> Membership
  1753. {
  1754. get
  1755. {
  1756. if ((this._membership == null))
  1757. {
  1758. this._membership = new EntityCollection<Membership>(this, "Membership", this.FilterMembership, this.AttachMembership, this.DetachMembership);
  1759. }
  1760. return this._membership;
  1761. }
  1762. }
  1763. /// <summary>
  1764. /// Gets or sets the 'Name' value.
  1765. /// </summary>
  1766. [DataMember()]
  1767. [Required()]
  1768. public string Name
  1769. {
  1770. get
  1771. {
  1772. return this._name;
  1773. }
  1774. set
  1775. {
  1776. if ((this._name != value))
  1777. {
  1778. this.OnNameChanging(value);
  1779. this.RaiseDataMemberChanging("Name");
  1780. this.ValidateProperty("Name", value);
  1781. this._name = value;
  1782. this.RaiseDataMemberChanged("Name");
  1783. this.OnNameChanged();
  1784. }
  1785. }
  1786. }
  1787. /// <summary>
  1788. /// Gets the collection of associated <see cref="Participation"/> entities.
  1789. /// </summary>
  1790. [Association("User_Participation", "Id", "UserId")]
  1791. [XmlIgnore()]
  1792. public EntityCollection<Participation> Participation
  1793. {
  1794. get
  1795. {
  1796. if ((this._participation == null))
  1797. {
  1798. this._participation = new EntityCollection<Participation>(this, "Participation", this.FilterParticipation, this.AttachParticipation, this.DetachParticipation);
  1799. }
  1800. return this._participation;
  1801. }
  1802. }
  1803. /// <summary>
  1804. /// Gets or sets the 'Password' value.
  1805. /// </summary>
  1806. [DataMember()]
  1807. [Required()]
  1808. public string Password
  1809. {
  1810. get
  1811. {
  1812. return this._password;
  1813. }
  1814. set
  1815. {
  1816. if ((this._password != value))
  1817. {
  1818. this.OnPasswordChanging(value);
  1819. this.RaiseDataMemberChanging("Password");
  1820. this.ValidateProperty("Password", value);
  1821. this._password = value;
  1822. this.RaiseDataMemberChanged("Password");
  1823. this.OnPasswordChanged();
  1824. }
  1825. }
  1826. }
  1827. private void AttachMembership(Membership entity)
  1828. {
  1829. entity.User = this;
  1830. }
  1831. private void DetachMembership(Membership entity)
  1832. {
  1833. entity.User = null;
  1834. }
  1835. private bool FilterMembership(Membership entity)
  1836. {
  1837. return (entity.UserId == this.Id);
  1838. }
  1839. private void AttachParticipation(Participation entity)
  1840. {
  1841. entity.User = this;
  1842. }
  1843. private void DetachParticipation(Participation entity)
  1844. {
  1845. entity.User = null;
  1846. }
  1847. private bool FilterParticipation(Participation entity)
  1848. {
  1849. return (entity.UserId == this.Id);
  1850. }
  1851. /// <summary>
  1852. /// Computes a value from the key fields that uniquely identifies this entity instance.
  1853. /// </summary>
  1854. /// <returns>An object instance that uniquely identifies this entity instance.</returns>
  1855. public override object GetIdentity()
  1856. {
  1857. return this._id;
  1858. }
  1859. }
  1860. }
  1861. namespace glados.Web.Services
  1862. {
  1863. using System;
  1864. using System.Collections.Generic;
  1865. using System.ComponentModel;
  1866. using System.ComponentModel.DataAnnotations;
  1867. using System.Linq;
  1868. using System.ServiceModel;
  1869. using System.ServiceModel.DomainServices;
  1870. using System.ServiceModel.DomainServices.Client;
  1871. using System.ServiceModel.DomainServices.Client.ApplicationServices;
  1872. using System.ServiceModel.Web;
  1873. using glados.Web;
  1874. using glados.Web.Services.Entities;
  1875. /// <summary>
  1876. /// The domain context corresponding to the 'StatusService' domain service.
  1877. /// </summary>
  1878. public sealed partial class StatusContext : DomainContext
  1879. {
  1880. #region Extensibility Method Definitions
  1881. /// <summary>
  1882. /// This method is invoked from the constructor once initialization is complete and
  1883. /// can be used for further object setup.
  1884. /// </summary>
  1885. partial void OnCreated();
  1886. #endregion
  1887. /// <summary>
  1888. /// Initializes a new instance of the <see cref="StatusContext"/> class.
  1889. /// </summary>
  1890. public StatusContext() :
  1891. this(new WebDomainClient<IStatusServiceContract>(new Uri("glados-Web-Services-StatusService.svc", UriKind.Relative)))
  1892. {
  1893. }
  1894. /// <summary>
  1895. /// Initializes a new instance of the <see cref="StatusContext"/> class with the specified service URI.
  1896. /// </summary>
  1897. /// <param name="serviceUri">The StatusService service URI.</param>
  1898. public StatusContext(Uri serviceUri) :
  1899. this(new WebDomainClient<IStatusServiceContract>(serviceUri))
  1900. {
  1901. }
  1902. /// <summary>
  1903. /// Initializes a new instance of the <see cref="StatusContext"/> class with the specified <paramref name="domainClient"/>.
  1904. /// </summary>
  1905. /// <param name="domainClient">The DomainClient instance to use for this domain context.</param>
  1906. public StatusContext(DomainClient domainClient) :
  1907. base(domainClient)
  1908. {
  1909. this.OnCreated();
  1910. }
  1911. /// <summary>
  1912. /// Gets the set of <see cref="TestingMachineEntity"/> entities that have been loaded into this <see cref="StatusContext"/> instance.
  1913. /// </summary>
  1914. public EntitySet<TestingMachineEntity> TestingMachineEntities
  1915. {
  1916. get
  1917. {
  1918. return base.EntityContainer.GetEntitySet<TestingMachineEntity>();
  1919. }
  1920. }
  1921. /// <summary>
  1922. /// Gets an EntityQuery instance that can be used to load <see cref="TestingMachineEntity"/> entities using the 'GetTesterStatus' query.
  1923. /// </summary>
  1924. /// <returns>An EntityQuery that can be loaded to retrieve <see cref="TestingMachineEntity"/> entities.</returns>
  1925. public EntityQuery<TestingMachineEntity> GetTesterStatusQuery()
  1926. {
  1927. this.ValidateMethod("GetTesterStatusQuery", null);
  1928. return base.CreateQuery<TestingMachineEntity>("GetTesterStatus", null, false, true);
  1929. }
  1930. /// <summary>
  1931. /// Asynchronously invokes the 'ReloadProblemsIntoDb' method of the domain service.
  1932. /// </summary>
  1933. /// <param name="callback">Callback to invoke when the operation completes.</param>
  1934. /// <param name="userState">Value to pass to the callback. It can be <c>null</c>.</param>
  1935. /// <returns>An operation instance that can be used to manage the asynchronous request.</returns>
  1936. public InvokeOperation ReloadProblemsIntoDb(Action<InvokeOperation> callback, object userState)
  1937. {
  1938. this.ValidateMethod("ReloadProblemsIntoDb", null);
  1939. return this.InvokeOperation("ReloadProblemsIntoDb", typeof(void), null, true, callback, userState);
  1940. }
  1941. /// <summary>
  1942. /// Asynchronously invokes the 'ReloadProblemsIntoDb' method of the domain service.
  1943. /// </summary>
  1944. /// <returns>An operation instance that can be used to manage the asynchronous request.</returns>
  1945. public InvokeOperation ReloadProblemsIntoDb()
  1946. {
  1947. this.ValidateMethod("ReloadProblemsIntoDb", null);
  1948. return this.InvokeOperation("ReloadProblemsIntoDb", typeof(void), null, true, null, null);
  1949. }
  1950. /// <summary>
  1951. /// Asynchronously invokes the 'RetestSubmission' method of the domain service.
  1952. /// </summary>
  1953. /// <param name="id">The value for the 'id' parameter of this action.</param>
  1954. /// <param name="callback">Callback to invoke when the operation completes.</param>
  1955. /// <param name="userState">Value to pass to the callback. It can be <c>null</c>.</param>
  1956. /// <returns>An operation instance that can be used to manage the asynchronous request.</returns>
  1957. public InvokeOperation RetestSubmission(int id, Action<InvokeOperation> callback, object userState)
  1958. {
  1959. Dictionary<string, object> parameters = new Dictionary<string, object>();
  1960. parameters.Add("id", id);
  1961. this.ValidateMethod("RetestSubmission", parameters);
  1962. return this.InvokeOperation("RetestSubmission", typeof(void), parameters, true, callback, userState);
  1963. }
  1964. /// <summary>
  1965. /// Asynchronously invokes the 'RetestSubmission' method of the domain service.
  1966. /// </summary>
  1967. /// <param name="id">The value for the 'id' parameter of this action.</param>
  1968. /// <returns>An operation instance that can be used to manage the asynchronous request.</returns>
  1969. public InvokeOperation RetestSubmission(int id)
  1970. {
  1971. Dictionary<string, object> parameters = new Dictionary<string, object>();
  1972. parameters.Add("id", id);
  1973. this.ValidateMethod("RetestSubmission", parameters);
  1974. return this.InvokeOperation("RetestSubmission", typeof(void), parameters, true, null, null);
  1975. }
  1976. /// <summary>
  1977. /// Creates a new entity container for this domain context's entity sets.
  1978. /// </summary>
  1979. /// <returns>A new container instance.</returns>
  1980. protected override EntityContainer CreateEntityContainer()
  1981. {
  1982. return new StatusContextEntityContainer();
  1983. }
  1984. /// <summary>
  1985. /// Service contract for the 'StatusService' domain service.
  1986. /// </summary>
  1987. [ServiceContract()]
  1988. public interface IStatusServiceContract
  1989. {
  1990. /// <summary>
  1991. /// Asynchronously invokes the 'GetTesterStatus' operation.
  1992. /// </summary>
  1993. /// <param name="callback">Callback to invoke on completion.</param>
  1994. /// <param name="asyncState">Optional state object.</param>
  1995. /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
  1996. [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/StatusService/GetTesterStatusDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
  1997. [OperationContract(AsyncPattern=true, Action="http://tempuri.org/StatusService/GetTesterStatus", ReplyAction="http://tempuri.org/StatusService/GetTesterStatusResponse")]
  1998. [WebGet()]
  1999. IAsyncResult BeginGetTesterStatus(AsyncCallback callback, object asyncState);
  2000. /// <summary>
  2001. /// Completes the asynchronous operation begun by 'BeginGetTesterStatus'.
  2002. /// </summary>
  2003. /// <param name="result">The IAsyncResult returned from 'BeginGetTesterStatus'.</param>
  2004. /// <returns>The 'QueryResult' returned from the 'GetTesterStatus' operation.</returns>
  2005. QueryResult<TestingMachineEntity> EndGetTesterStatus(IAsyncResult result);
  2006. /// <summary>
  2007. /// Asynchronously invokes the 'ReloadProblemsIntoDb' operation.
  2008. /// </summary>
  2009. /// <param name="callback">Callback to invoke on completion.</param>
  2010. /// <param name="asyncState">Optional state object.</param>
  2011. /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
  2012. [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/StatusService/ReloadProblemsIntoDbDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
  2013. [OperationContract(AsyncPattern=true, Action="http://tempuri.org/StatusService/ReloadProblemsIntoDb", ReplyAction="http://tempuri.org/StatusService/ReloadProblemsIntoDbResponse")]
  2014. IAsyncResult BeginReloadProblemsIntoDb(AsyncCallback callback, object asyncState);
  2015. /// <summary>
  2016. /// Completes the asynchronous operation begun by 'BeginReloadProblemsIntoDb'.
  2017. /// </summary>
  2018. /// <param name="result">The IAsyncResult returned from 'BeginReloadProblemsIntoDb'.</param>
  2019. void EndReloadProblemsIntoDb(IAsyncResult result);
  2020. /// <summary>
  2021. /// Asynchronously invokes the 'RetestSubmission' operation.
  2022. /// </summary>
  2023. /// <param name="id">The value for the 'id' parameter of this action.</param>
  2024. /// <param name="callback">Callback to invoke on completion.</param>
  2025. /// <param name="asyncState">Optional state object.</param>
  2026. /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
  2027. [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/StatusService/RetestSubmissionDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
  2028. [OperationContract(AsyncPattern=true, Action="http://tempuri.org/StatusService/RetestSubmission", ReplyAction="http://tempuri.org/StatusService/RetestSubmissionResponse")]
  2029. IAsyncResult BeginRetestSubmission(int id, AsyncCallback callback, object asyncState);
  2030. /// <summary>
  2031. /// Completes the asynchronous operation begun by 'BeginRetestSubmission'.
  2032. /// </summary>
  2033. /// <param name="result">The IAsyncResult returned from 'BeginRetestSubmission'.</param>
  2034. void EndRetestSubmission(IAsyncResult result);
  2035. /// <summary>
  2036. /// Asynchronously invokes the 'SubmitChanges' operation.
  2037. /// </summary>
  2038. /// <param name="changeSet">The change-set to submit.</param>
  2039. /// <param name="callback">Callback to invoke on completion.</param>
  2040. /// <param name="asyncState">Optional state object.</param>
  2041. /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
  2042. [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/StatusService/SubmitChangesDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
  2043. [OperationContract(AsyncPattern=true, Action="http://tempuri.org/StatusService/SubmitChanges", ReplyAction="http://tempuri.org/StatusService/SubmitChangesResponse")]
  2044. IAsyncResult BeginSubmitChanges(IEnumerable<ChangeSetEntry> changeSet, AsyncCallback callback, object asyncState);
  2045. /// <summary>
  2046. /// Completes the asynchronous operation begun by 'BeginSubmitChanges'.
  2047. /// </summary>
  2048. /// <param name="result">The IAsyncResult returned from 'BeginSubmitChanges'.</param>
  2049. /// <returns>The collection of change-set entry elements returned from 'SubmitChanges'.</returns>
  2050. IEnumerable<ChangeSetEntry> EndSubmitChanges(IAsyncResult result);
  2051. }
  2052. internal sealed class StatusContextEntityContainer : EntityContainer
  2053. {
  2054. public StatusContextEntityContainer()
  2055. {
  2056. this.CreateEntitySet<TestingMachineEntity>(EntitySetOperations.None);
  2057. }
  2058. }
  2059. }
  2060. /// <summary>
  2061. /// The domain context corresponding to the 'TaskStructureService' domain service.
  2062. /// </summary>
  2063. public sealed partial class TaskStructureContext : DomainContext
  2064. {
  2065. #region Extensibility Method Definitions
  2066. /// <summary>
  2067. /// This method is invoked from the constructor once initialization is complete and
  2068. /// can be used for further object setup.
  2069. /// </summary>
  2070. partial void OnCreated();
  2071. #endregion
  2072. /// <summary>
  2073. /// Initializes a new instance of the <see cref="TaskStructureContext"/> class.
  2074. /// </summary>
  2075. public TaskStructureContext() :
  2076. this(new WebDomainClient<ITaskStructureServiceContract>(new Uri("glados-Web-Services-TaskStructureService.svc", UriKind.Relative)))
  2077. {
  2078. }
  2079. /// <summary>
  2080. /// Initializes a new instance of the <see cref="TaskStructureContext"/> class with the specified service URI.
  2081. /// </summary>
  2082. /// <param name="serviceUri">The TaskStructureService service URI.</param>
  2083. public TaskStructureContext(Uri serviceUri) :
  2084. this(new WebDomainClient<ITaskStructureServiceContract>(serviceUri))
  2085. {
  2086. }
  2087. /// <summary>
  2088. /// Initializes a new instance of the <see cref="TaskStructureContext"/> class with the specified <paramref name="domainClient"/>.
  2089. /// </summary>
  2090. /// <param name="domainClient">The DomainClient instance to use for this domain context.</param>
  2091. public TaskStructureContext(DomainClient domainClient) :
  2092. base(domainClient)
  2093. {
  2094. this.OnCreated();
  2095. }
  2096. /// <summary>
  2097. /// Gets the set of <see cref="Assignment"/> entities that have been loaded into this <see cref="TaskStructureContext"/> instance.
  2098. /// </summary>
  2099. public EntitySet<Assignment> Assignments
  2100. {
  2101. get
  2102. {
  2103. return base.EntityContainer.GetEntitySet<Assignment>();
  2104. }
  2105. }
  2106. /// <summary>
  2107. /// Gets the set of <see cref="Course"/> entities that have been loaded into this <see cref="TaskStructureContext"/> instance.
  2108. /// </summary>
  2109. public EntitySet<Course> Courses
  2110. {
  2111. get
  2112. {
  2113. return base.EntityContainer.GetEntitySet<Course>();
  2114. }
  2115. }
  2116. /// <summary>
  2117. /// Gets the set of <see cref="Group"/> entities that have been loaded into this <see cref="TaskStructureContext"/> instance.
  2118. /// </summary>
  2119. public EntitySet<Group> Groups
  2120. {
  2121. get
  2122. {
  2123. return base.EntityContainer.GetEntitySet<Group>();
  2124. }
  2125. }
  2126. /// <summary>
  2127. /// Gets the set of <see cref="Membership"/> entities that have been loaded into this <see cref="TaskStructureContext"/> instance.
  2128. /// </summary>
  2129. public EntitySet<Membership> Memberships
  2130. {
  2131. get
  2132. {
  2133. return base.EntityContainer.GetEntitySet<Membership>();
  2134. }
  2135. }
  2136. /// <summary>
  2137. /// Gets the set of <see cref="Participation"/> entities that have been loaded into this <see cref="TaskStructureContext"/> instance.
  2138. /// </summary>
  2139. public EntitySet<Participation> Participations
  2140. {
  2141. get
  2142. {
  2143. return base.EntityContainer.GetEntitySet<Participation>();
  2144. }
  2145. }
  2146. /// <summary>
  2147. /// Gets the set of <see cref="Problem"/> entities that have been loaded into this <see cref="TaskStructureContext"/> instance.
  2148. /// </summary>
  2149. public EntitySet<Problem> Problems
  2150. {
  2151. get
  2152. {
  2153. return base.EntityContainer.GetEntitySet<Problem>();
  2154. }
  2155. }
  2156. /// <summary>
  2157. /// Gets the set of <see cref="Submission"/> entities that have been loaded into this <see cref="TaskStructureContext"/> instance.
  2158. /// </summary>
  2159. public EntitySet<Submission> Submissions
  2160. {
  2161. get
  2162. {
  2163. return base.EntityContainer.GetEntitySet<Submission>();
  2164. }
  2165. }
  2166. /// <summary>
  2167. /// Gets the set of <see cref="User"/> entities that have been loaded into this <see cref="TaskStructureContext"/> instance.
  2168. /// </summary>
  2169. public EntitySet<User> Users
  2170. {
  2171. get
  2172. {
  2173. return base.EntityContainer.GetEntitySet<User>();
  2174. }
  2175. }
  2176. /// <summary>
  2177. /// Gets an EntityQuery instance that can be used to load <see cref="Assignment"/> entities using the 'GetAssignmentSet' query.
  2178. /// </summary>
  2179. /// <returns>An EntityQuery that can be loaded to retrieve <see cref="Assignment"/> entities.</returns>
  2180. public EntityQuery<Assignment> GetAssignmentSetQuery()
  2181. {
  2182. this.ValidateMethod("GetAssignmentSetQuery", null);
  2183. return base.CreateQuery<Assignment>("GetAssignmentSet", null, false, true);
  2184. }
  2185. /// <summary>
  2186. /// Gets an EntityQuery instance that can be used to load <see cref="Assignment"/> entities using the 'GetAssignmentsForMe' query.
  2187. /// </summary>
  2188. /// <returns>An EntityQuery that can be loaded to retrieve <see cref="Assignment"/> entities.</returns>
  2189. public EntityQuery<Assignment> GetAssignmentsForMeQuery()
  2190. {
  2191. this.ValidateMethod("GetAssignmentsForMeQuery", null);
  2192. return base.CreateQuery<Assignment>("GetAssignmentsForMe", null, false, true);
  2193. }
  2194. /// <summary>
  2195. /// Gets an EntityQuery instance that can be used to load <see cref="Course"/> entities using the 'GetCourseSet' query.
  2196. /// </summary>
  2197. /// <returns>An EntityQuery that can be loaded to retrieve <see cref="Course"/> entities.</returns>
  2198. public EntityQuery<Course> GetCourseSetQuery()
  2199. {
  2200. this.ValidateMethod("GetCourseSetQuery", null);
  2201. return base.CreateQuery<Course>("GetCourseSet", null, false, true);
  2202. }
  2203. /// <summary>
  2204. /// Gets an EntityQuery instance that can be used to load <see cref="Group"/> entities using the 'GetGroupSet' query.
  2205. /// </summary>
  2206. /// <returns>An EntityQuery that can be loaded to retrieve <see cref="Group"/> entities.</returns>
  2207. public EntityQuery<Group> GetGroupSetQuery()
  2208. {
  2209. this.ValidateMethod("GetGroupSetQuery", null);
  2210. return base.CreateQuery<Group>("GetGroupSet", null, false, true);
  2211. }
  2212. /// <summary>
  2213. /// Gets an EntityQuery instance that can be used to load <see cref="Membership"/> entities using the 'GetMembershipSet' query.
  2214. /// </summary>
  2215. /// <returns>An EntityQuery that can be loaded to retrieve <see cref="Membership"/> entities.</returns>
  2216. public EntityQuery<Membership> GetMembershipSetQuery()
  2217. {
  2218. this.ValidateMethod("GetMembershipSetQuery", null);
  2219. return base.CreateQuery<Membership>("GetMembershipSet", null, false, true);
  2220. }
  2221. /// <summary>
  2222. /// Gets an EntityQuery instance that can be used to load <see cref="Participation"/> entities using the 'GetParticipationSet' query.
  2223. /// </summary>
  2224. /// <returns>An EntityQuery that can be loaded to retrieve <see cref="Participation"/> entities.</returns>
  2225. public EntityQuery<Participation> GetParticipationSetQuery()
  2226. {
  2227. this.ValidateMethod("GetParticipationSetQuery", null);
  2228. return base.CreateQuery<Participation>("GetParticipationSet", null, false, true);
  2229. }
  2230. /// <summary>
  2231. /// Gets an EntityQuery instance that can be used to load <see cref="Problem"/> entities using the 'GetProblemSet' query.
  2232. /// </summary>
  2233. /// <returns>An EntityQuery that can be loaded to retrieve <see cref="Problem"/> entities.</returns>
  2234. public EntityQuery<Problem> GetProblemSetQuery()
  2235. {
  2236. this.ValidateMethod("GetProblemSetQuery", null);
  2237. return base.CreateQuery<Problem>("GetProblemSet", null, false, true);
  2238. }
  2239. /// <summary>
  2240. /// Gets an EntityQuery instance that can be used to load <see cref="Submission"/> entities using the 'GetSubmissionSet' query.
  2241. /// </summary>
  2242. /// <returns>An EntityQuery that can be loaded to retrieve <see cref="Submission"/> entities.</returns>
  2243. public EntityQuery<Submission> GetSubmissionSetQuery()
  2244. {
  2245. this.ValidateMethod("GetSubmissionSetQuery", null);
  2246. return base.CreateQuery<Submission>("GetSubmissionSet", null, false, true);
  2247. }
  2248. /// <summary>
  2249. /// Gets an EntityQuery instance that can be used to load <see cref="User"/> entities using the 'GetUsers' query.
  2250. /// </summary>
  2251. /// <returns>An EntityQuery that can be loaded to retrieve <see cref="User"/> entities.</returns>
  2252. public EntityQuery<User> GetUsersQuery()
  2253. {
  2254. this.ValidateMethod("GetUsersQuery", null);
  2255. return base.CreateQuery<User>("GetUsers", null, false, true);
  2256. }
  2257. /// <summary>
  2258. /// Creates a new entity container for this domain context's entity sets.
  2259. /// </summary>
  2260. /// <returns>A new container instance.</returns>
  2261. protected override EntityContainer CreateEntityContainer()
  2262. {
  2263. return new TaskStructureContextEntityContainer();
  2264. }
  2265. /// <summary>
  2266. /// Service contract for the 'TaskStructureService' domain service.
  2267. /// </summary>
  2268. [ServiceContract()]
  2269. public interface ITaskStructureServiceContract
  2270. {
  2271. /// <summary>
  2272. /// Asynchronously invokes the 'GetAssignmentSet' operation.
  2273. /// </summary>
  2274. /// <param name="callback">Callback to invoke on completion.</param>
  2275. /// <param name="asyncState">Optional state object.</param>
  2276. /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
  2277. [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/TaskStructureService/GetAssignmentSetDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
  2278. [OperationContract(AsyncPattern=true, Action="http://tempuri.org/TaskStructureService/GetAssignmentSet", ReplyAction="http://tempuri.org/TaskStructureService/GetAssignmentSetResponse")]
  2279. [WebGet()]
  2280. IAsyncResult BeginGetAssignmentSet(AsyncCallback callback, object asyncState);
  2281. /// <summary>
  2282. /// Completes the asynchronous operation begun by 'BeginGetAssignmentSet'.
  2283. /// </summary>
  2284. /// <param name="result">The IAsyncResult returned from 'BeginGetAssignmentSet'.</param>
  2285. /// <returns>The 'QueryResult' returned from the 'GetAssignmentSet' operation.</returns>
  2286. QueryResult<Assignment> EndGetAssignmentSet(IAsyncResult result);
  2287. /// <summary>
  2288. /// Asynchronously invokes the 'GetAssignmentsForMe' operation.
  2289. /// </summary>
  2290. /// <param name="callback">Callback to invoke on completion.</param>
  2291. /// <param name="asyncState">Optional state object.</param>
  2292. /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
  2293. [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/TaskStructureService/GetAssignmentsForMeDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
  2294. [OperationContract(AsyncPattern=true, Action="http://tempuri.org/TaskStructureService/GetAssignmentsForMe", ReplyAction="http://tempuri.org/TaskStructureService/GetAssignmentsForMeResponse")]
  2295. [WebGet()]
  2296. IAsyncResult BeginGetAssignmentsForMe(AsyncCallback callback, object asyncState);
  2297. /// <summary>
  2298. /// Completes the asynchronous operation begun by 'BeginGetAssignmentsForMe'.
  2299. /// </summary>
  2300. /// <param name="result">The IAsyncResult returned from 'BeginGetAssignmentsForMe'.</param>
  2301. /// <returns>The 'QueryResult' returned from the 'GetAssignmentsForMe' operation.</returns>
  2302. QueryResult<Assignment> EndGetAssignmentsForMe(IAsyncResult result);
  2303. /// <summary>
  2304. /// Asynchronously invokes the 'GetCourseSet' operation.
  2305. /// </summary>
  2306. /// <param name="callback">Callback to invoke on completion.</param>
  2307. /// <param name="asyncState">Optional state object.</param>
  2308. /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
  2309. [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/TaskStructureService/GetCourseSetDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
  2310. [OperationContract(AsyncPattern=true, Action="http://tempuri.org/TaskStructureService/GetCourseSet", ReplyAction="http://tempuri.org/TaskStructureService/GetCourseSetResponse")]
  2311. [WebGet()]
  2312. IAsyncResult BeginGetCourseSet(AsyncCallback callback, object asyncState);
  2313. /// <summary>
  2314. /// Completes the asynchronous operation begun by 'BeginGetCourseSet'.
  2315. /// </summary>
  2316. /// <param name="result">The IAsyncResult returned from 'BeginGetCourseSet'.</param>
  2317. /// <returns>The 'QueryResult' returned from the 'GetCourseSet' operation.</returns>
  2318. QueryResult<Course> EndGetCourseSet(IAsyncResult result);
  2319. /// <summary>
  2320. /// Asynchronously invokes the 'GetGroupSet' operation.
  2321. /// </summary>
  2322. /// <param name="callback">Callback to invoke on completion.</param>
  2323. /// <param name="asyncState">Optional state object.</param>
  2324. /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
  2325. [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/TaskStructureService/GetGroupSetDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
  2326. [OperationContract(AsyncPattern=true, Action="http://tempuri.org/TaskStructureService/GetGroupSet", ReplyAction="http://tempuri.org/TaskStructureService/GetGroupSetResponse")]
  2327. [WebGet()]
  2328. IAsyncResult BeginGetGroupSet(AsyncCallback callback, object asyncState);
  2329. /// <summary>
  2330. /// Completes the asynchronous operation begun by 'BeginGetGroupSet'.
  2331. /// </summary>
  2332. /// <param name="result">The IAsyncResult returned from 'BeginGetGroupSet'.</param>
  2333. /// <returns>The 'QueryResult' returned from the 'GetGroupSet' operation.</returns>
  2334. QueryResult<Group> EndGetGroupSet(IAsyncResult result);
  2335. /// <summary>
  2336. /// Asynchronously invokes the 'GetMembershipSet' operation.
  2337. /// </summary>
  2338. /// <param name="callback">Callback to invoke on completion.</param>
  2339. /// <param name="asyncState">Optional state object.</param>
  2340. /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
  2341. [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/TaskStructureService/GetMembershipSetDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
  2342. [OperationContract(AsyncPattern=true, Action="http://tempuri.org/TaskStructureService/GetMembershipSet", ReplyAction="http://tempuri.org/TaskStructureService/GetMembershipSetResponse")]
  2343. [WebGet()]
  2344. IAsyncResult BeginGetMembershipSet(AsyncCallback callback, object asyncState);
  2345. /// <summary>
  2346. /// Completes the asynchronous operation begun by 'BeginGetMembershipSet'.
  2347. /// </summary>
  2348. /// <param name="result">The IAsyncResult returned from 'BeginGetMembershipSet'.</param>
  2349. /// <returns>The 'QueryResult' returned from the 'GetMembershipSet' operation.</returns>
  2350. QueryResult<Membership> EndGetMembershipSet(IAsyncResult result);
  2351. /// <summary>
  2352. /// Asynchronously invokes the 'GetParticipationSet' operation.
  2353. /// </summary>
  2354. /// <param name="callback">Callback to invoke on completion.</param>
  2355. /// <param name="asyncState">Optional state object.</param>
  2356. /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
  2357. [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/TaskStructureService/GetParticipationSetDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
  2358. [OperationContract(AsyncPattern=true, Action="http://tempuri.org/TaskStructureService/GetParticipationSet", ReplyAction="http://tempuri.org/TaskStructureService/GetParticipationSetResponse")]
  2359. [WebGet()]
  2360. IAsyncResult BeginGetParticipationSet(AsyncCallback callback, object asyncState);
  2361. /// <summary>
  2362. /// Completes the asynchronous operation begun by 'BeginGetParticipationSet'.
  2363. /// </summary>
  2364. /// <param name="result">The IAsyncResult returned from 'BeginGetParticipationSet'.</param>
  2365. /// <returns>The 'QueryResult' returned from the 'GetParticipationSet' operation.</returns>
  2366. QueryResult<Participation> EndGetParticipationSet(IAsyncResult result);
  2367. /// <summary>
  2368. /// Asynchronously invokes the 'GetProblemSet' operation.
  2369. /// </summary>
  2370. /// <param name="callback">Callback to invoke on completion.</param>
  2371. /// <param name="asyncState">Optional state object.</param>
  2372. /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
  2373. [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/TaskStructureService/GetProblemSetDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
  2374. [OperationContract(AsyncPattern=true, Action="http://tempuri.org/TaskStructureService/GetProblemSet", ReplyAction="http://tempuri.org/TaskStructureService/GetProblemSetResponse")]
  2375. [WebGet()]
  2376. IAsyncResult BeginGetProblemSet(AsyncCallback callback, object asyncState);
  2377. /// <summary>
  2378. /// Completes the asynchronous operation begun by 'BeginGetProblemSet'.
  2379. /// </summary>
  2380. /// <param name="result">The IAsyncResult returned from 'BeginGetProblemSet'.</param>
  2381. /// <returns>The 'QueryResult' returned from the 'GetProblemSet' operation.</returns>
  2382. QueryResult<Problem> EndGetProblemSet(IAsyncResult result);
  2383. /// <summary>
  2384. /// Asynchronously invokes the 'GetSubmissionSet' operation.
  2385. /// </summary>
  2386. /// <param name="callback">Callback to invoke on completion.</param>
  2387. /// <param name="asyncState">Optional state object.</param>
  2388. /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
  2389. [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/TaskStructureService/GetSubmissionSetDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
  2390. [OperationContract(AsyncPattern=true, Action="http://tempuri.org/TaskStructureService/GetSubmissionSet", ReplyAction="http://tempuri.org/TaskStructureService/GetSubmissionSetResponse")]
  2391. [WebGet()]
  2392. IAsyncResult BeginGetSubmissionSet(AsyncCallback callback, object asyncState);
  2393. /// <summary>
  2394. /// Completes the asynchronous operation begun by 'BeginGetSubmissionSet'.
  2395. /// </summary>
  2396. /// <param name="result">The IAsyncResult returned from 'BeginGetSubmissionSet'.</param>
  2397. /// <returns>The 'QueryResult' returned from the 'GetSubmissionSet' operation.</returns>
  2398. QueryResult<Submission> EndGetSubmissionSet(IAsyncResult result);
  2399. /// <summary>
  2400. /// Asynchronously invokes the 'GetUsers' operation.
  2401. /// </summary>
  2402. /// <param name="callback">Callback to invoke on completion.</param>
  2403. /// <param name="asyncState">Optional state object.</param>
  2404. /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
  2405. [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/TaskStructureService/GetUsersDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
  2406. [OperationContract(AsyncPattern=true, Action="http://tempuri.org/TaskStructureService/GetUsers", ReplyAction="http://tempuri.org/TaskStructureService/GetUsersResponse")]
  2407. [WebGet()]
  2408. IAsyncResult BeginGetUsers(AsyncCallback callback, object asyncState);
  2409. /// <summary>
  2410. /// Completes the asynchronous operation begun by 'BeginGetUsers'.
  2411. /// </summary>
  2412. /// <param name="result">The IAsyncResult returned from 'BeginGetUsers'.</param>
  2413. /// <returns>The 'QueryResult' returned from the 'GetUsers' operation.</returns>
  2414. QueryResult<User> EndGetUsers(IAsyncResult result);
  2415. /// <summary>
  2416. /// Asynchronously invokes the 'SubmitChanges' operation.
  2417. /// </summary>
  2418. /// <param name="changeSet">The change-set to submit.</param>
  2419. /// <param name="callback">Callback to invoke on completion.</param>
  2420. /// <param name="asyncState">Optional state object.</param>
  2421. /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
  2422. [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/TaskStructureService/SubmitChangesDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
  2423. [OperationContract(AsyncPattern=true, Action="http://tempuri.org/TaskStructureService/SubmitChanges", ReplyAction="http://tempuri.org/TaskStructureService/SubmitChangesResponse")]
  2424. IAsyncResult BeginSubmitChanges(IEnumerable<ChangeSetEntry> changeSet, AsyncCallback callback, object asyncState);
  2425. /// <summary>
  2426. /// Completes the asynchronous operation begun by 'BeginSubmitChanges'.
  2427. /// </summary>
  2428. /// <param name="result">The IAsyncResult returned from 'BeginSubmitChanges'.</param>
  2429. /// <returns>The collection of change-set entry elements returned from 'SubmitChanges'.</returns>
  2430. IEnumerable<ChangeSetEntry> EndSubmitChanges(IAsyncResult result);
  2431. }
  2432. internal sealed class TaskStructureContextEntityContainer : EntityContainer
  2433. {
  2434. public TaskStructureContextEntityContainer()
  2435. {
  2436. this.CreateEntitySet<Assignment>(EntitySetOperations.All);
  2437. this.CreateEntitySet<Course>(EntitySetOperations.All);
  2438. this.CreateEntitySet<Group>(EntitySetOperations.All);
  2439. this.CreateEntitySet<Membership>(EntitySetOperations.All);
  2440. this.CreateEntitySet<Participation>(EntitySetOperations.All);
  2441. this.CreateEntitySet<Problem>(EntitySetOperations.All);
  2442. this.CreateEntitySet<Submission>(EntitySetOperations.All);
  2443. this.CreateEntitySet<User>(EntitySetOperations.All);
  2444. }
  2445. }
  2446. }
  2447. }
  2448. namespace glados.Web.Services.Entities
  2449. {
  2450. using System;
  2451. using System.Collections.Generic;
  2452. using System.ComponentModel;
  2453. using System.ComponentModel.DataAnnotations;
  2454. using System.Linq;
  2455. using System.Runtime.Serialization;
  2456. using System.ServiceModel.DomainServices;
  2457. using System.ServiceModel.DomainServices.Client;
  2458. using System.ServiceModel.DomainServices.Client.ApplicationServices;
  2459. using Glados.TestingModule.Interfaces;
  2460. /// <summary>
  2461. /// The 'TestingMachineEntity' entity class.
  2462. /// </summary>
  2463. [DataContract(Namespace="http://schemas.datacontract.org/2004/07/glados.Web.Services.Entities")]
  2464. public sealed partial class TestingMachineEntity : Entity
  2465. {
  2466. private string _name;
  2467. private ServerStatus _status;
  2468. #region Extensibility Method Definitions
  2469. /// <summary>
  2470. /// This method is invoked from the constructor once initialization is complete and
  2471. /// can be used for further object setup.
  2472. /// </summary>
  2473. partial void OnCreated();
  2474. partial void OnNameChanging(string value);
  2475. partial void OnNameChanged();
  2476. partial void OnStatusChanging(ServerStatus value);
  2477. partial void OnStatusChanged();
  2478. #endregion
  2479. /// <summary>
  2480. /// Initializes a new instance of the <see cref="TestingMachineEntity"/> class.
  2481. /// </summary>
  2482. public TestingMachineEntity()
  2483. {
  2484. this.OnCreated();
  2485. }
  2486. /// <summary>
  2487. /// Gets or sets the 'Name' value.
  2488. /// </summary>
  2489. [DataMember()]
  2490. [Editable(false, AllowInitialValue=true)]
  2491. [Key()]
  2492. [RoundtripOriginal()]
  2493. public string Name
  2494. {
  2495. get
  2496. {
  2497. return this._name;
  2498. }
  2499. set
  2500. {
  2501. if ((this._name != value))
  2502. {
  2503. this.OnNameChanging(value);
  2504. this.ValidateProperty("Name", value);
  2505. this._name = value;
  2506. this.RaisePropertyChanged("Name");
  2507. this.OnNameChanged();
  2508. }
  2509. }
  2510. }
  2511. /// <summary>
  2512. /// Gets or sets the 'Status' value.
  2513. /// </summary>
  2514. [DataMember()]
  2515. public ServerStatus Status
  2516. {
  2517. get
  2518. {
  2519. return this._status;
  2520. }
  2521. set
  2522. {
  2523. if ((this._status != value))
  2524. {
  2525. this.OnStatusChanging(value);
  2526. this.RaiseDataMemberChanging("Status");
  2527. this.ValidateProperty("Status", value);
  2528. this._status = value;
  2529. this.RaiseDataMemberChanged("Status");
  2530. this.OnStatusChanged();
  2531. }
  2532. }
  2533. }
  2534. /// <summary>
  2535. /// Computes a value from the key fields that uniquely identifies this entity instance.
  2536. /// </summary>
  2537. /// <returns>An object instance that uniquely identifies this entity instance.</returns>
  2538. public override object GetIdentity()
  2539. {
  2540. return this._name;
  2541. }
  2542. }
  2543. }