PageRenderTime 197ms CodeModel.GetById 94ms app.highlight 66ms RepoModel.GetById 31ms app.codeStats 1ms

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