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

/TimeSheetReporting/TimeSheetReporting/Generated_Code/TimeSheetReporting.Web.g.cs

#
C# | 738 lines | 565 code | 94 blank | 79 comment | 48 complexity | 145534b5990ebcb1d7548fee286a6f79 MD5 | raw file
  1. //------------------------------------------------------------------------------
  2. // <auto-generated>
  3. // This code was generated by a tool.
  4. // Runtime Version:2.0.50727.4036
  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 TimeSheetReporting
  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.Web.Ria.Data;
  18. using System.Windows.Ria;
  19. using System.Windows.Ria.Services;
  20. /// <summary>
  21. /// Context for the RIA application.
  22. /// </summary>
  23. /// <remarks>
  24. /// This context extends the base to make application services and types available
  25. /// for consumption from code and xaml.
  26. /// </remarks>
  27. public sealed partial class WebContext : WebContextBase
  28. {
  29. #region Extensibility Method Definitions
  30. /// <summary>
  31. /// This method is invoked from the constructor once initialization is complete and
  32. /// can be used for further object setup.
  33. /// </summary>
  34. partial void OnCreated();
  35. #endregion
  36. /// <summary>
  37. /// Initializes a new instance of the WebContext class.
  38. /// </summary>
  39. public WebContext()
  40. {
  41. this.OnCreated();
  42. }
  43. /// <summary>
  44. /// Gets the context that is registered as a lifetime object with the current application.
  45. /// </summary>
  46. /// <exception cref="InvalidOperationException"> is thrown if there is no current application,
  47. /// no contexts have been added, or more than one context has been added.
  48. /// </exception>
  49. /// <seealso cref="Application.ApplicationLifetimeObjects"/>
  50. public new static WebContext Current
  51. {
  52. get
  53. {
  54. return ((WebContext)(WebContextBase.Current));
  55. }
  56. }
  57. }
  58. }
  59. namespace TimeSheetReporting.Web.Model
  60. {
  61. using System;
  62. using System.Collections.Generic;
  63. using System.ComponentModel;
  64. using System.ComponentModel.DataAnnotations;
  65. using System.Linq;
  66. using System.Runtime.Serialization;
  67. using System.Web.Ria.Data;
  68. using System.Windows.Ria;
  69. using System.Windows.Ria.Services;
  70. using System.Xml.Serialization;
  71. [DataContract(Namespace="http://schemas.datacontract.org/2004/07/TimeSheetReporting.Web.Model")]
  72. public sealed partial class Effort : Entity
  73. {
  74. private DateTime _date;
  75. private string _description;
  76. private double _hours;
  77. private int _id;
  78. private EntityRef<Member> _member;
  79. private int _memberId;
  80. private EntityRef<Project> _project;
  81. private int _projectId;
  82. #region Extensibility Method Definitions
  83. /// <summary>
  84. /// This method is invoked from the constructor once initialization is complete and
  85. /// can be used for further object setup.
  86. /// </summary>
  87. partial void OnCreated();
  88. partial void OnDateChanging(DateTime value);
  89. partial void OnDateChanged();
  90. partial void OnDescriptionChanging(string value);
  91. partial void OnDescriptionChanged();
  92. partial void OnHoursChanging(double value);
  93. partial void OnHoursChanged();
  94. partial void OnIdChanging(int value);
  95. partial void OnIdChanged();
  96. partial void OnMemberIdChanging(int value);
  97. partial void OnMemberIdChanged();
  98. partial void OnProjectIdChanging(int value);
  99. partial void OnProjectIdChanged();
  100. #endregion
  101. /// <summary>
  102. /// Default constructor.
  103. /// </summary>
  104. public Effort()
  105. {
  106. this.OnCreated();
  107. }
  108. [DataMember()]
  109. public DateTime Date
  110. {
  111. get
  112. {
  113. return this._date;
  114. }
  115. set
  116. {
  117. if ((this._date != value))
  118. {
  119. this.ValidateProperty("Date", value);
  120. this.OnDateChanging(value);
  121. this.RaiseDataMemberChanging("Date");
  122. this._date = value;
  123. this.RaiseDataMemberChanged("Date");
  124. this.OnDateChanged();
  125. }
  126. }
  127. }
  128. [DataMember()]
  129. [StringLength(1000)]
  130. public string Description
  131. {
  132. get
  133. {
  134. return this._description;
  135. }
  136. set
  137. {
  138. if ((this._description != value))
  139. {
  140. this.ValidateProperty("Description", value);
  141. this.OnDescriptionChanging(value);
  142. this.RaiseDataMemberChanging("Description");
  143. this._description = value;
  144. this.RaiseDataMemberChanged("Description");
  145. this.OnDescriptionChanged();
  146. }
  147. }
  148. }
  149. [DataMember()]
  150. public double Hours
  151. {
  152. get
  153. {
  154. return this._hours;
  155. }
  156. set
  157. {
  158. if ((this._hours != value))
  159. {
  160. this.ValidateProperty("Hours", value);
  161. this.OnHoursChanging(value);
  162. this.RaiseDataMemberChanging("Hours");
  163. this._hours = value;
  164. this.RaiseDataMemberChanged("Hours");
  165. this.OnHoursChanged();
  166. }
  167. }
  168. }
  169. [DataMember()]
  170. [Key()]
  171. public int Id
  172. {
  173. get
  174. {
  175. return this._id;
  176. }
  177. set
  178. {
  179. if ((this._id != value))
  180. {
  181. this.ValidateProperty("Id", value);
  182. this.OnIdChanging(value);
  183. this.RaiseDataMemberChanging("Id");
  184. this._id = value;
  185. this.RaiseDataMemberChanged("Id");
  186. this.OnIdChanged();
  187. }
  188. }
  189. }
  190. [Association("Member_Effort", "MemberId", "Id", IsForeignKey=true)]
  191. [XmlIgnore()]
  192. public Member Member
  193. {
  194. get
  195. {
  196. if ((this._member == null))
  197. {
  198. this._member = new EntityRef<Member>(this, "Member", this.FilterMember);
  199. }
  200. return this._member.Entity;
  201. }
  202. set
  203. {
  204. Member previous = this.Member;
  205. if ((previous != value))
  206. {
  207. this.ValidateProperty("Member", value);
  208. if ((previous != null))
  209. {
  210. this._member.Entity = null;
  211. previous.Effort.Remove(this);
  212. }
  213. if ((value != null))
  214. {
  215. this.MemberId = value.Id;
  216. }
  217. else
  218. {
  219. this.MemberId = default(int);
  220. }
  221. this._member.Entity = value;
  222. if ((value != null))
  223. {
  224. value.Effort.Add(this);
  225. }
  226. this.RaisePropertyChanged("Member");
  227. }
  228. }
  229. }
  230. [DataMember()]
  231. public int MemberId
  232. {
  233. get
  234. {
  235. return this._memberId;
  236. }
  237. set
  238. {
  239. if ((this._memberId != value))
  240. {
  241. this.ValidateProperty("MemberId", value);
  242. this.OnMemberIdChanging(value);
  243. this.RaiseDataMemberChanging("MemberId");
  244. this._memberId = value;
  245. this.RaiseDataMemberChanged("MemberId");
  246. this.OnMemberIdChanged();
  247. }
  248. }
  249. }
  250. [Association("Project_Effort", "ProjectId", "Id", IsForeignKey=true)]
  251. [XmlIgnore()]
  252. public Project Project
  253. {
  254. get
  255. {
  256. if ((this._project == null))
  257. {
  258. this._project = new EntityRef<Project>(this, "Project", this.FilterProject);
  259. }
  260. return this._project.Entity;
  261. }
  262. set
  263. {
  264. Project previous = this.Project;
  265. if ((previous != value))
  266. {
  267. this.ValidateProperty("Project", value);
  268. if ((previous != null))
  269. {
  270. this._project.Entity = null;
  271. previous.Effort.Remove(this);
  272. }
  273. if ((value != null))
  274. {
  275. this.ProjectId = value.Id;
  276. }
  277. else
  278. {
  279. this.ProjectId = default(int);
  280. }
  281. this._project.Entity = value;
  282. if ((value != null))
  283. {
  284. value.Effort.Add(this);
  285. }
  286. this.RaisePropertyChanged("Project");
  287. }
  288. }
  289. }
  290. [DataMember()]
  291. public int ProjectId
  292. {
  293. get
  294. {
  295. return this._projectId;
  296. }
  297. set
  298. {
  299. if ((this._projectId != value))
  300. {
  301. this.ValidateProperty("ProjectId", value);
  302. this.OnProjectIdChanging(value);
  303. this.RaiseDataMemberChanging("ProjectId");
  304. this._projectId = value;
  305. this.RaiseDataMemberChanged("ProjectId");
  306. this.OnProjectIdChanged();
  307. }
  308. }
  309. }
  310. private bool FilterMember(Member entity)
  311. {
  312. return (entity.Id == this.MemberId);
  313. }
  314. private bool FilterProject(Project entity)
  315. {
  316. return (entity.Id == this.ProjectId);
  317. }
  318. public override object GetIdentity()
  319. {
  320. return this._id;
  321. }
  322. }
  323. [DataContract(Namespace="http://schemas.datacontract.org/2004/07/TimeSheetReporting.Web.Model")]
  324. public sealed partial class Member : Entity
  325. {
  326. private EntityCollection<Effort> _effort;
  327. private int _id;
  328. private string _name;
  329. #region Extensibility Method Definitions
  330. /// <summary>
  331. /// This method is invoked from the constructor once initialization is complete and
  332. /// can be used for further object setup.
  333. /// </summary>
  334. partial void OnCreated();
  335. partial void OnIdChanging(int value);
  336. partial void OnIdChanged();
  337. partial void OnNameChanging(string value);
  338. partial void OnNameChanged();
  339. #endregion
  340. /// <summary>
  341. /// Default constructor.
  342. /// </summary>
  343. public Member()
  344. {
  345. this.OnCreated();
  346. }
  347. [Association("Member_Effort", "Id", "MemberId")]
  348. [XmlIgnore()]
  349. public EntityCollection<Effort> Effort
  350. {
  351. get
  352. {
  353. if ((this._effort == null))
  354. {
  355. this._effort = new EntityCollection<Effort>(this, "Effort", this.FilterEffort, this.AttachEffort, this.DetachEffort);
  356. }
  357. return this._effort;
  358. }
  359. }
  360. [DataMember()]
  361. [Key()]
  362. public int Id
  363. {
  364. get
  365. {
  366. return this._id;
  367. }
  368. set
  369. {
  370. if ((this._id != value))
  371. {
  372. this.ValidateProperty("Id", value);
  373. this.OnIdChanging(value);
  374. this.RaiseDataMemberChanging("Id");
  375. this._id = value;
  376. this.RaiseDataMemberChanged("Id");
  377. this.OnIdChanged();
  378. }
  379. }
  380. }
  381. [DataMember()]
  382. [StringLength(100)]
  383. public string Name
  384. {
  385. get
  386. {
  387. return this._name;
  388. }
  389. set
  390. {
  391. if ((this._name != value))
  392. {
  393. this.ValidateProperty("Name", value);
  394. this.OnNameChanging(value);
  395. this.RaiseDataMemberChanging("Name");
  396. this._name = value;
  397. this.RaiseDataMemberChanged("Name");
  398. this.OnNameChanged();
  399. }
  400. }
  401. }
  402. private void AttachEffort(Effort entity)
  403. {
  404. entity.Member = this;
  405. }
  406. private void DetachEffort(Effort entity)
  407. {
  408. entity.Member = null;
  409. }
  410. private bool FilterEffort(Effort entity)
  411. {
  412. return (entity.MemberId == this.Id);
  413. }
  414. public override object GetIdentity()
  415. {
  416. return this._id;
  417. }
  418. }
  419. [DataContract(Namespace="http://schemas.datacontract.org/2004/07/TimeSheetReporting.Web.Model")]
  420. public sealed partial class Project : Entity
  421. {
  422. private EntityCollection<Effort> _effort;
  423. private int _id;
  424. private string _name;
  425. #region Extensibility Method Definitions
  426. /// <summary>
  427. /// This method is invoked from the constructor once initialization is complete and
  428. /// can be used for further object setup.
  429. /// </summary>
  430. partial void OnCreated();
  431. partial void OnIdChanging(int value);
  432. partial void OnIdChanged();
  433. partial void OnNameChanging(string value);
  434. partial void OnNameChanged();
  435. #endregion
  436. /// <summary>
  437. /// Default constructor.
  438. /// </summary>
  439. public Project()
  440. {
  441. this.OnCreated();
  442. }
  443. [Association("Project_Effort", "Id", "ProjectId")]
  444. [XmlIgnore()]
  445. public EntityCollection<Effort> Effort
  446. {
  447. get
  448. {
  449. if ((this._effort == null))
  450. {
  451. this._effort = new EntityCollection<Effort>(this, "Effort", this.FilterEffort, this.AttachEffort, this.DetachEffort);
  452. }
  453. return this._effort;
  454. }
  455. }
  456. [DataMember()]
  457. [Key()]
  458. public int Id
  459. {
  460. get
  461. {
  462. return this._id;
  463. }
  464. set
  465. {
  466. if ((this._id != value))
  467. {
  468. this.ValidateProperty("Id", value);
  469. this.OnIdChanging(value);
  470. this.RaiseDataMemberChanging("Id");
  471. this._id = value;
  472. this.RaiseDataMemberChanged("Id");
  473. this.OnIdChanged();
  474. }
  475. }
  476. }
  477. [DataMember()]
  478. [StringLength(100)]
  479. public string Name
  480. {
  481. get
  482. {
  483. return this._name;
  484. }
  485. set
  486. {
  487. if ((this._name != value))
  488. {
  489. this.ValidateProperty("Name", value);
  490. this.OnNameChanging(value);
  491. this.RaiseDataMemberChanging("Name");
  492. this._name = value;
  493. this.RaiseDataMemberChanged("Name");
  494. this.OnNameChanged();
  495. }
  496. }
  497. }
  498. private void AttachEffort(Effort entity)
  499. {
  500. entity.Project = this;
  501. }
  502. private void DetachEffort(Effort entity)
  503. {
  504. entity.Project = null;
  505. }
  506. private bool FilterEffort(Effort entity)
  507. {
  508. return (entity.ProjectId == this.Id);
  509. }
  510. public override object GetIdentity()
  511. {
  512. return this._id;
  513. }
  514. }
  515. }
  516. namespace TimeSheetReporting.Web.Service
  517. {
  518. using System;
  519. using System.Collections.Generic;
  520. using System.ComponentModel;
  521. using System.ComponentModel.DataAnnotations;
  522. using System.Linq;
  523. using System.ServiceModel;
  524. using System.Web.Ria.Data;
  525. using System.Windows.Ria;
  526. using System.Windows.Ria.Services;
  527. using TimeSheetReporting.Web.Model;
  528. public sealed partial class TimeSheetContext : DomainContext
  529. {
  530. #region Extensibility Method Definitions
  531. /// <summary>
  532. /// This method is invoked from the constructor once initialization is complete and
  533. /// can be used for further object setup.
  534. /// </summary>
  535. partial void OnCreated();
  536. #endregion
  537. /// <summary>
  538. /// Default constructor.
  539. /// </summary>
  540. public TimeSheetContext() :
  541. this(new WebDomainClient<ITimeSheetServiceContract>(new Uri("TimeSheetReporting-Web-Service-TimeSheetService.svc", UriKind.Relative)))
  542. {
  543. }
  544. /// <summary>
  545. /// Constructor used to specify a data service URI.
  546. /// </summary>
  547. /// <param name="serviceUri">
  548. /// The TimeSheetService data service URI.
  549. /// </param>
  550. public TimeSheetContext(Uri serviceUri) :
  551. this(new WebDomainClient<ITimeSheetServiceContract>(serviceUri))
  552. {
  553. }
  554. /// <summary>
  555. /// Constructor used to specify a DomainClient instance.
  556. /// </summary>
  557. /// <param name="domainClient">
  558. /// The DomainClient instance the DomainContext should use.
  559. /// </param>
  560. public TimeSheetContext(DomainClient domainClient) :
  561. base(domainClient)
  562. {
  563. this.OnCreated();
  564. }
  565. public EntitySet<Effort> Efforts
  566. {
  567. get
  568. {
  569. return base.EntityContainer.GetEntitySet<Effort>();
  570. }
  571. }
  572. public EntitySet<Member> Members
  573. {
  574. get
  575. {
  576. return base.EntityContainer.GetEntitySet<Member>();
  577. }
  578. }
  579. public EntitySet<Project> Projects
  580. {
  581. get
  582. {
  583. return base.EntityContainer.GetEntitySet<Project>();
  584. }
  585. }
  586. /// <summary>
  587. /// Returns an EntityQuery for query operation 'GetEffort'.
  588. /// </summary>
  589. public EntityQuery<Effort> GetEffortQuery()
  590. {
  591. this.ValidateMethod("GetEffortQuery", null);
  592. return base.CreateQuery<Effort>("GetEffort", null, false, true);
  593. }
  594. /// <summary>
  595. /// Returns an EntityQuery for query operation 'GetMember'.
  596. /// </summary>
  597. public EntityQuery<Member> GetMemberQuery()
  598. {
  599. this.ValidateMethod("GetMemberQuery", null);
  600. return base.CreateQuery<Member>("GetMember", null, false, true);
  601. }
  602. /// <summary>
  603. /// Returns an EntityQuery for query operation 'GetProject'.
  604. /// </summary>
  605. public EntityQuery<Project> GetProjectQuery()
  606. {
  607. this.ValidateMethod("GetProjectQuery", null);
  608. return base.CreateQuery<Project>("GetProject", null, false, true);
  609. }
  610. protected override EntityContainer CreateEntityContainer()
  611. {
  612. return new TimeSheetContextEntityContainer();
  613. }
  614. [ServiceContract()]
  615. public interface ITimeSheetServiceContract
  616. {
  617. [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/TimeSheetService/GetEffortDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
  618. [OperationContract(AsyncPattern=true, Action="http://tempuri.org/TimeSheetService/GetEffort", ReplyAction="http://tempuri.org/TimeSheetService/GetEffortResponse")]
  619. IAsyncResult BeginGetEffort(AsyncCallback callback, object asyncState);
  620. QueryResult<Effort> EndGetEffort(IAsyncResult result);
  621. [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/TimeSheetService/GetMemberDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
  622. [OperationContract(AsyncPattern=true, Action="http://tempuri.org/TimeSheetService/GetMember", ReplyAction="http://tempuri.org/TimeSheetService/GetMemberResponse")]
  623. IAsyncResult BeginGetMember(AsyncCallback callback, object asyncState);
  624. QueryResult<Member> EndGetMember(IAsyncResult result);
  625. [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/TimeSheetService/GetProjectDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
  626. [OperationContract(AsyncPattern=true, Action="http://tempuri.org/TimeSheetService/GetProject", ReplyAction="http://tempuri.org/TimeSheetService/GetProjectResponse")]
  627. IAsyncResult BeginGetProject(AsyncCallback callback, object asyncState);
  628. QueryResult<Project> EndGetProject(IAsyncResult result);
  629. [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/TimeSheetService/SubmitChangesDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
  630. [OperationContract(AsyncPattern=true, Action="http://tempuri.org/TimeSheetService/SubmitChanges", ReplyAction="http://tempuri.org/TimeSheetService/SubmitChangesResponse")]
  631. IAsyncResult BeginSubmitChanges(IEnumerable<ChangeSetEntry> changeSet, AsyncCallback callback, object asyncState);
  632. IEnumerable<ChangeSetEntry> EndSubmitChanges(IAsyncResult result);
  633. }
  634. internal sealed class TimeSheetContextEntityContainer : EntityContainer
  635. {
  636. public TimeSheetContextEntityContainer()
  637. {
  638. this.CreateEntitySet<Effort>(EntitySetOperations.All);
  639. this.CreateEntitySet<Member>(EntitySetOperations.All);
  640. this.CreateEntitySet<Project>(EntitySetOperations.None);
  641. }
  642. }
  643. }
  644. }