/TimeSheetReporting/TimeSheetReporting/Generated_Code/TimeSheetReporting.Web.g.cs
C# | 738 lines | 565 code | 94 blank | 79 comment | 48 complexity | 145534b5990ebcb1d7548fee286a6f79 MD5 | raw file
- //------------------------------------------------------------------------------
- // <auto-generated>
- // This code was generated by a tool.
- // Runtime Version:2.0.50727.4036
- //
- // Changes to this file may cause incorrect behavior and will be lost if
- // the code is regenerated.
- // </auto-generated>
- //------------------------------------------------------------------------------
-
- namespace TimeSheetReporting
- {
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.ComponentModel.DataAnnotations;
- using System.Linq;
- using System.Web.Ria.Data;
- using System.Windows.Ria;
- using System.Windows.Ria.Services;
-
-
- /// <summary>
- /// Context for the RIA application.
- /// </summary>
- /// <remarks>
- /// This context extends the base to make application services and types available
- /// for consumption from code and xaml.
- /// </remarks>
- public sealed partial class WebContext : WebContextBase
- {
-
- #region Extensibility Method Definitions
-
- /// <summary>
- /// This method is invoked from the constructor once initialization is complete and
- /// can be used for further object setup.
- /// </summary>
- partial void OnCreated();
-
- #endregion
-
-
- /// <summary>
- /// Initializes a new instance of the WebContext class.
- /// </summary>
- public WebContext()
- {
- this.OnCreated();
- }
-
- /// <summary>
- /// Gets the context that is registered as a lifetime object with the current application.
- /// </summary>
- /// <exception cref="InvalidOperationException"> is thrown if there is no current application,
- /// no contexts have been added, or more than one context has been added.
- /// </exception>
- /// <seealso cref="Application.ApplicationLifetimeObjects"/>
- public new static WebContext Current
- {
- get
- {
- return ((WebContext)(WebContextBase.Current));
- }
- }
- }
- }
- namespace TimeSheetReporting.Web.Model
- {
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.ComponentModel.DataAnnotations;
- using System.Linq;
- using System.Runtime.Serialization;
- using System.Web.Ria.Data;
- using System.Windows.Ria;
- using System.Windows.Ria.Services;
- using System.Xml.Serialization;
-
-
- [DataContract(Namespace="http://schemas.datacontract.org/2004/07/TimeSheetReporting.Web.Model")]
- public sealed partial class Effort : Entity
- {
-
- private DateTime _date;
-
- private string _description;
-
- private double _hours;
-
- private int _id;
-
- private EntityRef<Member> _member;
-
- private int _memberId;
-
- private EntityRef<Project> _project;
-
- private int _projectId;
-
- #region Extensibility Method Definitions
-
- /// <summary>
- /// This method is invoked from the constructor once initialization is complete and
- /// can be used for further object setup.
- /// </summary>
- partial void OnCreated();
- partial void OnDateChanging(DateTime value);
- partial void OnDateChanged();
- partial void OnDescriptionChanging(string value);
- partial void OnDescriptionChanged();
- partial void OnHoursChanging(double value);
- partial void OnHoursChanged();
- partial void OnIdChanging(int value);
- partial void OnIdChanged();
- partial void OnMemberIdChanging(int value);
- partial void OnMemberIdChanged();
- partial void OnProjectIdChanging(int value);
- partial void OnProjectIdChanged();
-
- #endregion
-
-
- /// <summary>
- /// Default constructor.
- /// </summary>
- public Effort()
- {
- this.OnCreated();
- }
-
- [DataMember()]
- public DateTime Date
- {
- get
- {
- return this._date;
- }
- set
- {
- if ((this._date != value))
- {
- this.ValidateProperty("Date", value);
- this.OnDateChanging(value);
- this.RaiseDataMemberChanging("Date");
- this._date = value;
- this.RaiseDataMemberChanged("Date");
- this.OnDateChanged();
- }
- }
- }
-
- [DataMember()]
- [StringLength(1000)]
- public string Description
- {
- get
- {
- return this._description;
- }
- set
- {
- if ((this._description != value))
- {
- this.ValidateProperty("Description", value);
- this.OnDescriptionChanging(value);
- this.RaiseDataMemberChanging("Description");
- this._description = value;
- this.RaiseDataMemberChanged("Description");
- this.OnDescriptionChanged();
- }
- }
- }
-
- [DataMember()]
- public double Hours
- {
- get
- {
- return this._hours;
- }
- set
- {
- if ((this._hours != value))
- {
- this.ValidateProperty("Hours", value);
- this.OnHoursChanging(value);
- this.RaiseDataMemberChanging("Hours");
- this._hours = value;
- this.RaiseDataMemberChanged("Hours");
- this.OnHoursChanged();
- }
- }
- }
-
- [DataMember()]
- [Key()]
- public int Id
- {
- get
- {
- return this._id;
- }
- set
- {
- if ((this._id != value))
- {
- this.ValidateProperty("Id", value);
- this.OnIdChanging(value);
- this.RaiseDataMemberChanging("Id");
- this._id = value;
- this.RaiseDataMemberChanged("Id");
- this.OnIdChanged();
- }
- }
- }
-
- [Association("Member_Effort", "MemberId", "Id", IsForeignKey=true)]
- [XmlIgnore()]
- public Member Member
- {
- get
- {
- if ((this._member == null))
- {
- this._member = new EntityRef<Member>(this, "Member", this.FilterMember);
- }
- return this._member.Entity;
- }
- set
- {
- Member previous = this.Member;
- if ((previous != value))
- {
- this.ValidateProperty("Member", value);
- if ((previous != null))
- {
- this._member.Entity = null;
- previous.Effort.Remove(this);
- }
- if ((value != null))
- {
- this.MemberId = value.Id;
- }
- else
- {
- this.MemberId = default(int);
- }
- this._member.Entity = value;
- if ((value != null))
- {
- value.Effort.Add(this);
- }
- this.RaisePropertyChanged("Member");
- }
- }
- }
-
- [DataMember()]
- public int MemberId
- {
- get
- {
- return this._memberId;
- }
- set
- {
- if ((this._memberId != value))
- {
- this.ValidateProperty("MemberId", value);
- this.OnMemberIdChanging(value);
- this.RaiseDataMemberChanging("MemberId");
- this._memberId = value;
- this.RaiseDataMemberChanged("MemberId");
- this.OnMemberIdChanged();
- }
- }
- }
-
- [Association("Project_Effort", "ProjectId", "Id", IsForeignKey=true)]
- [XmlIgnore()]
- public Project Project
- {
- get
- {
- if ((this._project == null))
- {
- this._project = new EntityRef<Project>(this, "Project", this.FilterProject);
- }
- return this._project.Entity;
- }
- set
- {
- Project previous = this.Project;
- if ((previous != value))
- {
- this.ValidateProperty("Project", value);
- if ((previous != null))
- {
- this._project.Entity = null;
- previous.Effort.Remove(this);
- }
- if ((value != null))
- {
- this.ProjectId = value.Id;
- }
- else
- {
- this.ProjectId = default(int);
- }
- this._project.Entity = value;
- if ((value != null))
- {
- value.Effort.Add(this);
- }
- this.RaisePropertyChanged("Project");
- }
- }
- }
-
- [DataMember()]
- public int ProjectId
- {
- get
- {
- return this._projectId;
- }
- set
- {
- if ((this._projectId != value))
- {
- this.ValidateProperty("ProjectId", value);
- this.OnProjectIdChanging(value);
- this.RaiseDataMemberChanging("ProjectId");
- this._projectId = value;
- this.RaiseDataMemberChanged("ProjectId");
- this.OnProjectIdChanged();
- }
- }
- }
-
- private bool FilterMember(Member entity)
- {
- return (entity.Id == this.MemberId);
- }
-
- private bool FilterProject(Project entity)
- {
- return (entity.Id == this.ProjectId);
- }
-
- public override object GetIdentity()
- {
- return this._id;
- }
- }
-
- [DataContract(Namespace="http://schemas.datacontract.org/2004/07/TimeSheetReporting.Web.Model")]
- public sealed partial class Member : Entity
- {
-
- private EntityCollection<Effort> _effort;
-
- private int _id;
-
- private string _name;
-
- #region Extensibility Method Definitions
-
- /// <summary>
- /// This method is invoked from the constructor once initialization is complete and
- /// can be used for further object setup.
- /// </summary>
- partial void OnCreated();
- partial void OnIdChanging(int value);
- partial void OnIdChanged();
- partial void OnNameChanging(string value);
- partial void OnNameChanged();
-
- #endregion
-
-
- /// <summary>
- /// Default constructor.
- /// </summary>
- public Member()
- {
- this.OnCreated();
- }
-
- [Association("Member_Effort", "Id", "MemberId")]
- [XmlIgnore()]
- public EntityCollection<Effort> Effort
- {
- get
- {
- if ((this._effort == null))
- {
- this._effort = new EntityCollection<Effort>(this, "Effort", this.FilterEffort, this.AttachEffort, this.DetachEffort);
- }
- return this._effort;
- }
- }
-
- [DataMember()]
- [Key()]
- public int Id
- {
- get
- {
- return this._id;
- }
- set
- {
- if ((this._id != value))
- {
- this.ValidateProperty("Id", value);
- this.OnIdChanging(value);
- this.RaiseDataMemberChanging("Id");
- this._id = value;
- this.RaiseDataMemberChanged("Id");
- this.OnIdChanged();
- }
- }
- }
-
- [DataMember()]
- [StringLength(100)]
- public string Name
- {
- get
- {
- return this._name;
- }
- set
- {
- if ((this._name != value))
- {
- this.ValidateProperty("Name", value);
- this.OnNameChanging(value);
- this.RaiseDataMemberChanging("Name");
- this._name = value;
- this.RaiseDataMemberChanged("Name");
- this.OnNameChanged();
- }
- }
- }
-
- private void AttachEffort(Effort entity)
- {
- entity.Member = this;
- }
-
- private void DetachEffort(Effort entity)
- {
- entity.Member = null;
- }
-
- private bool FilterEffort(Effort entity)
- {
- return (entity.MemberId == this.Id);
- }
-
- public override object GetIdentity()
- {
- return this._id;
- }
- }
-
- [DataContract(Namespace="http://schemas.datacontract.org/2004/07/TimeSheetReporting.Web.Model")]
- public sealed partial class Project : Entity
- {
-
- private EntityCollection<Effort> _effort;
-
- private int _id;
-
- private string _name;
-
- #region Extensibility Method Definitions
-
- /// <summary>
- /// This method is invoked from the constructor once initialization is complete and
- /// can be used for further object setup.
- /// </summary>
- partial void OnCreated();
- partial void OnIdChanging(int value);
- partial void OnIdChanged();
- partial void OnNameChanging(string value);
- partial void OnNameChanged();
-
- #endregion
-
-
- /// <summary>
- /// Default constructor.
- /// </summary>
- public Project()
- {
- this.OnCreated();
- }
-
- [Association("Project_Effort", "Id", "ProjectId")]
- [XmlIgnore()]
- public EntityCollection<Effort> Effort
- {
- get
- {
- if ((this._effort == null))
- {
- this._effort = new EntityCollection<Effort>(this, "Effort", this.FilterEffort, this.AttachEffort, this.DetachEffort);
- }
- return this._effort;
- }
- }
-
- [DataMember()]
- [Key()]
- public int Id
- {
- get
- {
- return this._id;
- }
- set
- {
- if ((this._id != value))
- {
- this.ValidateProperty("Id", value);
- this.OnIdChanging(value);
- this.RaiseDataMemberChanging("Id");
- this._id = value;
- this.RaiseDataMemberChanged("Id");
- this.OnIdChanged();
- }
- }
- }
-
- [DataMember()]
- [StringLength(100)]
- public string Name
- {
- get
- {
- return this._name;
- }
- set
- {
- if ((this._name != value))
- {
- this.ValidateProperty("Name", value);
- this.OnNameChanging(value);
- this.RaiseDataMemberChanging("Name");
- this._name = value;
- this.RaiseDataMemberChanged("Name");
- this.OnNameChanged();
- }
- }
- }
-
- private void AttachEffort(Effort entity)
- {
- entity.Project = this;
- }
-
- private void DetachEffort(Effort entity)
- {
- entity.Project = null;
- }
-
- private bool FilterEffort(Effort entity)
- {
- return (entity.ProjectId == this.Id);
- }
-
- public override object GetIdentity()
- {
- return this._id;
- }
- }
- }
- namespace TimeSheetReporting.Web.Service
- {
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.ComponentModel.DataAnnotations;
- using System.Linq;
- using System.ServiceModel;
- using System.Web.Ria.Data;
- using System.Windows.Ria;
- using System.Windows.Ria.Services;
- using TimeSheetReporting.Web.Model;
-
-
- public sealed partial class TimeSheetContext : DomainContext
- {
-
- #region Extensibility Method Definitions
-
- /// <summary>
- /// This method is invoked from the constructor once initialization is complete and
- /// can be used for further object setup.
- /// </summary>
- partial void OnCreated();
-
- #endregion
-
-
- /// <summary>
- /// Default constructor.
- /// </summary>
- public TimeSheetContext() :
- this(new WebDomainClient<ITimeSheetServiceContract>(new Uri("TimeSheetReporting-Web-Service-TimeSheetService.svc", UriKind.Relative)))
- {
- }
-
- /// <summary>
- /// Constructor used to specify a data service URI.
- /// </summary>
- /// <param name="serviceUri">
- /// The TimeSheetService data service URI.
- /// </param>
- public TimeSheetContext(Uri serviceUri) :
- this(new WebDomainClient<ITimeSheetServiceContract>(serviceUri))
- {
- }
-
- /// <summary>
- /// Constructor used to specify a DomainClient instance.
- /// </summary>
- /// <param name="domainClient">
- /// The DomainClient instance the DomainContext should use.
- /// </param>
- public TimeSheetContext(DomainClient domainClient) :
- base(domainClient)
- {
- this.OnCreated();
- }
-
- public EntitySet<Effort> Efforts
- {
- get
- {
- return base.EntityContainer.GetEntitySet<Effort>();
- }
- }
-
- public EntitySet<Member> Members
- {
- get
- {
- return base.EntityContainer.GetEntitySet<Member>();
- }
- }
-
- public EntitySet<Project> Projects
- {
- get
- {
- return base.EntityContainer.GetEntitySet<Project>();
- }
- }
-
- /// <summary>
- /// Returns an EntityQuery for query operation 'GetEffort'.
- /// </summary>
- public EntityQuery<Effort> GetEffortQuery()
- {
- this.ValidateMethod("GetEffortQuery", null);
- return base.CreateQuery<Effort>("GetEffort", null, false, true);
- }
-
- /// <summary>
- /// Returns an EntityQuery for query operation 'GetMember'.
- /// </summary>
- public EntityQuery<Member> GetMemberQuery()
- {
- this.ValidateMethod("GetMemberQuery", null);
- return base.CreateQuery<Member>("GetMember", null, false, true);
- }
-
- /// <summary>
- /// Returns an EntityQuery for query operation 'GetProject'.
- /// </summary>
- public EntityQuery<Project> GetProjectQuery()
- {
- this.ValidateMethod("GetProjectQuery", null);
- return base.CreateQuery<Project>("GetProject", null, false, true);
- }
-
- protected override EntityContainer CreateEntityContainer()
- {
- return new TimeSheetContextEntityContainer();
- }
-
- [ServiceContract()]
- public interface ITimeSheetServiceContract
- {
-
- [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/TimeSheetService/GetEffortDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
- [OperationContract(AsyncPattern=true, Action="http://tempuri.org/TimeSheetService/GetEffort", ReplyAction="http://tempuri.org/TimeSheetService/GetEffortResponse")]
- IAsyncResult BeginGetEffort(AsyncCallback callback, object asyncState);
-
- QueryResult<Effort> EndGetEffort(IAsyncResult result);
-
- [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/TimeSheetService/GetMemberDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
- [OperationContract(AsyncPattern=true, Action="http://tempuri.org/TimeSheetService/GetMember", ReplyAction="http://tempuri.org/TimeSheetService/GetMemberResponse")]
- IAsyncResult BeginGetMember(AsyncCallback callback, object asyncState);
-
- QueryResult<Member> EndGetMember(IAsyncResult result);
-
- [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/TimeSheetService/GetProjectDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
- [OperationContract(AsyncPattern=true, Action="http://tempuri.org/TimeSheetService/GetProject", ReplyAction="http://tempuri.org/TimeSheetService/GetProjectResponse")]
- IAsyncResult BeginGetProject(AsyncCallback callback, object asyncState);
-
- QueryResult<Project> EndGetProject(IAsyncResult result);
-
- [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/TimeSheetService/SubmitChangesDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
- [OperationContract(AsyncPattern=true, Action="http://tempuri.org/TimeSheetService/SubmitChanges", ReplyAction="http://tempuri.org/TimeSheetService/SubmitChangesResponse")]
- IAsyncResult BeginSubmitChanges(IEnumerable<ChangeSetEntry> changeSet, AsyncCallback callback, object asyncState);
-
- IEnumerable<ChangeSetEntry> EndSubmitChanges(IAsyncResult result);
- }
-
- internal sealed class TimeSheetContextEntityContainer : EntityContainer
- {
-
- public TimeSheetContextEntityContainer()
- {
- this.CreateEntitySet<Effort>(EntitySetOperations.All);
- this.CreateEntitySet<Member>(EntitySetOperations.All);
- this.CreateEntitySet<Project>(EntitySetOperations.None);
- }
- }
- }
- }