//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//     Runtime Version:4.0.30319.1
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

namespace TaskIt
{
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.ComponentModel.DataAnnotations;
    using System.Linq;
    using System.ServiceModel.DomainServices;
    using System.ServiceModel.DomainServices.Client;
    using System.ServiceModel.DomainServices.Client.ApplicationServices;
    
    
    /// <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="System.Windows.Application.ApplicationLifetimeObjects"/>
        public new static WebContext Current
        {
            get
            {
                return ((WebContext)(WebContextBase.Current));
            }
        }
    }
}
namespace TaskIt.Web
{
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.ComponentModel.DataAnnotations;
    using System.Linq;
    using System.Runtime.Serialization;
    using System.ServiceModel.DomainServices;
    using System.ServiceModel.DomainServices.Client;
    using System.ServiceModel.DomainServices.Client.ApplicationServices;
    using System.Xml.Serialization;
    
    
    /// <summary>
    /// The 'Contact' entity class.
    /// </summary>
    [DataContract(Namespace="http://schemas.datacontract.org/2004/07/TaskIt.Web")]
    public sealed partial class Contact : Entity
    {
        
        private EntityCollection<ContactNote> _contactNotes;
        
        private DateTime _createdDate;
        
        private string _email;
        
        private long _id;
        
        private DateTime _modifiedDate;
        
        private string _name;
        
        private EntityCollection<Task> _tasks;
        
        private long _userID;
        
        private string _username;
        
        #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 OnCreatedDateChanging(DateTime value);
        partial void OnCreatedDateChanged();
        partial void OnEmailChanging(string value);
        partial void OnEmailChanged();
        partial void OnIDChanging(long value);
        partial void OnIDChanged();
        partial void OnModifiedDateChanging(DateTime value);
        partial void OnModifiedDateChanged();
        partial void OnNameChanging(string value);
        partial void OnNameChanged();
        partial void OnUserIDChanging(long value);
        partial void OnUserIDChanged();
        partial void OnUsernameChanging(string value);
        partial void OnUsernameChanged();

        #endregion
        
        
        /// <summary>
        /// Initializes a new instance of the <see cref="Contact"/> class.
        /// </summary>
        public Contact()
        {
            this.OnCreated();
        }
        
        /// <summary>
        /// Gets the collection of associated <see cref="ContactNote"/> entities.
        /// </summary>
        [Association("Contact_ContactNote", "ID", "ContactID")]
        [XmlIgnore()]
        public EntityCollection<ContactNote> ContactNotes
        {
            get
            {
                if ((this._contactNotes == null))
                {
                    this._contactNotes = new EntityCollection<ContactNote>(this, "ContactNotes", this.FilterContactNotes, this.AttachContactNotes, this.DetachContactNotes);
                }
                return this._contactNotes;
            }
        }
        
        /// <summary>
        /// Gets or sets the 'CreatedDate' value.
        /// </summary>
        [DataMember()]
        public DateTime CreatedDate
        {
            get
            {
                return this._createdDate;
            }
            set
            {
                if ((this._createdDate != value))
                {
                    this.OnCreatedDateChanging(value);
                    this.RaiseDataMemberChanging("CreatedDate");
                    this.ValidateProperty("CreatedDate", value);
                    this._createdDate = value;
                    this.RaiseDataMemberChanged("CreatedDate");
                    this.OnCreatedDateChanged();
                }
            }
        }
        
        /// <summary>
        /// Gets or sets the 'Email' value.
        /// </summary>
        [DataMember()]
        [StringLength(100)]
        public string Email
        {
            get
            {
                return this._email;
            }
            set
            {
                if ((this._email != value))
                {
                    this.OnEmailChanging(value);
                    this.RaiseDataMemberChanging("Email");
                    this.ValidateProperty("Email", value);
                    this._email = value;
                    this.RaiseDataMemberChanged("Email");
                    this.OnEmailChanged();
                }
            }
        }
        
        /// <summary>
        /// Gets or sets the 'ID' value.
        /// </summary>
        [DataMember()]
        [Editable(false, AllowInitialValue=true)]
        [Key()]
        [RoundtripOriginal()]
        public long ID
        {
            get
            {
                return this._id;
            }
            set
            {
                if ((this._id != value))
                {
                    this.OnIDChanging(value);
                    this.ValidateProperty("ID", value);
                    this._id = value;
                    this.RaisePropertyChanged("ID");
                    this.OnIDChanged();
                }
            }
        }
        
        /// <summary>
        /// Gets or sets the 'ModifiedDate' value.
        /// </summary>
        [DataMember()]
        public DateTime ModifiedDate
        {
            get
            {
                return this._modifiedDate;
            }
            set
            {
                if ((this._modifiedDate != value))
                {
                    this.OnModifiedDateChanging(value);
                    this.RaiseDataMemberChanging("ModifiedDate");
                    this.ValidateProperty("ModifiedDate", value);
                    this._modifiedDate = value;
                    this.RaiseDataMemberChanged("ModifiedDate");
                    this.OnModifiedDateChanged();
                }
            }
        }
        
        /// <summary>
        /// Gets or sets the 'Name' value.
        /// </summary>
        [DataMember()]
        [Required()]
        [StringLength(100)]
        public string Name
        {
            get
            {
                return this._name;
            }
            set
            {
                if ((this._name != value))
                {
                    this.OnNameChanging(value);
                    this.RaiseDataMemberChanging("Name");
                    this.ValidateProperty("Name", value);
                    this._name = value;
                    this.RaiseDataMemberChanged("Name");
                    this.OnNameChanged();
                }
            }
        }
        
        /// <summary>
        /// Gets the collection of associated <see cref="Task"/> entities.
        /// </summary>
        [Association("Contact_Task", "ID", "ContactID")]
        [XmlIgnore()]
        public EntityCollection<Task> Tasks
        {
            get
            {
                if ((this._tasks == null))
                {
                    this._tasks = new EntityCollection<Task>(this, "Tasks", this.FilterTasks, this.AttachTasks, this.DetachTasks);
                }
                return this._tasks;
            }
        }
        
        /// <summary>
        /// Gets or sets the 'UserID' value.
        /// </summary>
        [DataMember()]
        public long UserID
        {
            get
            {
                return this._userID;
            }
            set
            {
                if ((this._userID != value))
                {
                    this.OnUserIDChanging(value);
                    this.RaiseDataMemberChanging("UserID");
                    this.ValidateProperty("UserID", value);
                    this._userID = value;
                    this.RaiseDataMemberChanged("UserID");
                    this.OnUserIDChanged();
                }
            }
        }
        
        /// <summary>
        /// Gets or sets the 'Username' value.
        /// </summary>
        [DataMember()]
        [StringLength(50)]
        public string Username
        {
            get
            {
                return this._username;
            }
            set
            {
                if ((this._username != value))
                {
                    this.OnUsernameChanging(value);
                    this.RaiseDataMemberChanging("Username");
                    this.ValidateProperty("Username", value);
                    this._username = value;
                    this.RaiseDataMemberChanged("Username");
                    this.OnUsernameChanged();
                }
            }
        }
        
        private void AttachContactNotes(ContactNote entity)
        {
            entity.Contact = this;
        }
        
        private void DetachContactNotes(ContactNote entity)
        {
            entity.Contact = null;
        }
        
        private bool FilterContactNotes(ContactNote entity)
        {
            return (entity.ContactID == this.ID);
        }
        
        private void AttachTasks(Task entity)
        {
            entity.Contact = this;
        }
        
        private void DetachTasks(Task entity)
        {
            entity.Contact = null;
        }
        
        private bool FilterTasks(Task entity)
        {
            return (entity.ContactID == this.ID);
        }
        
        /// <summary>
        /// Computes a value from the key fields that uniquely identifies this entity instance.
        /// </summary>
        /// <returns>An object instance that uniquely identifies this entity instance.</returns>
        public override object GetIdentity()
        {
            return this._id;
        }
    }
    
    /// <summary>
    /// The 'ContactNote' entity class.
    /// </summary>
    [DataContract(Namespace="http://schemas.datacontract.org/2004/07/TaskIt.Web")]
    public sealed partial class ContactNote : Entity
    {
        
        private EntityRef<Contact> _contact;
        
        private long _contactID;
        
        private DateTime _createdDate;
        
        private long _id;
        
        private EntityRef<TaskItUser> _taskItUser;
        
        private string _text;
        
        private long _userID;
        
        #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 OnContactIDChanging(long value);
        partial void OnContactIDChanged();
        partial void OnCreatedDateChanging(DateTime value);
        partial void OnCreatedDateChanged();
        partial void OnIDChanging(long value);
        partial void OnIDChanged();
        partial void OnTextChanging(string value);
        partial void OnTextChanged();
        partial void OnUserIDChanging(long value);
        partial void OnUserIDChanged();

        #endregion
        
        
        /// <summary>
        /// Initializes a new instance of the <see cref="ContactNote"/> class.
        /// </summary>
        public ContactNote()
        {
            this.OnCreated();
        }
        
        /// <summary>
        /// Gets or sets the associated <see cref="Contact"/> entity.
        /// </summary>
        [Association("Contact_ContactNote", "ContactID", "ID", IsForeignKey=true)]
        [XmlIgnore()]
        public Contact Contact
        {
            get
            {
                if ((this._contact == null))
                {
                    this._contact = new EntityRef<Contact>(this, "Contact", this.FilterContact);
                }
                return this._contact.Entity;
            }
            set
            {
                Contact previous = this.Contact;
                if ((previous != value))
                {
                    this.ValidateProperty("Contact", value);
                    if ((previous != null))
                    {
                        this._contact.Entity = null;
                        previous.ContactNotes.Remove(this);
                    }
                    if ((value != null))
                    {
                        this.ContactID = value.ID;
                    }
                    else
                    {
                        this.ContactID = default(long);
                    }
                    this._contact.Entity = value;
                    if ((value != null))
                    {
                        value.ContactNotes.Add(this);
                    }
                    this.RaisePropertyChanged("Contact");
                }
            }
        }
        
        /// <summary>
        /// Gets or sets the 'ContactID' value.
        /// </summary>
        [DataMember()]
        [RoundtripOriginal()]
        public long ContactID
        {
            get
            {
                return this._contactID;
            }
            set
            {
                if ((this._contactID != value))
                {
                    this.OnContactIDChanging(value);
                    this.RaiseDataMemberChanging("ContactID");
                    this.ValidateProperty("ContactID", value);
                    this._contactID = value;
                    this.RaiseDataMemberChanged("ContactID");
                    this.OnContactIDChanged();
                }
            }
        }
        
        /// <summary>
        /// Gets or sets the 'CreatedDate' value.
        /// </summary>
        [DataMember()]
        public DateTime CreatedDate
        {
            get
            {
                return this._createdDate;
            }
            set
            {
                if ((this._createdDate != value))
                {
                    this.OnCreatedDateChanging(value);
                    this.RaiseDataMemberChanging("CreatedDate");
                    this.ValidateProperty("CreatedDate", value);
                    this._createdDate = value;
                    this.RaiseDataMemberChanged("CreatedDate");
                    this.OnCreatedDateChanged();
                }
            }
        }
        
        /// <summary>
        /// Gets or sets the 'ID' value.
        /// </summary>
        [DataMember()]
        [Editable(false, AllowInitialValue=true)]
        [Key()]
        [RoundtripOriginal()]
        public long ID
        {
            get
            {
                return this._id;
            }
            set
            {
                if ((this._id != value))
                {
                    this.OnIDChanging(value);
                    this.ValidateProperty("ID", value);
                    this._id = value;
                    this.RaisePropertyChanged("ID");
                    this.OnIDChanged();
                }
            }
        }
        
        /// <summary>
        /// Gets or sets the associated <see cref="TaskItUser"/> entity.
        /// </summary>
        [Association("TaskItUser_ContactNote", "UserID", "ID", IsForeignKey=true)]
        [XmlIgnore()]
        public TaskItUser TaskItUser
        {
            get
            {
                if ((this._taskItUser == null))
                {
                    this._taskItUser = new EntityRef<TaskItUser>(this, "TaskItUser", this.FilterTaskItUser);
                }
                return this._taskItUser.Entity;
            }
            set
            {
                TaskItUser previous = this.TaskItUser;
                if ((previous != value))
                {
                    this.ValidateProperty("TaskItUser", value);
                    if ((previous != null))
                    {
                        this._taskItUser.Entity = null;
                        previous.ContactNotes.Remove(this);
                    }
                    if ((value != null))
                    {
                        this.UserID = value.ID;
                    }
                    else
                    {
                        this.UserID = default(long);
                    }
                    this._taskItUser.Entity = value;
                    if ((value != null))
                    {
                        value.ContactNotes.Add(this);
                    }
                    this.RaisePropertyChanged("TaskItUser");
                }
            }
        }
        
        /// <summary>
        /// Gets or sets the 'Text' value.
        /// </summary>
        [DataMember()]
        [Required()]
        [StringLength(5000)]
        public string Text
        {
            get
            {
                return this._text;
            }
            set
            {
                if ((this._text != value))
                {
                    this.OnTextChanging(value);
                    this.RaiseDataMemberChanging("Text");
                    this.ValidateProperty("Text", value);
                    this._text = value;
                    this.RaiseDataMemberChanged("Text");
                    this.OnTextChanged();
                }
            }
        }
        
        /// <summary>
        /// Gets or sets the 'UserID' value.
        /// </summary>
        [DataMember()]
        [RoundtripOriginal()]
        public long UserID
        {
            get
            {
                return this._userID;
            }
            set
            {
                if ((this._userID != value))
                {
                    this.OnUserIDChanging(value);
                    this.RaiseDataMemberChanging("UserID");
                    this.ValidateProperty("UserID", value);
                    this._userID = value;
                    this.RaiseDataMemberChanged("UserID");
                    this.OnUserIDChanged();
                }
            }
        }
        
        private bool FilterContact(Contact entity)
        {
            return (entity.ID == this.ContactID);
        }
        
        private bool FilterTaskItUser(TaskItUser entity)
        {
            return (entity.ID == this.UserID);
        }
        
        /// <summary>
        /// Computes a value from the key fields that uniquely identifies this entity instance.
        /// </summary>
        /// <returns>An object instance that uniquely identifies this entity instance.</returns>
        public override object GetIdentity()
        {
            return this._id;
        }
    }
    
    /// <summary>
    /// The 'Context' entity class.
    /// </summary>
    [DataContract(Namespace="http://schemas.datacontract.org/2004/07/TaskIt.Web")]
    public sealed partial class Context : Entity
    {
        
        private EntityCollection<ContextNote> _contextNotes;
        
        private DateTime _createdDate;
        
        private long _id;
        
        private DateTime _modifiedDate;
        
        private string _name;
        
        private EntityCollection<Task> _tasks;
        
        private long _userID;
        
        #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 OnCreatedDateChanging(DateTime value);
        partial void OnCreatedDateChanged();
        partial void OnIDChanging(long value);
        partial void OnIDChanged();
        partial void OnModifiedDateChanging(DateTime value);
        partial void OnModifiedDateChanged();
        partial void OnNameChanging(string value);
        partial void OnNameChanged();
        partial void OnUserIDChanging(long value);
        partial void OnUserIDChanged();

        #endregion
        
        
        /// <summary>
        /// Initializes a new instance of the <see cref="Context"/> class.
        /// </summary>
        public Context()
        {
            this.OnCreated();
        }
        
        /// <summary>
        /// Gets the collection of associated <see cref="ContextNote"/> entities.
        /// </summary>
        [Association("Context_ContextNote", "ID", "ContextID")]
        [XmlIgnore()]
        public EntityCollection<ContextNote> ContextNotes
        {
            get
            {
                if ((this._contextNotes == null))
                {
                    this._contextNotes = new EntityCollection<ContextNote>(this, "ContextNotes", this.FilterContextNotes, this.AttachContextNotes, this.DetachContextNotes);
                }
                return this._contextNotes;
            }
        }
        
        /// <summary>
        /// Gets or sets the 'CreatedDate' value.
        /// </summary>
        [DataMember()]
        public DateTime CreatedDate
        {
            get
            {
                return this._createdDate;
            }
            set
            {
                if ((this._createdDate != value))
                {
                    this.OnCreatedDateChanging(value);
                    this.RaiseDataMemberChanging("CreatedDate");
                    this.ValidateProperty("CreatedDate", value);
                    this._createdDate = value;
                    this.RaiseDataMemberChanged("CreatedDate");
                    this.OnCreatedDateChanged();
                }
            }
        }
        
        /// <summary>
        /// Gets or sets the 'ID' value.
        /// </summary>
        [DataMember()]
        [Editable(false, AllowInitialValue=true)]
        [Key()]
        [RoundtripOriginal()]
        public long ID
        {
            get
            {
                return this._id;
            }
            set
            {
                if ((this._id != value))
                {
                    this.OnIDChanging(value);
                    this.ValidateProperty("ID", value);
                    this._id = value;
                    this.RaisePropertyChanged("ID");
                    this.OnIDChanged();
                }
            }
        }
        
        /// <summary>
        /// Gets or sets the 'ModifiedDate' value.
        /// </summary>
        [DataMember()]
        public DateTime ModifiedDate
        {
            get
            {
                return this._modifiedDate;
            }
            set
            {
                if ((this._modifiedDate != value))
                {
                    this.OnModifiedDateChanging(value);
                    this.RaiseDataMemberChanging("ModifiedDate");
                    this.ValidateProperty("ModifiedDate", value);
                    this._modifiedDate = value;
                    this.RaiseDataMemberChanged("ModifiedDate");
                    this.OnModifiedDateChanged();
                }
            }
        }
        
        /// <summary>
        /// Gets or sets the 'Name' value.
        /// </summary>
        [DataMember()]
        [Required()]
        [StringLength(100)]
        public string Name
        {
            get
            {
                return this._name;
            }
            set
            {
                if ((this._name != value))
                {
                    this.OnNameChanging(value);
                    this.RaiseDataMemberChanging("Name");
                    this.ValidateProperty("Name", value);
                    this._name = value;
                    this.RaiseDataMemberChanged("Name");
                    this.OnNameChanged();
                }
            }
        }
        
        /// <summary>
        /// Gets the collection of associated <see cref="Task"/> entities.
        /// </summary>
        [Association("Context_Task", "ID", "ContextID")]
        [XmlIgnore()]
        public EntityCollection<Task> Tasks
        {
            get
            {
                if ((this._tasks == null))
                {
                    this._tasks = new EntityCollection<Task>(this, "Tasks", this.FilterTasks, this.AttachTasks, this.DetachTasks);
                }
                return this._tasks;
            }
        }
        
        /// <summary>
        /// Gets or sets the 'UserID' value.
        /// </summary>
        [DataMember()]
        public long UserID
        {
            get
            {
                return this._userID;
            }
            set
            {
                if ((this._userID != value))
                {
                    this.OnUserIDChanging(value);
                    this.RaiseDataMemberChanging("UserID");
                    this.ValidateProperty("UserID", value);
                    this._userID = value;
                    this.RaiseDataMemberChanged("UserID");
                    this.OnUserIDChanged();
                }
            }
        }
        
        private void AttachContextNotes(ContextNote entity)
        {
            entity.Context = this;
        }
        
        private void DetachContextNotes(ContextNote entity)
        {
            entity.Context = null;
        }
        
        private bool FilterContextNotes(ContextNote entity)
        {
            return (entity.ContextID == this.ID);
        }
        
        private void AttachTasks(Task entity)
        {
            entity.Context = this;
        }
        
        private void DetachTasks(Task entity)
        {
            entity.Context = null;
        }
        
        private bool FilterTasks(Task entity)
        {
            return (entity.ContextID == this.ID);
        }
        
        /// <summary>
        /// Computes a value from the key fields that uniquely identifies this entity instance.
        /// </summary>
        /// <returns>An object instance that uniquely identifies this entity instance.</returns>
        public override object GetIdentity()
        {
            return this._id;
        }
    }
    
    /// <summary>
    /// The 'ContextNote' entity class.
    /// </summary>
    [DataContract(Namespace="http://schemas.datacontract.org/2004/07/TaskIt.Web")]
    public sealed partial class ContextNote : Entity
    {
        
        private EntityRef<Context> _context;
        
        private long _contextID;
        
        private DateTime _createdDate;
        
        private long _id;
        
        private EntityRef<TaskItUser> _taskItUser;
        
        private string _text;
        
        private long _userID;
        
        #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 OnContextIDChanging(long value);
        partial void OnContextIDChanged();
        partial void OnCreatedDateChanging(DateTime value);
        partial void OnCreatedDateChanged();
        partial void OnIDChanging(long value);
        partial void OnIDChanged();
        partial void OnTextChanging(string value);
        partial void OnTextChanged();
        partial void OnUserIDChanging(long value);
        partial void OnUserIDChanged();

        #endregion
        
        
        /// <summary>
        /// Initializes a new instance of the <see cref="ContextNote"/> class.
        /// </summary>
        public ContextNote()
        {
            this.OnCreated();
        }
        
        /// <summary>
        /// Gets or sets the associated <see cref="Context"/> entity.
        /// </summary>
        [Association("Context_ContextNote", "ContextID", "ID", IsForeignKey=true)]
        [XmlIgnore()]
        public Context Context
        {
            get
            {
                if ((this._context == null))
                {
                    this._context = new EntityRef<Context>(this, "Context", this.FilterContext);
                }
                return this._context.Entity;
            }
            set
            {
                Context previous = this.Context;
                if ((previous != value))
                {
                    this.ValidateProperty("Context", value);
                    if ((previous != null))
                    {
                        this._context.Entity = null;
                        previous.ContextNotes.Remove(this);
                    }
                    if ((value != null))
                    {
                        this.ContextID = value.ID;
                    }
                    else
                    {
                        this.ContextID = default(long);
                    }
                    this._context.Entity = value;
                    if ((value != null))
                    {
                        value.ContextNotes.Add(this);
                    }
                    this.RaisePropertyChanged("Context");
                }
            }
        }
        
        /// <summary>
        /// Gets or sets the 'ContextID' value.
        /// </summary>
        [DataMember()]
        [RoundtripOriginal()]
        public long ContextID
        {
            get
            {
                return this._contextID;
            }
            set
            {
                if ((this._contextID != value))
                {
                    this.OnContextIDChanging(value);
                    this.RaiseDataMemberChanging("ContextID");
                    this.ValidateProperty("ContextID", value);
                    this._contextID = value;
                    this.RaiseDataMemberChanged("ContextID");
                    this.OnContextIDChanged();
                }
            }
        }
        
        /// <summary>
        /// Gets or sets the 'CreatedDate' value.
        /// </summary>
        [DataMember()]
        public DateTime CreatedDate
        {
            get
            {
                return this._createdDate;
            }
            set
            {
                if ((this._createdDate != value))
                {
                    this.OnCreatedDateChanging(value);
                    this.RaiseDataMemberChanging("CreatedDate");
                    this.ValidateProperty("CreatedDate", value);
                    this._createdDate = value;
                    this.RaiseDataMemberChanged("CreatedDate");
                    this.OnCreatedDateChanged();
                }
            }
        }
        
        /// <summary>
        /// Gets or sets the 'ID' value.
        /// </summary>
        [DataMember()]
        [Editable(false, AllowInitialValue=true)]
        [Key()]
        [RoundtripOriginal()]
        public long ID
        {
            get
            {
                return this._id;
            }
            set
            {
                if ((this._id != value))
                {
                    this.OnIDChanging(value);
                    this.ValidateProperty("ID", value);
                    this._id = value;
                    this.RaisePropertyChanged("ID");
                    this.OnIDChanged();
                }
            }
        }
        
        /// <summary>
        /// Gets or sets the associated <see cref="TaskItUser"/> entity.
        /// </summary>
        [Association("TaskItUser_ContextNote", "UserID", "ID", IsForeignKey=true)]
        [XmlIgnore()]
        public TaskItUser TaskItUser
        {
            get
            {
                if ((this._taskItUser == null))
                {
                    this._taskItUser = new EntityRef<TaskItUser>(this, "TaskItUser", this.FilterTaskItUser);
                }
                return this._taskItUser.Entity;
            }
            set
            {
                TaskItUser previous = this.TaskItUser;
                if ((previous != value))
                {
                    this.ValidateProperty("TaskItUser", value);
                    if ((previous != null))
                    {
                        this._taskItUser.Entity = null;
                        previous.ContextNotes.Remove(this);
                    }
                    if ((value != null))
                    {
                        this.UserID = value.ID;
                    }
                    else
                    {
                        this.UserID = default(long);
                    }
                    this._taskItUser.Entity = value;
                    if ((value != null))
                    {
                        value.ContextNotes.Add(this);
                    }
                    this.RaisePropertyChanged("TaskItUser");
                }
            }
        }
        
        /// <summary>
        /// Gets or sets the 'Text' value.
        /// </summary>
        [DataMember()]
        [Required()]
        [StringLength(5000)]
        public string Text
        {
            get
            {
                return this._text;
            }
            set
            {
                if ((this._text != value))
                {
                    this.OnTextChanging(value);
                    this.RaiseDataMemberChanging("Text");
                    this.ValidateProperty("Text", value);
                    this._text = value;
                    this.RaiseDataMemberChanged("Text");
                    this.OnTextChanged();
                }
            }
        }
        
        /// <summary>
        /// Gets or sets the 'UserID' value.
        /// </summary>
        [DataMember()]
        [RoundtripOriginal()]
        public long UserID
        {
            get
            {
                return this._userID;
            }
            set
            {
                if ((this._userID != value))
                {
                    this.OnUserIDChanging(value);
                    this.RaiseDataMemberChanging("UserID");
                    this.ValidateProperty("UserID", value);
                    this._userID = value;
                    this.RaiseDataMemberChanged("UserID");
                    this.OnUserIDChanged();
                }
            }
        }
        
        private bool FilterContext(Context entity)
        {
            return (entity.ID == this.ContextID);
        }
        
        private bool FilterTaskItUser(TaskItUser entity)
        {
            return (entity.ID == this.UserID);
        }
        
        /// <summary>
        /// Computes a value from the key fields that uniquely identifies this entity instance.
        /// </summary>
        /// <returns>An object instance that uniquely identifies this entity instance.</returns>
        public override object GetIdentity()
        {
            return this._id;
        }
    }
    
    /// <summary>
    /// The 'Priority' entity class.
    /// </summary>
    [DataContract(Namespace="http://schemas.datacontract.org/2004/07/TaskIt.Web")]
    public sealed partial class Priority : Entity
    {
        
        private long _id;
        
        private string _name;
        
        private EntityRef<Priority> _priority1;
        
        private EntityRef<Priority> _priority2;
        
        private EntityCollection<Task> _tasks;
        
        #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(long value);
        partial void OnIDChanged();
        partial void OnNameChanging(string value);
        partial void OnNameChanged();

        #endregion
        
        
        /// <summary>
        /// Initializes a new instance of the <see cref="Priority"/> class.
        /// </summary>
        public Priority()
        {
            this.OnCreated();
        }
        
        /// <summary>
        /// Gets or sets the 'ID' value.
        /// </summary>
        [DataMember()]
        [Key()]
        [RoundtripOriginal()]
        public long ID
        {
            get
            {
                return this._id;
            }
            set
            {
                if ((this._id != value))
                {
                    this.OnIDChanging(value);
                    this.RaiseDataMemberChanging("ID");
                    this.ValidateProperty("ID", value);
                    this._id = value;
                    this.RaiseDataMemberChanged("ID");
                    this.OnIDChanged();
                }
            }
        }
        
        /// <summary>
        /// Gets or sets the 'Name' value.
        /// </summary>
        [DataMember()]
        [Required()]
        [StringLength(20)]
        public string Name
        {
            get
            {
                return this._name;
            }
            set
            {
                if ((this._name != value))
                {
                    this.OnNameChanging(value);
                    this.RaiseDataMemberChanging("Name");
                    this.ValidateProperty("Name", value);
                    this._name = value;
                    this.RaiseDataMemberChanged("Name");
                    this.OnNameChanged();
                }
            }
        }
        
        /// <summary>
        /// Gets or sets the associated <see cref="Priority"/> entity.
        /// </summary>
        [Association("Priority_Priority", "ID", "ID")]
        [XmlIgnore()]
        public Priority Priority1
        {
            get
            {
                if ((this._priority1 == null))
                {
                    this._priority1 = new EntityRef<Priority>(this, "Priority1", this.FilterPriority1);
                }
                return this._priority1.Entity;
            }
            set
            {
                Priority previous = this.Priority1;
                if ((previous != value))
                {
                    this.ValidateProperty("Priority1", value);
                    if ((previous != null))
                    {
                        this._priority1.Entity = null;
                        previous.Priority2 = null;
                    }
                    this._priority1.Entity = value;
                    if ((value != null))
                    {
                        value.Priority2 = this;
                    }
                    this.RaisePropertyChanged("Priority1");
                }
            }
        }
        
        /// <summary>
        /// Gets or sets the associated <see cref="Priority"/> entity.
        /// </summary>
        [Association("Priority_Priority", "ID", "ID", IsForeignKey=true)]
        [XmlIgnore()]
        public Priority Priority2
        {
            get
            {
                if ((this._priority2 == null))
                {
                    this._priority2 = new EntityRef<Priority>(this, "Priority2", this.FilterPriority2);
                }
                return this._priority2.Entity;
            }
            set
            {
                Priority previous = this.Priority2;
                if ((previous != value))
                {
                    this.ValidateProperty("Priority2", value);
                    if ((previous != null))
                    {
                        this._priority2.Entity = null;
                        previous.Priority1 = null;
                    }
                    if ((value != null))
                    {
                        this.ID = value.ID;
                    }
                    else
                    {
                        this.ID = default(long);
                    }
                    this._priority2.Entity = value;
                    if ((value != null))
                    {
                        value.Priority1 = this;
                    }
                    this.RaisePropertyChanged("Priority2");
                }
            }
        }
        
        /// <summary>
        /// Gets the collection of associated <see cref="Task"/> entities.
        /// </summary>
        [Association("Priority_Task", "ID", "PriorityID")]
        [XmlIgnore()]
        public EntityCollection<Task> Tasks
        {
            get
            {
                if ((this._tasks == null))
                {
                    this._tasks = new EntityCollection<Task>(this, "Tasks", this.FilterTasks, this.AttachTasks, this.DetachTasks);
                }
                return this._tasks;
            }
        }
        
        private bool FilterPriority1(Priority entity)
        {
            return (entity.ID == this.ID);
        }
        
        private bool FilterPriority2(Priority entity)
        {
            return (entity.ID == this.ID);
        }
        
        private void AttachTasks(Task entity)
        {
            entity.Priority = this;
        }
        
        private void DetachTasks(Task entity)
        {
            entity.Priority = null;
        }
        
        private bool FilterTasks(Task entity)
        {
            return (entity.PriorityID == this.ID);
        }
        
        /// <summary>
        /// Computes a value from the key fields that uniquely identifies this entity instance.
        /// </summary>
        /// <returns>An object instance that uniquely identifies this entity instance.</returns>
        public override object GetIdentity()
        {
            return this._id;
        }
    }
    
    /// <summary>
    /// The 'Project' entity class.
    /// </summary>
    [DataContract(Namespace="http://schemas.datacontract.org/2004/07/TaskIt.Web")]
    public sealed partial class Project : Entity
    {
        
        private Nullable<DateTime> _completionDate;
        
        private DateTime _createdDate;
        
        private Nullable<DateTime> _dueDate;
        
        private long _id;
        
        private DateTime _modifiedDate;
        
        private string _name;
        
        private Nullable<long> _parentID;
        
        private EntityCollection<ProjectNote> _projectNotes;
        
        private EntityCollection<Task> _tasks;
        
        private long _userID;
        
        #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 OnCompletionDateChanging(Nullable<DateTime> value);
        partial void OnCompletionDateChanged();
        partial void OnCreatedDateChanging(DateTime value);
        partial void OnCreatedDateChanged();
        partial void OnDueDateChanging(Nullable<DateTime> value);
        partial void OnDueDateChanged();
        partial void OnIDChanging(long value);
        partial void OnIDChanged();
        partial void OnModifiedDateChanging(DateTime value);
        partial void OnModifiedDateChanged();
        partial void OnNameChanging(string value);
        partial void OnNameChanged();
        partial void OnParentIDChanging(Nullable<long> value);
        partial void OnParentIDChanged();
        partial void OnUserIDChanging(long value);
        partial void OnUserIDChanged();

        #endregion
        
        
        /// <summary>
        /// Initializes a new instance of the <see cref="Project"/> class.
        /// </summary>
        public Project()
        {
            this.OnCreated();
        }
        
        /// <summary>
        /// Gets or sets the 'CompletionDate' value.
        /// </summary>
        [DataMember()]
        public Nullable<DateTime> CompletionDate
        {
            get
            {
                return this._completionDate;
            }
            set
            {
                if ((this._completionDate != value))
                {
                    this.OnCompletionDateChanging(value);
                    this.RaiseDataMemberChanging("CompletionDate");
                    this.ValidateProperty("CompletionDate", value);
                    this._completionDate = value;
                    this.RaiseDataMemberChanged("CompletionDate");
                    this.OnCompletionDateChanged();
                }
            }
        }
        
        /// <summary>
        /// Gets or sets the 'CreatedDate' value.
        /// </summary>
        [DataMember()]
        public DateTime CreatedDate
        {
            get
            {
                return this._createdDate;
            }
            set
            {
                if ((this._createdDate != value))
                {
                    this.OnCreatedDateChanging(value);
                    this.RaiseDataMemberChanging("CreatedDate");
                    this.ValidateProperty("CreatedDate", value);
                    this._createdDate = value;
                    this.RaiseDataMemberChanged("CreatedDate");
                    this.OnCreatedDateChanged();
                }
            }
        }
        
        /// <summary>
        /// Gets or sets the 'DueDate' value.
        /// </summary>
        [DataMember()]
        public Nullable<DateTime> DueDate
        {
            get
            {
                return this._dueDate;
            }
            set
            {
                if ((this._dueDate != value))
                {
                    this.OnDueDateChanging(value);
                    this.RaiseDataMemberChanging("DueDate");
                    this.ValidateProperty("DueDate", value);
                    this._dueDate = value;
                    this.RaiseDataMemberChanged("DueDate");
                    this.OnDueDateChanged();
                }
            }
        }
        
        /// <summary>
        /// Gets or sets the 'ID' value.
        /// </summary>
        [DataMember()]
        [Editable(false, AllowInitialValue=true)]
        [Key()]
        [RoundtripOriginal()]
        public long ID
        {
            get
            {
                return this._id;
            }
            set
            {
                if ((this._id != value))
                {
                    this.OnIDChanging(value);
                    this.ValidateProperty("ID", value);
                    this._id = value;
                    this.RaisePropertyChanged("ID");
                    this.OnIDChanged();
                }
            }
        }
        
        /// <summary>
        /// Gets or sets the 'ModifiedDate' value.
        /// </summary>
        [DataMember()]
        public DateTime ModifiedDate
        {
            get
            {
                return this._modifiedDate;
            }
            set
            {
                if ((this._modifiedDate != value))
                {
                    this.OnModifiedDateChanging(value);
                    this.RaiseDataMemberChanging("ModifiedDate");
                    this.ValidateProperty("ModifiedDate", value);
                    this._modifiedDate = value;
                    this.RaiseDataMemberChanged("ModifiedDate");
                    this.OnModifiedDateChanged();
                }
            }
        }
        
        /// <summary>
        /// Gets or sets the 'Name' value.
        /// </summary>
        [DataMember()]
        [Required()]
        [StringLength(250)]
        public string Name
        {
            get
            {
                return this._name;
            }
            set
            {
                if ((this._name != value))
                {
                    this.OnNameChanging(value);
                    this.RaiseDataMemberChanging("Name");
                    this.ValidateProperty("Name", value);
                    this._name = value;
                    this.RaiseDataMemberChanged("Name");
                    this.OnNameChanged();
                }
            }
        }
        
        /// <summary>
        /// Gets or sets the 'ParentID' value.
        /// </summary>
        [DataMember()]
        public Nullable<long> ParentID
        {
            get
            {
                return this._parentID;
            }
            set
            {
                if ((this._parentID != value))
                {
                    this.OnParentIDChanging(value);
                    this.RaiseDataMemberChanging("ParentID");
                    this.ValidateProperty("ParentID", value);
                    this._parentID = value;
                    this.RaiseDataMemberChanged("ParentID");
                    this.OnParentIDChanged();
                }
            }
        }
        
        /// <summary>
        /// Gets the collection of associated <see cref="ProjectNote"/> entities.
        /// </summary>
        [Association("Project_ProjectNote", "ID", "ProjectID")]
        [XmlIgnore()]
        public EntityCollection<ProjectNote> ProjectNotes
        {
            get
            {
                if ((this._projectNotes == null))
                {
                    this._projectNotes = new EntityCollection<ProjectNote>(this, "ProjectNotes", this.FilterProjectNotes, this.AttachProjectNotes, this.DetachProjectNotes);
                }
                return this._projectNotes;
            }
        }
        
        /// <summary>
        /// Gets the collection of associated <see cref="Task"/> entities.
        /// </summary>
        [Association("Project_Task", "ID", "ProjectID")]
        [XmlIgnore()]
        public EntityCollection<Task> Tasks
        {
            get
            {
                if ((this._tasks == null))
                {
                    this._tasks = new EntityCollection<Task>(this, "Tasks", this.FilterTasks, this.AttachTasks, this.DetachTasks);
                }
                return this._tasks;
            }
        }
        
        /// <summary>
        /// Gets or sets the 'UserID' value.
        /// </summary>
        [DataMember()]
        public long UserID
        {
            get
            {
                return this._userID;
            }
            set
            {
                if ((this._userID != value))
                {
                    this.OnUserIDChanging(value);
                    this.RaiseDataMemberChanging("UserID");
                    this.ValidateProperty("UserID", value);
                    this._userID = value;
                    this.RaiseDataMemberChanged("UserID");
                    this.OnUserIDChanged();
                }
            }
        }
        
        private void AttachProjectNotes(ProjectNote entity)
        {
            entity.Project = this;
        }
        
        private void DetachProjectNotes(ProjectNote entity)
        {
            entity.Project = null;
        }
        
        private bool FilterProjectNotes(ProjectNote entity)
        {
            return (entity.ProjectID == this.ID);
        }
        
        private void AttachTasks(Task entity)
        {
            entity.Project = this;
        }
        
        private void DetachTasks(Task entity)
        {
            entity.Project = null;
        }
        
        private bool FilterTasks(Task entity)
        {
            return (entity.ProjectID == this.ID);
        }
        
        /// <summary>
        /// Computes a value from the key fields that uniquely identifies this entity instance.
        /// </summary>
        /// <returns>An object instance that uniquely identifies this entity instance.</returns>
        public override object GetIdentity()
        {
            return this._id;
        }
    }
    
    /// <summary>
    /// The 'ProjectNote' entity class.
    /// </summary>
    [DataContract(Namespace="http://schemas.datacontract.org/2004/07/TaskIt.Web")]
    public sealed partial class ProjectNote : Entity
    {
        
        private DateTime _createdDate;
        
        private long _id;
        
        private EntityRef<Project> _project;
        
        private long _projectID;
        
        private EntityRef<TaskItUser> _taskItUser;
        
        private string _text;
        
        private long _userID;
        
        #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 OnCreatedDateChanging(DateTime value);
        partial void OnCreatedDateChanged();
        partial void OnIDChanging(long value);
        partial void OnIDChanged();
        partial void OnProjectIDChanging(long value);
        partial void OnProjectIDChanged();
        partial void OnTextChanging(string value);
        partial void OnTextChanged();
        partial void OnUserIDChanging(long value);
        partial void OnUserIDChanged();

        #endregion
        
        
        /// <summary>
        /// Initializes a new instance of the <see cref="ProjectNote"/> class.
        /// </summary>
        public ProjectNote()
        {
            this.OnCreated();
        }
        
        /// <summary>
        /// Gets or sets the 'CreatedDate' value.
        /// </summary>
        [DataMember()]
        public DateTime CreatedDate
        {
            get
            {
                return this._createdDate;
            }
            set
            {
                if ((this._createdDate != value))
                {
                    this.OnCreatedDateChanging(value);
                    this.RaiseDataMemberChanging("CreatedDate");
                    this.ValidateProperty("CreatedDate", value);
                    this._createdDate = value;
                    this.RaiseDataMemberChanged("CreatedDate");
                    this.OnCreatedDateChanged();
                }
            }
        }
        
        /// <summary>
        /// Gets or sets the 'ID' value.
        /// </summary>
        [DataMember()]
        [Editable(false, AllowInitialValue=true)]
        [Key()]
        [RoundtripOriginal()]
        public long ID
        {
            get
            {
                return this._id;
            }
            set
            {
                if ((this._id != value))
                {
                    this.OnIDChanging(value);
                    this.ValidateProperty("ID", value);
                    this._id = value;
                    this.RaisePropertyChanged("ID");
                    this.OnIDChanged();
                }
            }
        }
        
        /// <summary>
        /// Gets or sets the associated <see cref="Project"/> entity.
        /// </summary>
        [Association("Project_ProjectNote", "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.ProjectNotes.Remove(this);
                    }
                    if ((value != null))
                    {
                        this.ProjectID = value.ID;
                    }
                    else
                    {
                        this.ProjectID = default(long);
                    }
                    this._project.Entity = value;
                    if ((value != null))
                    {
                        value.ProjectNotes.Add(this);
                    }
                    this.RaisePropertyChanged("Project");
                }
            }
        }
        
        /// <summary>
        /// Gets or sets the 'ProjectID' value.
        /// </summary>
        [DataMember()]
        [RoundtripOriginal()]
        public long ProjectID
        {
            get
            {
                return this._projectID;
            }
            set
            {
                if ((this._projectID != value))
                {
                    this.OnProjectIDChanging(value);
                    this.RaiseDataMemberChanging("ProjectID");
                    this.ValidateProperty("ProjectID", value);
                    this._projectID = value;
                    this.RaiseDataMemberChanged("ProjectID");
                    this.OnProjectIDChanged();
                }
            }
        }
        
        /// <summary>
        /// Gets or sets the associated <see cref="TaskItUser"/> entity.
        /// </summary>
        [Association("TaskItUser_ProjectNote", "UserID", "ID", IsForeignKey=true)]
        [XmlIgnore()]
        public TaskItUser TaskItUser
        {
            get
            {
                if ((this._taskItUser == null))
                {
                    this._taskItUser = new EntityRef<TaskItUser>(this, "TaskItUser", this.FilterTaskItUser);
                }
                return this._taskItUser.Entity;
            }
            set
            {
                TaskItUser previous = this.TaskItUser;
                if ((previous != value))
                {
                    this.ValidateProperty("TaskItUser", value);
                    if ((previous != null))
                    {
                        this._taskItUser.Entity = null;
                        previous.ProjectNotes.Remove(this);
                    }
                    if ((value != null))
                    {
                        this.UserID = value.ID;
                    }
                    else
                    {
                        this.UserID = default(long);
                    }
                    this._taskItUser.Entity = value;
                    if ((value != null))
                    {
                        value.ProjectNotes.Add(this);
                    }
                    this.RaisePropertyChanged("TaskItUser");
                }
            }
        }
        
        /// <summary>
        /// Gets or sets the 'Text' value.
        /// </summary>
        [DataMember()]
        [Required()]
        [StringLength(5000)]
        public string Text
        {
            get
            {
                return this._text;
            }
            set
            {
                if ((this._text != value))
                {
                    this.OnTextChanging(value);
                    this.RaiseDataMemberChanging("Text");
                    this.ValidateProperty("Text", value);
                    this._text = value;
                    this.RaiseDataMemberChanged("Text");
                    this.OnTextChanged();
                }
            }
        }
        
        /// <summary>
        /// Gets or sets the 'UserID' value.
        /// </summary>
        [DataMember()]
        [RoundtripOriginal()]
        public long UserID
        {
            get
            {
                return this._userID;
            }
            set
            {
                if ((this._userID != value))
                {
                    this.OnUserIDChanging(value);
                    this.RaiseDataMemberChanging("UserID");
                    this.ValidateProperty("UserID", value);
                    this._userID = value;
                    this.RaiseDataMemberChanged("UserID");
                    this.OnUserIDChanged();
                }
            }
        }
        
        private bool FilterProject(Project entity)
        {
            return (entity.ID == this.ProjectID);
        }
        
        private bool FilterTaskItUser(TaskItUser entity)
        {
            return (entity.ID == this.UserID);
        }
        
        /// <summary>
        /// Computes a value from the key fields that uniquely identifies this entity instance.
        /// </summary>
        /// <returns>An object instance that uniquely identifies this entity instance.</returns>
        public override object GetIdentity()
        {
            return this._id;
        }
    }
    
    /// <summary>
    /// The 'Task' entity class.
    /// </summary>
    [DataContract(Namespace="http://schemas.datacontract.org/2004/07/TaskIt.Web")]
    public sealed partial class Task : Entity
    {
        
        private Nullable<DateTime> _completionDate;
        
        private EntityRef<Contact> _contact;
        
        private long _contactID;
        
        private EntityRef<Context> _context;
        
        private long _contextID;
        
        private DateTime _createdDate;
        
        private string _description;
        
        private Nullable<DateTime> _dueDate;
        
        private long _id;
        
        private DateTime _modifiedDate;
        
        private string _name;
        
        private EntityRef<Priority> _priority;
        
        private long _priorityID;
        
        private EntityRef<Project> _project;
        
        private long _projectID;
        
        private EntityRef<TaskCategory> _taskCategory;
        
        private long _taskCategoryID;
        
        private EntityCollection<TaskNote> _taskNotes;
        
        private long _userID;
        
        #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 OnCompletionDateChanging(Nullable<DateTime> value);
        partial void OnCompletionDateChanged();
        partial void OnContactIDChanging(long value);
        partial void OnContactIDChanged();
        partial void OnContextIDChanging(long value);
        partial void OnContextIDChanged();
        partial void OnCreatedDateChanging(DateTime value);
        partial void OnCreatedDateChanged();
        partial void OnDescriptionChanging(string value);
        partial void OnDescriptionChanged();
        partial void OnDueDateChanging(Nullable<DateTime> value);
        partial void OnDueDateChanged();
        partial void OnIDChanging(long value);
        partial void OnIDChanged();
        partial void OnModifiedDateChanging(DateTime value);
        partial void OnModifiedDateChanged();
        partial void OnNameChanging(string value);
        partial void OnNameChanged();
        partial void OnPriorityIDChanging(long value);
        partial void OnPriorityIDChanged();
        partial void OnProjectIDChanging(long value);
        partial void OnProjectIDChanged();
        partial void OnTaskCategoryIDChanging(long value);
        partial void OnTaskCategoryIDChanged();
        partial void OnUserIDChanging(long value);
        partial void OnUserIDChanged();

        #endregion
        
        
        /// <summary>
        /// Initializes a new instance of the <see cref="Task"/> class.
        /// </summary>
        public Task()
        {
            this.OnCreated();
        }
        
        /// <summary>
        /// Gets or sets the 'CompletionDate' value.
        /// </summary>
        [DataMember()]
        public Nullable<DateTime> CompletionDate
        {
            get
            {
                return this._completionDate;
            }
            set
            {
                if ((this._completionDate != value))
                {
                    this.OnCompletionDateChanging(value);
                    this.RaiseDataMemberChanging("CompletionDate");
                    this.ValidateProperty("CompletionDate", value);
                    this._completionDate = value;
                    this.RaiseDataMemberChanged("CompletionDate");
                    this.OnCompletionDateChanged();
                }
            }
        }
        
        /// <summary>
        /// Gets or sets the associated <see cref="Contact"/> entity.
        /// </summary>
        [Association("Contact_Task", "ContactID", "ID", IsForeignKey=true)]
        [XmlIgnore()]
        public Contact Contact
        {
            get
            {
                if ((this._contact == null))
                {
                    this._contact = new EntityRef<Contact>(this, "Contact", this.FilterContact);
                }
                return this._contact.Entity;
            }
            set
            {
                Contact previous = this.Contact;
                if ((previous != value))
                {
                    this.ValidateProperty("Contact", value);
                    if ((previous != null))
                    {
                        this._contact.Entity = null;
                        previous.Tasks.Remove(this);
                    }
                    if ((value != null))
                    {
                        this.ContactID = value.ID;
                    }
                    else
                    {
                        this.ContactID = default(long);
                    }
                    this._contact.Entity = value;
                    if ((value != null))
                    {
                        value.Tasks.Add(this);
                    }
                    this.RaisePropertyChanged("Contact");
                }
            }
        }
        
        /// <summary>
        /// Gets or sets the 'ContactID' value.
        /// </summary>
        [DataMember()]
        [RoundtripOriginal()]
        public long ContactID
        {
            get
            {
                return this._contactID;
            }
            set
            {
                if ((this._contactID != value))
                {
                    this.OnContactIDChanging(value);
                    this.RaiseDataMemberChanging("ContactID");
                    this.ValidateProperty("ContactID", value);
                    this._contactID = value;
                    this.RaiseDataMemberChanged("ContactID");
                    this.OnContactIDChanged();
                }
            }
        }
        
        /// <summary>
        /// Gets or sets the associated <see cref="Context"/> entity.
        /// </summary>
        [Association("Context_Task", "ContextID", "ID", IsForeignKey=true)]
        [XmlIgnore()]
        public Context Context
        {
            get
            {
                if ((this._context == null))
                {
                    this._context = new EntityRef<Context>(this, "Context", this.FilterContext);
                }
                return this._context.Entity;
            }
            set
            {
                Context previous = this.Context;
                if ((previous != value))
                {
                    this.ValidateProperty("Context", value);
                    if ((previous != null))
                    {
                        this._context.Entity = null;
                        previous.Tasks.Remove(this);
                    }
                    if ((value != null))
                    {
                        this.ContextID = value.ID;
                    }
                    else
                    {
                        this.ContextID = default(long);
                    }
                    this._context.Entity = value;
                    if ((value != null))
                    {
                        value.Tasks.Add(this);
                    }
                    this.RaisePropertyChanged("Context");
                }
            }
        }
        
        /// <summary>
        /// Gets or sets the 'ContextID' value.
        /// </summary>
        [DataMember()]
        [RoundtripOriginal()]
        public long ContextID
        {
            get
            {
                return this._contextID;
            }
            set
            {
                if ((this._contextID != value))
                {
                    this.OnContextIDChanging(value);
                    this.RaiseDataMemberChanging("ContextID");
                    this.ValidateProperty("ContextID", value);
                    this._contextID = value;
                    this.RaiseDataMemberChanged("ContextID");
                    this.OnContextIDChanged();
                }
            }
        }
        
        /// <summary>
        /// Gets or sets the 'CreatedDate' value.
        /// </summary>
        [DataMember()]
        public DateTime CreatedDate
        {
            get
            {
                return this._createdDate;
            }
            set
            {
                if ((this._createdDate != value))
                {
                    this.OnCreatedDateChanging(value);
                    this.RaiseDataMemberChanging("CreatedDate");
                    this.ValidateProperty("CreatedDate", value);
                    this._createdDate = value;
                    this.RaiseDataMemberChanged("CreatedDate");
                    this.OnCreatedDateChanged();
                }
            }
        }
        
        /// <summary>
        /// Gets or sets the 'Description' value.
        /// </summary>
        [DataMember()]
        [StringLength(1000)]
        public string Description
        {
            get
            {
                return this._description;
            }
            set
            {
                if ((this._description != value))
                {
                    this.OnDescriptionChanging(value);
                    this.RaiseDataMemberChanging("Description");
                    this.ValidateProperty("Description", value);
                    this._description = value;
                    this.RaiseDataMemberChanged("Description");
                    this.OnDescriptionChanged();
                }
            }
        }
        
        /// <summary>
        /// Gets or sets the 'DueDate' value.
        /// </summary>
        [DataMember()]
        public Nullable<DateTime> DueDate
        {
            get
            {
                return this._dueDate;
            }
            set
            {
                if ((this._dueDate != value))
                {
                    this.OnDueDateChanging(value);
                    this.RaiseDataMemberChanging("DueDate");
                    this.ValidateProperty("DueDate", value);
                    this._dueDate = value;
                    this.RaiseDataMemberChanged("DueDate");
                    this.OnDueDateChanged();
                }
            }
        }
        
        /// <summary>
        /// Gets or sets the 'ID' value.
        /// </summary>
        [DataMember()]
        [Editable(false, AllowInitialValue=true)]
        [Key()]
        [RoundtripOriginal()]
        public long ID
        {
            get
            {
                return this._id;
            }
            set
            {
                if ((this._id != value))
                {
                    this.OnIDChanging(value);
                    this.ValidateProperty("ID", value);
                    this._id = value;
                    this.RaisePropertyChanged("ID");
                    this.OnIDChanged();
                }
            }
        }
        
        /// <summary>
        /// Gets or sets the 'ModifiedDate' value.
        /// </summary>
        [DataMember()]
        public DateTime ModifiedDate
        {
            get
            {
                return this._modifiedDate;
            }
            set
            {
                if ((this._modifiedDate != value))
                {
                    this.OnModifiedDateChanging(value);
                    this.RaiseDataMemberChanging("ModifiedDate");
                    this.ValidateProperty("ModifiedDate", value);
                    this._modifiedDate = value;
                    this.RaiseDataMemberChanged("ModifiedDate");
                    this.OnModifiedDateChanged();
                }
            }
        }
        
        /// <summary>
        /// Gets or sets the 'Name' value.
        /// </summary>
        [DataMember()]
        [Required()]
        [StringLength(250)]
        public string Name
        {
            get
            {
                return this._name;
            }
            set
            {
                if ((this._name != value))
                {
                    this.OnNameChanging(value);
                    this.RaiseDataMemberChanging("Name");
                    this.ValidateProperty("Name", value);
                    this._name = value;
                    this.RaiseDataMemberChanged("Name");
                    this.OnNameChanged();
                }
            }
        }
        
        /// <summary>
        /// Gets or sets the associated <see cref="Priority"/> entity.
        /// </summary>
        [Association("Priority_Task", "PriorityID", "ID", IsForeignKey=true)]
        [XmlIgnore()]
        public Priority Priority
        {
            get
            {
                if ((this._priority == null))
                {
                    this._priority = new EntityRef<Priority>(this, "Priority", this.FilterPriority);
                }
                return this._priority.Entity;
            }
            set
            {
                Priority previous = this.Priority;
                if ((previous != value))
                {
                    this.ValidateProperty("Priority", value);
                    if ((previous != null))
                    {
                        this._priority.Entity = null;
                        previous.Tasks.Remove(this);
                    }
                    if ((value != null))
                    {
                        this.PriorityID = value.ID;
                    }
                    else
                    {
                        this.PriorityID = default(long);
                    }
                    this._priority.Entity = value;
                    if ((value != null))
                    {
                        value.Tasks.Add(this);
                    }
                    this.RaisePropertyChanged("Priority");
                }
            }
        }
        
        /// <summary>
        /// Gets or sets the 'PriorityID' value.
        /// </summary>
        [DataMember()]
        [RoundtripOriginal()]
        public long PriorityID
        {
            get
            {
                return this._priorityID;
            }
            set
            {
                if ((this._priorityID != value))
                {
                    this.OnPriorityIDChanging(value);
                    this.RaiseDataMemberChanging("PriorityID");
                    this.ValidateProperty("PriorityID", value);
                    this._priorityID = value;
                    this.RaiseDataMemberChanged("PriorityID");
                    this.OnPriorityIDChanged();
                }
            }
        }
        
        /// <summary>
        /// Gets or sets the associated <see cref="Project"/> entity.
        /// </summary>
        [Association("Project_Task", "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.Tasks.Remove(this);
                    }
                    if ((value != null))
                    {
                        this.ProjectID = value.ID;
                    }
                    else
                    {
                        this.ProjectID = default(long);
                    }
                    this._project.Entity = value;
                    if ((value != null))
                    {
                        value.Tasks.Add(this);
                    }
                    this.RaisePropertyChanged("Project");
                }
            }
        }
        
        /// <summary>
        /// Gets or sets the 'ProjectID' value.
        /// </summary>
        [DataMember()]
        [RoundtripOriginal()]
        public long ProjectID
        {
            get
            {
                return this._projectID;
            }
            set
            {
                if ((this._projectID != value))
                {
                    this.OnProjectIDChanging(value);
                    this.RaiseDataMemberChanging("ProjectID");
                    this.ValidateProperty("ProjectID", value);
                    this._projectID = value;
                    this.RaiseDataMemberChanged("ProjectID");
                    this.OnProjectIDChanged();
                }
            }
        }
        
        /// <summary>
        /// Gets or sets the associated <see cref="TaskCategory"/> entity.
        /// </summary>
        [Association("TaskCategory_Task", "TaskCategoryID", "ID", IsForeignKey=true)]
        [XmlIgnore()]
        public TaskCategory TaskCategory
        {
            get
            {
                if ((this._taskCategory == null))
                {
                    this._taskCategory = new EntityRef<TaskCategory>(this, "TaskCategory", this.FilterTaskCategory);
                }
                return this._taskCategory.Entity;
            }
            set
            {
                TaskCategory previous = this.TaskCategory;
                if ((previous != value))
                {
                    this.ValidateProperty("TaskCategory", value);
                    if ((previous != null))
                    {
                        this._taskCategory.Entity = null;
                        previous.Tasks.Remove(this);
                    }
                    if ((value != null))
                    {
                        this.TaskCategoryID = value.ID;
                    }
                    else
                    {
                        this.TaskCategoryID = default(long);
                    }
                    this._taskCategory.Entity = value;
                    if ((value != null))
                    {
                        value.Tasks.Add(this);
                    }
                    this.RaisePropertyChanged("TaskCategory");
                }
            }
        }
        
        /// <summary>
        /// Gets or sets the 'TaskCategoryID' value.
        /// </summary>
        [DataMember()]
        [RoundtripOriginal()]
        public long TaskCategoryID
        {
            get
            {
                return this._taskCategoryID;
            }
            set
            {
                if ((this._taskCategoryID != value))
                {
                    this.OnTaskCategoryIDChanging(value);
                    this.RaiseDataMemberChanging("TaskCategoryID");
                    this.ValidateProperty("TaskCategoryID", value);
                    this._taskCategoryID = value;
                    this.RaiseDataMemberChanged("TaskCategoryID");
                    this.OnTaskCategoryIDChanged();
                }
            }
        }
        
        /// <summary>
        /// Gets the collection of associated <see cref="TaskNote"/> entities.
        /// </summary>
        [Association("Task_TaskNote", "ID", "TaskID")]
        [XmlIgnore()]
        public EntityCollection<TaskNote> TaskNotes
        {
            get
            {
                if ((this._taskNotes == null))
                {
                    this._taskNotes = new EntityCollection<TaskNote>(this, "TaskNotes", this.FilterTaskNotes, this.AttachTaskNotes, this.DetachTaskNotes);
                }
                return this._taskNotes;
            }
        }
        
        /// <summary>
        /// Gets or sets the 'UserID' value.
        /// </summary>
        [DataMember()]
        public long UserID
        {
            get
            {
                return this._userID;
            }
            set
            {
                if ((this._userID != value))
                {
                    this.OnUserIDChanging(value);
                    this.RaiseDataMemberChanging("UserID");
                    this.ValidateProperty("UserID", value);
                    this._userID = value;
                    this.RaiseDataMemberChanged("UserID");
                    this.OnUserIDChanged();
                }
            }
        }
        
        private bool FilterContact(Contact entity)
        {
            return (entity.ID == this.ContactID);
        }
        
        private bool FilterContext(Context entity)
        {
            return (entity.ID == this.ContextID);
        }
        
        private bool FilterPriority(Priority entity)
        {
            return (entity.ID == this.PriorityID);
        }
        
        private bool FilterProject(Project entity)
        {
            return (entity.ID == this.ProjectID);
        }
        
        private bool FilterTaskCategory(TaskCategory entity)
        {
            return (entity.ID == this.TaskCategoryID);
        }
        
        private void AttachTaskNotes(TaskNote entity)
        {
            entity.Task = this;
        }
        
        private void DetachTaskNotes(TaskNote entity)
        {
            entity.Task = null;
        }
        
        private bool FilterTaskNotes(TaskNote entity)
        {
            return (entity.TaskID == this.ID);
        }
        
        /// <summary>
        /// Computes a value from the key fields that uniquely identifies this entity instance.
        /// </summary>
        /// <returns>An object instance that uniquely identifies this entity instance.</returns>
        public override object GetIdentity()
        {
            return this._id;
        }
    }
    
    /// <summary>
    /// The 'TaskCategory' entity class.
    /// </summary>
    [DataContract(Namespace="http://schemas.datacontract.org/2004/07/TaskIt.Web")]
    public sealed partial class TaskCategory : Entity
    {
        
        private long _id;
        
        private string _name;
        
        private EntityCollection<Task> _tasks;
        
        #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(long value);
        partial void OnIDChanged();
        partial void OnNameChanging(string value);
        partial void OnNameChanged();

        #endregion
        
        
        /// <summary>
        /// Initializes a new instance of the <see cref="TaskCategory"/> class.
        /// </summary>
        public TaskCategory()
        {
            this.OnCreated();
        }
        
        /// <summary>
        /// Gets or sets the 'ID' value.
        /// </summary>
        [DataMember()]
        [Editable(false, AllowInitialValue=true)]
        [Key()]
        [RoundtripOriginal()]
        public long ID
        {
            get
            {
                return this._id;
            }
            set
            {
                if ((this._id != value))
                {
                    this.OnIDChanging(value);
                    this.ValidateProperty("ID", value);
                    this._id = value;
                    this.RaisePropertyChanged("ID");
                    this.OnIDChanged();
                }
            }
        }
        
        /// <summary>
        /// Gets or sets the 'Name' value.
        /// </summary>
        [DataMember()]
        [Required()]
        [StringLength(50)]
        public string Name
        {
            get
            {
                return this._name;
            }
            set
            {
                if ((this._name != value))
                {
                    this.OnNameChanging(value);
                    this.RaiseDataMemberChanging("Name");
                    this.ValidateProperty("Name", value);
                    this._name = value;
                    this.RaiseDataMemberChanged("Name");
                    this.OnNameChanged();
                }
            }
        }
        
        /// <summary>
        /// Gets the collection of associated <see cref="Task"/> entities.
        /// </summary>
        [Association("TaskCategory_Task", "ID", "TaskCategoryID")]
        [XmlIgnore()]
        public EntityCollection<Task> Tasks
        {
            get
            {
                if ((this._tasks == null))
                {
                    this._tasks = new EntityCollection<Task>(this, "Tasks", this.FilterTasks, this.AttachTasks, this.DetachTasks);
                }
                return this._tasks;
            }
        }
        
        private void AttachTasks(Task entity)
        {
            entity.TaskCategory = this;
        }
        
        private void DetachTasks(Task entity)
        {
            entity.TaskCategory = null;
        }
        
        private bool FilterTasks(Task entity)
        {
            return (entity.TaskCategoryID == this.ID);
        }
        
        /// <summary>
        /// Computes a value from the key fields that uniquely identifies this entity instance.
        /// </summary>
        /// <returns>An object instance that uniquely identifies this entity instance.</returns>
        public override object GetIdentity()
        {
            return this._id;
        }
    }
    
    /// <summary>
    /// The 'TaskItUser' entity class.
    /// </summary>
    [DataContract(Namespace="http://schemas.datacontract.org/2004/07/TaskIt.Web")]
    public sealed partial class TaskItUser : Entity
    {
        
        private EntityCollection<ContactNote> _contactNotes;
        
        private EntityCollection<ContextNote> _contextNotes;
        
        private DateTime _createdDate;
        
        private string _email;
        
        private string _facebookPassword;
        
        private string _facebookUsername;
        
        private string _firstName;
        
        private long _id;
        
        private string _lastName;
        
        private DateTime _modifiedDate;
        
        private string _password;
        
        private EntityCollection<ProjectNote> _projectNotes;
        
        private EntityCollection<TaskNote> _taskNotes;
        
        private string _twitterPassword;
        
        private string _twitterUsername;
        
        private string _username;
        
        #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 OnCreatedDateChanging(DateTime value);
        partial void OnCreatedDateChanged();
        partial void OnEmailChanging(string value);
        partial void OnEmailChanged();
        partial void OnFacebookPasswordChanging(string value);
        partial void OnFacebookPasswordChanged();
        partial void OnFacebookUsernameChanging(string value);
        partial void OnFacebookUsernameChanged();
        partial void OnFirstNameChanging(string value);
        partial void OnFirstNameChanged();
        partial void OnIDChanging(long value);
        partial void OnIDChanged();
        partial void OnLastNameChanging(string value);
        partial void OnLastNameChanged();
        partial void OnModifiedDateChanging(DateTime value);
        partial void OnModifiedDateChanged();
        partial void OnPasswordChanging(string value);
        partial void OnPasswordChanged();
        partial void OnTwitterPasswordChanging(string value);
        partial void OnTwitterPasswordChanged();
        partial void OnTwitterUsernameChanging(string value);
        partial void OnTwitterUsernameChanged();
        partial void OnUsernameChanging(string value);
        partial void OnUsernameChanged();

        #endregion
        
        
        /// <summary>
        /// Initializes a new instance of the <see cref="TaskItUser"/> class.
        /// </summary>
        public TaskItUser()
        {
            this.OnCreated();
        }
        
        /// <summary>
        /// Gets the collection of associated <see cref="ContactNote"/> entities.
        /// </summary>
        [Association("TaskItUser_ContactNote", "ID", "UserID")]
        [XmlIgnore()]
        public EntityCollection<ContactNote> ContactNotes
        {
            get
            {
                if ((this._contactNotes == null))
                {
                    this._contactNotes = new EntityCollection<ContactNote>(this, "ContactNotes", this.FilterContactNotes, this.AttachContactNotes, this.DetachContactNotes);
                }
                return this._contactNotes;
            }
        }
        
        /// <summary>
        /// Gets the collection of associated <see cref="ContextNote"/> entities.
        /// </summary>
        [Association("TaskItUser_ContextNote", "ID", "UserID")]
        [XmlIgnore()]
        public EntityCollection<ContextNote> ContextNotes
        {
            get
            {
                if ((this._contextNotes == null))
                {
                    this._contextNotes = new EntityCollection<ContextNote>(this, "ContextNotes", this.FilterContextNotes, this.AttachContextNotes, this.DetachContextNotes);
                }
                return this._contextNotes;
            }
        }
        
        /// <summary>
        /// Gets or sets the 'CreatedDate' value.
        /// </summary>
        [DataMember()]
        public DateTime CreatedDate
        {
            get
            {
                return this._createdDate;
            }
            set
            {
                if ((this._createdDate != value))
                {
                    this.OnCreatedDateChanging(value);
                    this.RaiseDataMemberChanging("CreatedDate");
                    this.ValidateProperty("CreatedDate", value);
                    this._createdDate = value;
                    this.RaiseDataMemberChanged("CreatedDate");
                    this.OnCreatedDateChanged();
                }
            }
        }
        
        /// <summary>
        /// Gets or sets the 'Email' value.
        /// </summary>
        [DataMember()]
        [StringLength(100)]
        public string Email
        {
            get
            {
                return this._email;
            }
            set
            {
                if ((this._email != value))
                {
                    this.OnEmailChanging(value);
                    this.RaiseDataMemberChanging("Email");
                    this.ValidateProperty("Email", value);
                    this._email = value;
                    this.RaiseDataMemberChanged("Email");
                    this.OnEmailChanged();
                }
            }
        }
        
        /// <summary>
        /// Gets or sets the 'FacebookPassword' value.
        /// </summary>
        [DataMember()]
        [StringLength(100)]
        public string FacebookPassword
        {
            get
            {
                return this._facebookPassword;
            }
            set
            {
                if ((this._facebookPassword != value))
                {
                    this.OnFacebookPasswordChanging(value);
                    this.RaiseDataMemberChanging("FacebookPassword");
                    this.ValidateProperty("FacebookPassword", value);
                    this._facebookPassword = value;
                    this.RaiseDataMemberChanged("FacebookPassword");
                    this.OnFacebookPasswordChanged();
                }
            }
        }
        
        /// <summary>
        /// Gets or sets the 'FacebookUsername' value.
        /// </summary>
        [DataMember()]
        [StringLength(100)]
        public string FacebookUsername
        {
            get
            {
                return this._facebookUsername;
            }
            set
            {
                if ((this._facebookUsername != value))
                {
                    this.OnFacebookUsernameChanging(value);
                    this.RaiseDataMemberChanging("FacebookUsername");
                    this.ValidateProperty("FacebookUsername", value);
                    this._facebookUsername = value;
                    this.RaiseDataMemberChanged("FacebookUsername");
                    this.OnFacebookUsernameChanged();
                }
            }
        }
        
        /// <summary>
        /// Gets or sets the 'FirstName' value.
        /// </summary>
        [DataMember()]
        [StringLength(50)]
        public string FirstName
        {
            get
            {
                return this._firstName;
            }
            set
            {
                if ((this._firstName != value))
                {
                    this.OnFirstNameChanging(value);
                    this.RaiseDataMemberChanging("FirstName");
                    this.ValidateProperty("FirstName", value);
                    this._firstName = value;
                    this.RaiseDataMemberChanged("FirstName");
                    this.OnFirstNameChanged();
                }
            }
        }
        
        /// <summary>
        /// Gets or sets the 'ID' value.
        /// </summary>
        [DataMember()]
        [Editable(false, AllowInitialValue=true)]
        [Key()]
        [RoundtripOriginal()]
        public long ID
        {
            get
            {
                return this._id;
            }
            set
            {
                if ((this._id != value))
                {
                    this.OnIDChanging(value);
                    this.ValidateProperty("ID", value);
                    this._id = value;
                    this.RaisePropertyChanged("ID");
                    this.OnIDChanged();
                }
            }
        }
        
        /// <summary>
        /// Gets or sets the 'LastName' value.
        /// </summary>
        [DataMember()]
        [StringLength(50)]
        public string LastName
        {
            get
            {
                return this._lastName;
            }
            set
            {
                if ((this._lastName != value))
                {
                    this.OnLastNameChanging(value);
                    this.RaiseDataMemberChanging("LastName");
                    this.ValidateProperty("LastName", value);
                    this._lastName = value;
                    this.RaiseDataMemberChanged("LastName");
                    this.OnLastNameChanged();
                }
            }
        }
        
        /// <summary>
        /// Gets or sets the 'ModifiedDate' value.
        /// </summary>
        [DataMember()]
        public DateTime ModifiedDate
        {
            get
            {
                return this._modifiedDate;
            }
            set
            {
                if ((this._modifiedDate != value))
                {
                    this.OnModifiedDateChanging(value);
                    this.RaiseDataMemberChanging("ModifiedDate");
                    this.ValidateProperty("ModifiedDate", value);
                    this._modifiedDate = value;
                    this.RaiseDataMemberChanged("ModifiedDate");
                    this.OnModifiedDateChanged();
                }
            }
        }
        
        /// <summary>
        /// Gets or sets the 'Password' value.
        /// </summary>
        [DataMember()]
        [Required()]
        [StringLength(50)]
        public string Password
        {
            get
            {
                return this._password;
            }
            set
            {
                if ((this._password != value))
                {
                    this.OnPasswordChanging(value);
                    this.RaiseDataMemberChanging("Password");
                    this.ValidateProperty("Password", value);
                    this._password = value;
                    this.RaiseDataMemberChanged("Password");
                    this.OnPasswordChanged();
                }
            }
        }
        
        /// <summary>
        /// Gets the collection of associated <see cref="ProjectNote"/> entities.
        /// </summary>
        [Association("TaskItUser_ProjectNote", "ID", "UserID")]
        [XmlIgnore()]
        public EntityCollection<ProjectNote> ProjectNotes
        {
            get
            {
                if ((this._projectNotes == null))
                {
                    this._projectNotes = new EntityCollection<ProjectNote>(this, "ProjectNotes", this.FilterProjectNotes, this.AttachProjectNotes, this.DetachProjectNotes);
                }
                return this._projectNotes;
            }
        }
        
        /// <summary>
        /// Gets the collection of associated <see cref="TaskNote"/> entities.
        /// </summary>
        [Association("TaskItUser_TaskNote", "ID", "UserID")]
        [XmlIgnore()]
        public EntityCollection<TaskNote> TaskNotes
        {
            get
            {
                if ((this._taskNotes == null))
                {
                    this._taskNotes = new EntityCollection<TaskNote>(this, "TaskNotes", this.FilterTaskNotes, this.AttachTaskNotes, this.DetachTaskNotes);
                }
                return this._taskNotes;
            }
        }
        
        /// <summary>
        /// Gets or sets the 'TwitterPassword' value.
        /// </summary>
        [DataMember()]
        [StringLength(100)]
        public string TwitterPassword
        {
            get
            {
                return this._twitterPassword;
            }
            set
            {
                if ((this._twitterPassword != value))
                {
                    this.OnTwitterPasswordChanging(value);
                    this.RaiseDataMemberChanging("TwitterPassword");
                    this.ValidateProperty("TwitterPassword", value);
                    this._twitterPassword = value;
                    this.RaiseDataMemberChanged("TwitterPassword");
                    this.OnTwitterPasswordChanged();
                }
            }
        }
        
        /// <summary>
        /// Gets or sets the 'TwitterUsername' value.
        /// </summary>
        [DataMember()]
        [StringLength(100)]
        public string TwitterUsername
        {
            get
            {
                return this._twitterUsername;
            }
            set
            {
                if ((this._twitterUsername != value))
                {
                    this.OnTwitterUsernameChanging(value);
                    this.RaiseDataMemberChanging("TwitterUsername");
                    this.ValidateProperty("TwitterUsername", value);
                    this._twitterUsername = value;
                    this.RaiseDataMemberChanged("TwitterUsername");
                    this.OnTwitterUsernameChanged();
                }
            }
        }
        
        /// <summary>
        /// Gets or sets the 'Username' value.
        /// </summary>
        [DataMember()]
        [Required()]
        [StringLength(50)]
        public string Username
        {
            get
            {
                return this._username;
            }
            set
            {
                if ((this._username != value))
                {
                    this.OnUsernameChanging(value);
                    this.RaiseDataMemberChanging("Username");
                    this.ValidateProperty("Username", value);
                    this._username = value;
                    this.RaiseDataMemberChanged("Username");
                    this.OnUsernameChanged();
                }
            }
        }
        
        private void AttachContactNotes(ContactNote entity)
        {
            entity.TaskItUser = this;
        }
        
        private void DetachContactNotes(ContactNote entity)
        {
            entity.TaskItUser = null;
        }
        
        private bool FilterContactNotes(ContactNote entity)
        {
            return (entity.UserID == this.ID);
        }
        
        private void AttachContextNotes(ContextNote entity)
        {
            entity.TaskItUser = this;
        }
        
        private void DetachContextNotes(ContextNote entity)
        {
            entity.TaskItUser = null;
        }
        
        private bool FilterContextNotes(ContextNote entity)
        {
            return (entity.UserID == this.ID);
        }
        
        private void AttachProjectNotes(ProjectNote entity)
        {
            entity.TaskItUser = this;
        }
        
        private void DetachProjectNotes(ProjectNote entity)
        {
            entity.TaskItUser = null;
        }
        
        private bool FilterProjectNotes(ProjectNote entity)
        {
            return (entity.UserID == this.ID);
        }
        
        private void AttachTaskNotes(TaskNote entity)
        {
            entity.TaskItUser = this;
        }
        
        private void DetachTaskNotes(TaskNote entity)
        {
            entity.TaskItUser = null;
        }
        
        private bool FilterTaskNotes(TaskNote entity)
        {
            return (entity.UserID == this.ID);
        }
        
        /// <summary>
        /// Computes a value from the key fields that uniquely identifies this entity instance.
        /// </summary>
        /// <returns>An object instance that uniquely identifies this entity instance.</returns>
        public override object GetIdentity()
        {
            return this._id;
        }
    }
    
    /// <summary>
    /// The 'TaskNote' entity class.
    /// </summary>
    [DataContract(Namespace="http://schemas.datacontract.org/2004/07/TaskIt.Web")]
    public sealed partial class TaskNote : Entity
    {
        
        private DateTime _createdDate;
        
        private long _id;
        
        private EntityRef<Task> _task;
        
        private long _taskID;
        
        private EntityRef<TaskItUser> _taskItUser;
        
        private string _text;
        
        private long _userID;
        
        #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 OnCreatedDateChanging(DateTime value);
        partial void OnCreatedDateChanged();
        partial void OnIDChanging(long value);
        partial void OnIDChanged();
        partial void OnTaskIDChanging(long value);
        partial void OnTaskIDChanged();
        partial void OnTextChanging(string value);
        partial void OnTextChanged();
        partial void OnUserIDChanging(long value);
        partial void OnUserIDChanged();

        #endregion
        
        
        /// <summary>
        /// Initializes a new instance of the <see cref="TaskNote"/> class.
        /// </summary>
        public TaskNote()
        {
            this.OnCreated();
        }
        
        /// <summary>
        /// Gets or sets the 'CreatedDate' value.
        /// </summary>
        [DataMember()]
        public DateTime CreatedDate
        {
            get
            {
                return this._createdDate;
            }
            set
            {
                if ((this._createdDate != value))
                {
                    this.OnCreatedDateChanging(value);
                    this.RaiseDataMemberChanging("CreatedDate");
                    this.ValidateProperty("CreatedDate", value);
                    this._createdDate = value;
                    this.RaiseDataMemberChanged("CreatedDate");
                    this.OnCreatedDateChanged();
                }
            }
        }
        
        /// <summary>
        /// Gets or sets the 'ID' value.
        /// </summary>
        [DataMember()]
        [Editable(false, AllowInitialValue=true)]
        [Key()]
        [RoundtripOriginal()]
        public long ID
        {
            get
            {
                return this._id;
            }
            set
            {
                if ((this._id != value))
                {
                    this.OnIDChanging(value);
                    this.ValidateProperty("ID", value);
                    this._id = value;
                    this.RaisePropertyChanged("ID");
                    this.OnIDChanged();
                }
            }
        }
        
        /// <summary>
        /// Gets or sets the associated <see cref="Task"/> entity.
        /// </summary>
        [Association("Task_TaskNote", "TaskID", "ID", IsForeignKey=true)]
        [XmlIgnore()]
        public Task Task
        {
            get
            {
                if ((this._task == null))
                {
                    this._task = new EntityRef<Task>(this, "Task", this.FilterTask);
                }
                return this._task.Entity;
            }
            set
            {
                Task previous = this.Task;
                if ((previous != value))
                {
                    this.ValidateProperty("Task", value);
                    if ((previous != null))
                    {
                        this._task.Entity = null;
                        previous.TaskNotes.Remove(this);
                    }
                    if ((value != null))
                    {
                        this.TaskID = value.ID;
                    }
                    else
                    {
                        this.TaskID = default(long);
                    }
                    this._task.Entity = value;
                    if ((value != null))
                    {
                        value.TaskNotes.Add(this);
                    }
                    this.RaisePropertyChanged("Task");
                }
            }
        }
        
        /// <summary>
        /// Gets or sets the 'TaskID' value.
        /// </summary>
        [DataMember()]
        [RoundtripOriginal()]
        public long TaskID
        {
            get
            {
                return this._taskID;
            }
            set
            {
                if ((this._taskID != value))
                {
                    this.OnTaskIDChanging(value);
                    this.RaiseDataMemberChanging("TaskID");
                    this.ValidateProperty("TaskID", value);
                    this._taskID = value;
                    this.RaiseDataMemberChanged("TaskID");
                    this.OnTaskIDChanged();
                }
            }
        }
        
        /// <summary>
        /// Gets or sets the associated <see cref="TaskItUser"/> entity.
        /// </summary>
        [Association("TaskItUser_TaskNote", "UserID", "ID", IsForeignKey=true)]
        [XmlIgnore()]
        public TaskItUser TaskItUser
        {
            get
            {
                if ((this._taskItUser == null))
                {
                    this._taskItUser = new EntityRef<TaskItUser>(this, "TaskItUser", this.FilterTaskItUser);
                }
                return this._taskItUser.Entity;
            }
            set
            {
                TaskItUser previous = this.TaskItUser;
                if ((previous != value))
                {
                    this.ValidateProperty("TaskItUser", value);
                    if ((previous != null))
                    {
                        this._taskItUser.Entity = null;
                        previous.TaskNotes.Remove(this);
                    }
                    if ((value != null))
                    {
                        this.UserID = value.ID;
                    }
                    else
                    {
                        this.UserID = default(long);
                    }
                    this._taskItUser.Entity = value;
                    if ((value != null))
                    {
                        value.TaskNotes.Add(this);
                    }
                    this.RaisePropertyChanged("TaskItUser");
                }
            }
        }
        
        /// <summary>
        /// Gets or sets the 'Text' value.
        /// </summary>
        [DataMember()]
        [Required()]
        [StringLength(5000)]
        public string Text
        {
            get
            {
                return this._text;
            }
            set
            {
                if ((this._text != value))
                {
                    this.OnTextChanging(value);
                    this.RaiseDataMemberChanging("Text");
                    this.ValidateProperty("Text", value);
                    this._text = value;
                    this.RaiseDataMemberChanged("Text");
                    this.OnTextChanged();
                }
            }
        }
        
        /// <summary>
        /// Gets or sets the 'UserID' value.
        /// </summary>
        [DataMember()]
        [RoundtripOriginal()]
        public long UserID
        {
            get
            {
                return this._userID;
            }
            set
            {
                if ((this._userID != value))
                {
                    this.OnUserIDChanging(value);
                    this.RaiseDataMemberChanging("UserID");
                    this.ValidateProperty("UserID", value);
                    this._userID = value;
                    this.RaiseDataMemberChanged("UserID");
                    this.OnUserIDChanged();
                }
            }
        }
        
        private bool FilterTask(Task entity)
        {
            return (entity.ID == this.TaskID);
        }
        
        private bool FilterTaskItUser(TaskItUser entity)
        {
            return (entity.ID == this.UserID);
        }
        
        /// <summary>
        /// Computes a value from the key fields that uniquely identifies this entity instance.
        /// </summary>
        /// <returns>An object instance that uniquely identifies this entity instance.</returns>
        public override object GetIdentity()
        {
            return this._id;
        }
    }
}
namespace TaskIt.Web.Services
{
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.ComponentModel.DataAnnotations;
    using System.Linq;
    using System.ServiceModel;
    using System.ServiceModel.DomainServices;
    using System.ServiceModel.DomainServices.Client;
    using System.ServiceModel.DomainServices.Client.ApplicationServices;
    using System.ServiceModel.Web;
    using TaskIt.Web;
    
    
    /// <summary>
    /// The domain context corresponding to the 'DataService' domain service.
    /// </summary>
    public sealed partial class DataContext : 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>
        /// Initializes a new instance of the <see cref="DataContext"/> class.
        /// </summary>
        public DataContext() : 
                this(new WebDomainClient<IDataServiceContract>(new Uri("TaskIt-Web-Services-DataService.svc", UriKind.Relative)))
        {
        }
        
        /// <summary>
        /// Initializes a new instance of the <see cref="DataContext"/> class with the specified service URI.
        /// </summary>
        /// <param name="serviceUri">The DataService service URI.</param>
        public DataContext(Uri serviceUri) : 
                this(new WebDomainClient<IDataServiceContract>(serviceUri))
        {
        }
        
        /// <summary>
        /// Initializes a new instance of the <see cref="DataContext"/> class with the specified <paramref name="domainClient"/>.
        /// </summary>
        /// <param name="domainClient">The DomainClient instance to use for this domain context.</param>
        public DataContext(DomainClient domainClient) : 
                base(domainClient)
        {
            this.OnCreated();
        }
        
        /// <summary>
        /// Gets the set of <see cref="Task"/> entities that have been loaded into this <see cref="DataContext"/> instance.
        /// </summary>
        public EntitySet<Task> Tasks
        {
            get
            {
                return base.EntityContainer.GetEntitySet<Task>();
            }
        }
        
        /// <summary>
        /// Gets the set of <see cref="ContactNote"/> entities that have been loaded into this <see cref="DataContext"/> instance.
        /// </summary>
        public EntitySet<ContactNote> ContactNotes
        {
            get
            {
                return base.EntityContainer.GetEntitySet<ContactNote>();
            }
        }
        
        /// <summary>
        /// Gets the set of <see cref="Contact"/> entities that have been loaded into this <see cref="DataContext"/> instance.
        /// </summary>
        public EntitySet<Contact> Contacts
        {
            get
            {
                return base.EntityContainer.GetEntitySet<Contact>();
            }
        }
        
        /// <summary>
        /// Gets the set of <see cref="ContextNote"/> entities that have been loaded into this <see cref="DataContext"/> instance.
        /// </summary>
        public EntitySet<ContextNote> ContextNotes
        {
            get
            {
                return base.EntityContainer.GetEntitySet<ContextNote>();
            }
        }
        
        /// <summary>
        /// Gets the set of <see cref="Context"/> entities that have been loaded into this <see cref="DataContext"/> instance.
        /// </summary>
        public EntitySet<Context> Contexts
        {
            get
            {
                return base.EntityContainer.GetEntitySet<Context>();
            }
        }
        
        /// <summary>
        /// Gets the set of <see cref="Priority"/> entities that have been loaded into this <see cref="DataContext"/> instance.
        /// </summary>
        public EntitySet<Priority> Priorities
        {
            get
            {
                return base.EntityContainer.GetEntitySet<Priority>();
            }
        }
        
        /// <summary>
        /// Gets the set of <see cref="ProjectNote"/> entities that have been loaded into this <see cref="DataContext"/> instance.
        /// </summary>
        public EntitySet<ProjectNote> ProjectNotes
        {
            get
            {
                return base.EntityContainer.GetEntitySet<ProjectNote>();
            }
        }
        
        /// <summary>
        /// Gets the set of <see cref="Project"/> entities that have been loaded into this <see cref="DataContext"/> instance.
        /// </summary>
        public EntitySet<Project> Projects
        {
            get
            {
                return base.EntityContainer.GetEntitySet<Project>();
            }
        }
        
        /// <summary>
        /// Gets the set of <see cref="TaskCategory"/> entities that have been loaded into this <see cref="DataContext"/> instance.
        /// </summary>
        public EntitySet<TaskCategory> TaskCategories
        {
            get
            {
                return base.EntityContainer.GetEntitySet<TaskCategory>();
            }
        }
        
        /// <summary>
        /// Gets the set of <see cref="TaskNote"/> entities that have been loaded into this <see cref="DataContext"/> instance.
        /// </summary>
        public EntitySet<TaskNote> TaskNotes
        {
            get
            {
                return base.EntityContainer.GetEntitySet<TaskNote>();
            }
        }
        
        /// <summary>
        /// Gets the set of <see cref="TaskItUser"/> entities that have been loaded into this <see cref="DataContext"/> instance.
        /// </summary>
        public EntitySet<TaskItUser> TaskItUsers
        {
            get
            {
                return base.EntityContainer.GetEntitySet<TaskItUser>();
            }
        }
        
        /// <summary>
        /// Gets an EntityQuery instance that can be used to load <see cref="Task"/> entities using the 'GetAllTasks' query.
        /// </summary>
        /// <param name="userID">The value for the 'userID' parameter of the query.</param>
        /// <param name="showCompleted">The value for the 'showCompleted' parameter of the query.</param>
        /// <param name="showDue">The value for the 'showDue' parameter of the query.</param>
        /// <returns>An EntityQuery that can be loaded to retrieve <see cref="Task"/> entities.</returns>
        public EntityQuery<Task> GetAllTasksQuery(long userID, bool showCompleted, bool showDue)
        {
            Dictionary<string, object> parameters = new Dictionary<string, object>();
            parameters.Add("userID", userID);
            parameters.Add("showCompleted", showCompleted);
            parameters.Add("showDue", showDue);
            this.ValidateMethod("GetAllTasksQuery", parameters);
            return base.CreateQuery<Task>("GetAllTasks", parameters, false, true);
        }
        
        /// <summary>
        /// Gets an EntityQuery instance that can be used to load <see cref="Task"/> entities using the 'GetCompletedBlogPosts' query.
        /// </summary>
        /// <returns>An EntityQuery that can be loaded to retrieve <see cref="Task"/> entities.</returns>
        public EntityQuery<Task> GetCompletedBlogPostsQuery()
        {
            this.ValidateMethod("GetCompletedBlogPostsQuery", null);
            return base.CreateQuery<Task>("GetCompletedBlogPosts", null, false, true);
        }
        
        /// <summary>
        /// Gets an EntityQuery instance that can be used to load <see cref="Task"/> entities using the 'GetCompletedVideos' query.
        /// </summary>
        /// <returns>An EntityQuery that can be loaded to retrieve <see cref="Task"/> entities.</returns>
        public EntityQuery<Task> GetCompletedVideosQuery()
        {
            this.ValidateMethod("GetCompletedVideosQuery", null);
            return base.CreateQuery<Task>("GetCompletedVideos", null, false, true);
        }
        
        /// <summary>
        /// Gets an EntityQuery instance that can be used to load <see cref="Task"/> entities using the 'GetCompletedWebinars' query.
        /// </summary>
        /// <returns>An EntityQuery that can be loaded to retrieve <see cref="Task"/> entities.</returns>
        public EntityQuery<Task> GetCompletedWebinarsQuery()
        {
            this.ValidateMethod("GetCompletedWebinarsQuery", null);
            return base.CreateQuery<Task>("GetCompletedWebinars", null, false, true);
        }
        
        /// <summary>
        /// Gets an EntityQuery instance that can be used to load <see cref="ContactNote"/> entities using the 'GetContactNotes' query.
        /// </summary>
        /// <param name="contactID">The value for the 'contactID' parameter of the query.</param>
        /// <returns>An EntityQuery that can be loaded to retrieve <see cref="ContactNote"/> entities.</returns>
        public EntityQuery<ContactNote> GetContactNotesQuery(long contactID)
        {
            Dictionary<string, object> parameters = new Dictionary<string, object>();
            parameters.Add("contactID", contactID);
            this.ValidateMethod("GetContactNotesQuery", parameters);
            return base.CreateQuery<ContactNote>("GetContactNotes", parameters, false, true);
        }
        
        /// <summary>
        /// Gets an EntityQuery instance that can be used to load <see cref="Contact"/> entities using the 'GetContacts' query.
        /// </summary>
        /// <param name="userID">The value for the 'userID' parameter of the query.</param>
        /// <returns>An EntityQuery that can be loaded to retrieve <see cref="Contact"/> entities.</returns>
        public EntityQuery<Contact> GetContactsQuery(long userID)
        {
            Dictionary<string, object> parameters = new Dictionary<string, object>();
            parameters.Add("userID", userID);
            this.ValidateMethod("GetContactsQuery", parameters);
            return base.CreateQuery<Contact>("GetContacts", parameters, false, true);
        }
        
        /// <summary>
        /// Gets an EntityQuery instance that can be used to load <see cref="ContextNote"/> entities using the 'GetContextNotes' query.
        /// </summary>
        /// <param name="contextID">The value for the 'contextID' parameter of the query.</param>
        /// <returns>An EntityQuery that can be loaded to retrieve <see cref="ContextNote"/> entities.</returns>
        public EntityQuery<ContextNote> GetContextNotesQuery(long contextID)
        {
            Dictionary<string, object> parameters = new Dictionary<string, object>();
            parameters.Add("contextID", contextID);
            this.ValidateMethod("GetContextNotesQuery", parameters);
            return base.CreateQuery<ContextNote>("GetContextNotes", parameters, false, true);
        }
        
        /// <summary>
        /// Gets an EntityQuery instance that can be used to load <see cref="Context"/> entities using the 'GetContexts' query.
        /// </summary>
        /// <param name="userID">The value for the 'userID' parameter of the query.</param>
        /// <returns>An EntityQuery that can be loaded to retrieve <see cref="Context"/> entities.</returns>
        public EntityQuery<Context> GetContextsQuery(long userID)
        {
            Dictionary<string, object> parameters = new Dictionary<string, object>();
            parameters.Add("userID", userID);
            this.ValidateMethod("GetContextsQuery", parameters);
            return base.CreateQuery<Context>("GetContexts", parameters, false, true);
        }
        
        /// <summary>
        /// Gets an EntityQuery instance that can be used to load <see cref="Task"/> entities using the 'GetOverdueTasks' query.
        /// </summary>
        /// <param name="userID">The value for the 'userID' parameter of the query.</param>
        /// <returns>An EntityQuery that can be loaded to retrieve <see cref="Task"/> entities.</returns>
        public EntityQuery<Task> GetOverdueTasksQuery(long userID)
        {
            Dictionary<string, object> parameters = new Dictionary<string, object>();
            parameters.Add("userID", userID);
            this.ValidateMethod("GetOverdueTasksQuery", parameters);
            return base.CreateQuery<Task>("GetOverdueTasks", parameters, false, true);
        }
        
        /// <summary>
        /// Gets an EntityQuery instance that can be used to load <see cref="Priority"/> entities using the 'GetPriorities' query.
        /// </summary>
        /// <returns>An EntityQuery that can be loaded to retrieve <see cref="Priority"/> entities.</returns>
        public EntityQuery<Priority> GetPrioritiesQuery()
        {
            this.ValidateMethod("GetPrioritiesQuery", null);
            return base.CreateQuery<Priority>("GetPriorities", null, false, true);
        }
        
        /// <summary>
        /// Gets an EntityQuery instance that can be used to load <see cref="ProjectNote"/> entities using the 'GetProjectNotes' query.
        /// </summary>
        /// <param name="projectID">The value for the 'projectID' parameter of the query.</param>
        /// <returns>An EntityQuery that can be loaded to retrieve <see cref="ProjectNote"/> entities.</returns>
        public EntityQuery<ProjectNote> GetProjectNotesQuery(long projectID)
        {
            Dictionary<string, object> parameters = new Dictionary<string, object>();
            parameters.Add("projectID", projectID);
            this.ValidateMethod("GetProjectNotesQuery", parameters);
            return base.CreateQuery<ProjectNote>("GetProjectNotes", parameters, false, true);
        }
        
        /// <summary>
        /// Gets an EntityQuery instance that can be used to load <see cref="Project"/> entities using the 'GetProjects' query.
        /// </summary>
        /// <param name="userID">The value for the 'userID' parameter of the query.</param>
        /// <returns>An EntityQuery that can be loaded to retrieve <see cref="Project"/> entities.</returns>
        public EntityQuery<Project> GetProjectsQuery(long userID)
        {
            Dictionary<string, object> parameters = new Dictionary<string, object>();
            parameters.Add("userID", userID);
            this.ValidateMethod("GetProjectsQuery", parameters);
            return base.CreateQuery<Project>("GetProjects", parameters, false, true);
        }
        
        /// <summary>
        /// Gets an EntityQuery instance that can be used to load <see cref="Project"/> entities using the 'GetProjectsDueThisWeek' query.
        /// </summary>
        /// <param name="userID">The value for the 'userID' parameter of the query.</param>
        /// <returns>An EntityQuery that can be loaded to retrieve <see cref="Project"/> entities.</returns>
        public EntityQuery<Project> GetProjectsDueThisWeekQuery(long userID)
        {
            Dictionary<string, object> parameters = new Dictionary<string, object>();
            parameters.Add("userID", userID);
            this.ValidateMethod("GetProjectsDueThisWeekQuery", parameters);
            return base.CreateQuery<Project>("GetProjectsDueThisWeek", parameters, false, true);
        }
        
        /// <summary>
        /// Gets an EntityQuery instance that can be used to load <see cref="TaskCategory"/> entities using the 'GetTaskCategories' query.
        /// </summary>
        /// <returns>An EntityQuery that can be loaded to retrieve <see cref="TaskCategory"/> entities.</returns>
        public EntityQuery<TaskCategory> GetTaskCategoriesQuery()
        {
            this.ValidateMethod("GetTaskCategoriesQuery", null);
            return base.CreateQuery<TaskCategory>("GetTaskCategories", null, false, true);
        }
        
        /// <summary>
        /// Gets an EntityQuery instance that can be used to load <see cref="TaskNote"/> entities using the 'GetTaskNotes' query.
        /// </summary>
        /// <param name="taskID">The value for the 'taskID' parameter of the query.</param>
        /// <returns>An EntityQuery that can be loaded to retrieve <see cref="TaskNote"/> entities.</returns>
        public EntityQuery<TaskNote> GetTaskNotesQuery(long taskID)
        {
            Dictionary<string, object> parameters = new Dictionary<string, object>();
            parameters.Add("taskID", taskID);
            this.ValidateMethod("GetTaskNotesQuery", parameters);
            return base.CreateQuery<TaskNote>("GetTaskNotes", parameters, false, true);
        }
        
        /// <summary>
        /// Gets an EntityQuery instance that can be used to load <see cref="Task"/> entities using the 'GetTasksByContact' query.
        /// </summary>
        /// <param name="userID">The value for the 'userID' parameter of the query.</param>
        /// <param name="contactID">The value for the 'contactID' parameter of the query.</param>
        /// <param name="showCompleted">The value for the 'showCompleted' parameter of the query.</param>
        /// <param name="showDue">The value for the 'showDue' parameter of the query.</param>
        /// <returns>An EntityQuery that can be loaded to retrieve <see cref="Task"/> entities.</returns>
        public EntityQuery<Task> GetTasksByContactQuery(long userID, long contactID, bool showCompleted, bool showDue)
        {
            Dictionary<string, object> parameters = new Dictionary<string, object>();
            parameters.Add("userID", userID);
            parameters.Add("contactID", contactID);
            parameters.Add("showCompleted", showCompleted);
            parameters.Add("showDue", showDue);
            this.ValidateMethod("GetTasksByContactQuery", parameters);
            return base.CreateQuery<Task>("GetTasksByContact", parameters, false, true);
        }
        
        /// <summary>
        /// Gets an EntityQuery instance that can be used to load <see cref="Task"/> entities using the 'GetTasksByContext' query.
        /// </summary>
        /// <param name="userID">The value for the 'userID' parameter of the query.</param>
        /// <param name="contextID">The value for the 'contextID' parameter of the query.</param>
        /// <param name="showCompleted">The value for the 'showCompleted' parameter of the query.</param>
        /// <param name="showDue">The value for the 'showDue' parameter of the query.</param>
        /// <returns>An EntityQuery that can be loaded to retrieve <see cref="Task"/> entities.</returns>
        public EntityQuery<Task> GetTasksByContextQuery(long userID, long contextID, bool showCompleted, bool showDue)
        {
            Dictionary<string, object> parameters = new Dictionary<string, object>();
            parameters.Add("userID", userID);
            parameters.Add("contextID", contextID);
            parameters.Add("showCompleted", showCompleted);
            parameters.Add("showDue", showDue);
            this.ValidateMethod("GetTasksByContextQuery", parameters);
            return base.CreateQuery<Task>("GetTasksByContext", parameters, false, true);
        }
        
        /// <summary>
        /// Gets an EntityQuery instance that can be used to load <see cref="Task"/> entities using the 'GetTasksByProject' query.
        /// </summary>
        /// <param name="userID">The value for the 'userID' parameter of the query.</param>
        /// <param name="projectID">The value for the 'projectID' parameter of the query.</param>
        /// <param name="showCompleted">The value for the 'showCompleted' parameter of the query.</param>
        /// <param name="showDue">The value for the 'showDue' parameter of the query.</param>
        /// <returns>An EntityQuery that can be loaded to retrieve <see cref="Task"/> entities.</returns>
        public EntityQuery<Task> GetTasksByProjectQuery(long userID, long projectID, bool showCompleted, bool showDue)
        {
            Dictionary<string, object> parameters = new Dictionary<string, object>();
            parameters.Add("userID", userID);
            parameters.Add("projectID", projectID);
            parameters.Add("showCompleted", showCompleted);
            parameters.Add("showDue", showDue);
            this.ValidateMethod("GetTasksByProjectQuery", parameters);
            return base.CreateQuery<Task>("GetTasksByProject", parameters, false, true);
        }
        
        /// <summary>
        /// Gets an EntityQuery instance that can be used to load <see cref="Task"/> entities using the 'GetTasksByTaskCategory' query.
        /// </summary>
        /// <param name="userID">The value for the 'userID' parameter of the query.</param>
        /// <param name="taskCategoryID">The value for the 'taskCategoryID' parameter of the query.</param>
        /// <param name="showCompleted">The value for the 'showCompleted' parameter of the query.</param>
        /// <param name="showDue">The value for the 'showDue' parameter of the query.</param>
        /// <returns>An EntityQuery that can be loaded to retrieve <see cref="Task"/> entities.</returns>
        public EntityQuery<Task> GetTasksByTaskCategoryQuery(long userID, long taskCategoryID, bool showCompleted, bool showDue)
        {
            Dictionary<string, object> parameters = new Dictionary<string, object>();
            parameters.Add("userID", userID);
            parameters.Add("taskCategoryID", taskCategoryID);
            parameters.Add("showCompleted", showCompleted);
            parameters.Add("showDue", showDue);
            this.ValidateMethod("GetTasksByTaskCategoryQuery", parameters);
            return base.CreateQuery<Task>("GetTasksByTaskCategory", parameters, false, true);
        }
        
        /// <summary>
        /// Gets an EntityQuery instance that can be used to load <see cref="Task"/> entities using the 'GetTasksDueThisWeek' query.
        /// </summary>
        /// <param name="userID">The value for the 'userID' parameter of the query.</param>
        /// <returns>An EntityQuery that can be loaded to retrieve <see cref="Task"/> entities.</returns>
        public EntityQuery<Task> GetTasksDueThisWeekQuery(long userID)
        {
            Dictionary<string, object> parameters = new Dictionary<string, object>();
            parameters.Add("userID", userID);
            this.ValidateMethod("GetTasksDueThisWeekQuery", parameters);
            return base.CreateQuery<Task>("GetTasksDueThisWeek", parameters, false, true);
        }
        
        /// <summary>
        /// Gets an EntityQuery instance that can be used to load <see cref="TaskItUser"/> entities using the 'GetUsers' query.
        /// </summary>
        /// <returns>An EntityQuery that can be loaded to retrieve <see cref="TaskItUser"/> entities.</returns>
        public EntityQuery<TaskItUser> GetUsersQuery()
        {
            this.ValidateMethod("GetUsersQuery", null);
            return base.CreateQuery<TaskItUser>("GetUsers", null, false, true);
        }
        
        /// <summary>
        /// Asynchronously invokes the 'GetTaskCountForContact' method of the domain service.
        /// </summary>
        /// <param name="id">The value for the 'id' parameter of this action.</param>
        /// <param name="callback">Callback to invoke when the operation completes.</param>
        /// <param name="userState">Value to pass to the callback.  It can be <c>null</c>.</param>
        /// <returns>An operation instance that can be used to manage the asynchronous request.</returns>
        public InvokeOperation<int> GetTaskCountForContact(long id, Action<InvokeOperation<int>> callback, object userState)
        {
            Dictionary<string, object> parameters = new Dictionary<string, object>();
            parameters.Add("id", id);
            this.ValidateMethod("GetTaskCountForContact", parameters);
            return ((InvokeOperation<int>)(this.InvokeOperation("GetTaskCountForContact", typeof(int), parameters, true, callback, userState)));
        }
        
        /// <summary>
        /// Asynchronously invokes the 'GetTaskCountForContact' method of the domain service.
        /// </summary>
        /// <param name="id">The value for the 'id' parameter of this action.</param>
        /// <returns>An operation instance that can be used to manage the asynchronous request.</returns>
        public InvokeOperation<int> GetTaskCountForContact(long id)
        {
            Dictionary<string, object> parameters = new Dictionary<string, object>();
            parameters.Add("id", id);
            this.ValidateMethod("GetTaskCountForContact", parameters);
            return ((InvokeOperation<int>)(this.InvokeOperation("GetTaskCountForContact", typeof(int), parameters, true, null, null)));
        }
        
        /// <summary>
        /// Asynchronously invokes the 'GetTaskCountForContext' method of the domain service.
        /// </summary>
        /// <param name="id">The value for the 'id' parameter of this action.</param>
        /// <param name="callback">Callback to invoke when the operation completes.</param>
        /// <param name="userState">Value to pass to the callback.  It can be <c>null</c>.</param>
        /// <returns>An operation instance that can be used to manage the asynchronous request.</returns>
        public InvokeOperation<int> GetTaskCountForContext(long id, Action<InvokeOperation<int>> callback, object userState)
        {
            Dictionary<string, object> parameters = new Dictionary<string, object>();
            parameters.Add("id", id);
            this.ValidateMethod("GetTaskCountForContext", parameters);
            return ((InvokeOperation<int>)(this.InvokeOperation("GetTaskCountForContext", typeof(int), parameters, true, callback, userState)));
        }
        
        /// <summary>
        /// Asynchronously invokes the 'GetTaskCountForContext' method of the domain service.
        /// </summary>
        /// <param name="id">The value for the 'id' parameter of this action.</param>
        /// <returns>An operation instance that can be used to manage the asynchronous request.</returns>
        public InvokeOperation<int> GetTaskCountForContext(long id)
        {
            Dictionary<string, object> parameters = new Dictionary<string, object>();
            parameters.Add("id", id);
            this.ValidateMethod("GetTaskCountForContext", parameters);
            return ((InvokeOperation<int>)(this.InvokeOperation("GetTaskCountForContext", typeof(int), parameters, true, null, null)));
        }
        
        /// <summary>
        /// Asynchronously invokes the 'GetTaskCountForProject' method of the domain service.
        /// </summary>
        /// <param name="id">The value for the 'id' parameter of this action.</param>
        /// <param name="callback">Callback to invoke when the operation completes.</param>
        /// <param name="userState">Value to pass to the callback.  It can be <c>null</c>.</param>
        /// <returns>An operation instance that can be used to manage the asynchronous request.</returns>
        public InvokeOperation<int> GetTaskCountForProject(long id, Action<InvokeOperation<int>> callback, object userState)
        {
            Dictionary<string, object> parameters = new Dictionary<string, object>();
            parameters.Add("id", id);
            this.ValidateMethod("GetTaskCountForProject", parameters);
            return ((InvokeOperation<int>)(this.InvokeOperation("GetTaskCountForProject", typeof(int), parameters, true, callback, userState)));
        }
        
        /// <summary>
        /// Asynchronously invokes the 'GetTaskCountForProject' method of the domain service.
        /// </summary>
        /// <param name="id">The value for the 'id' parameter of this action.</param>
        /// <returns>An operation instance that can be used to manage the asynchronous request.</returns>
        public InvokeOperation<int> GetTaskCountForProject(long id)
        {
            Dictionary<string, object> parameters = new Dictionary<string, object>();
            parameters.Add("id", id);
            this.ValidateMethod("GetTaskCountForProject", parameters);
            return ((InvokeOperation<int>)(this.InvokeOperation("GetTaskCountForProject", typeof(int), parameters, true, null, null)));
        }
        
        /// <summary>
        /// Asynchronously invokes the 'Tweet' method of the domain service.
        /// </summary>
        /// <param name="username">The value for the 'username' parameter of this action.</param>
        /// <param name="password">The value for the 'password' parameter of this action.</param>
        /// <param name="message">The value for the 'message' parameter of this action.</param>
        /// <param name="callback">Callback to invoke when the operation completes.</param>
        /// <param name="userState">Value to pass to the callback.  It can be <c>null</c>.</param>
        /// <returns>An operation instance that can be used to manage the asynchronous request.</returns>
        public InvokeOperation Tweet(string username, string password, string message, Action<InvokeOperation> callback, object userState)
        {
            Dictionary<string, object> parameters = new Dictionary<string, object>();
            parameters.Add("username", username);
            parameters.Add("password", password);
            parameters.Add("message", message);
            this.ValidateMethod("Tweet", parameters);
            return this.InvokeOperation("Tweet", typeof(void), parameters, true, callback, userState);
        }
        
        /// <summary>
        /// Asynchronously invokes the 'Tweet' method of the domain service.
        /// </summary>
        /// <param name="username">The value for the 'username' parameter of this action.</param>
        /// <param name="password">The value for the 'password' parameter of this action.</param>
        /// <param name="message">The value for the 'message' parameter of this action.</param>
        /// <returns>An operation instance that can be used to manage the asynchronous request.</returns>
        public InvokeOperation Tweet(string username, string password, string message)
        {
            Dictionary<string, object> parameters = new Dictionary<string, object>();
            parameters.Add("username", username);
            parameters.Add("password", password);
            parameters.Add("message", message);
            this.ValidateMethod("Tweet", parameters);
            return this.InvokeOperation("Tweet", typeof(void), parameters, true, null, null);
        }
        
        /// <summary>
        /// Creates a new entity container for this domain context's entity sets.
        /// </summary>
        /// <returns>A new container instance.</returns>
        protected override EntityContainer CreateEntityContainer()
        {
            return new DataContextEntityContainer();
        }
        
        /// <summary>
        /// Service contract for the 'DataService' domain service.
        /// </summary>
        [ServiceContract()]
        public interface IDataServiceContract
        {
            
            /// <summary>
            /// Asynchronously invokes the 'GetAllTasks' operation.
            /// </summary>
            /// <param name="userID">The value for the 'userID' parameter of this action.</param>
            /// <param name="showCompleted">The value for the 'showCompleted' parameter of this action.</param>
            /// <param name="showDue">The value for the 'showDue' parameter of this action.</param>
            /// <param name="callback">Callback to invoke on completion.</param>
            /// <param name="asyncState">Optional state object.</param>
            /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
            [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/DataService/GetAllTasksDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
            [OperationContract(AsyncPattern=true, Action="http://tempuri.org/DataService/GetAllTasks", ReplyAction="http://tempuri.org/DataService/GetAllTasksResponse")]
            [WebGet()]
            IAsyncResult BeginGetAllTasks(long userID, bool showCompleted, bool showDue, AsyncCallback callback, object asyncState);
            
            /// <summary>
            /// Completes the asynchronous operation begun by 'BeginGetAllTasks'.
            /// </summary>
            /// <param name="result">The IAsyncResult returned from 'BeginGetAllTasks'.</param>
            /// <returns>The 'QueryResult' returned from the 'GetAllTasks' operation.</returns>
            QueryResult<Task> EndGetAllTasks(IAsyncResult result);
            
            /// <summary>
            /// Asynchronously invokes the 'GetCompletedBlogPosts' operation.
            /// </summary>
            /// <param name="callback">Callback to invoke on completion.</param>
            /// <param name="asyncState">Optional state object.</param>
            /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
            [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/DataService/GetCompletedBlogPostsDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
            [OperationContract(AsyncPattern=true, Action="http://tempuri.org/DataService/GetCompletedBlogPosts", ReplyAction="http://tempuri.org/DataService/GetCompletedBlogPostsResponse")]
            [WebGet()]
            IAsyncResult BeginGetCompletedBlogPosts(AsyncCallback callback, object asyncState);
            
            /// <summary>
            /// Completes the asynchronous operation begun by 'BeginGetCompletedBlogPosts'.
            /// </summary>
            /// <param name="result">The IAsyncResult returned from 'BeginGetCompletedBlogPosts'.</param>
            /// <returns>The 'QueryResult' returned from the 'GetCompletedBlogPosts' operation.</returns>
            QueryResult<Task> EndGetCompletedBlogPosts(IAsyncResult result);
            
            /// <summary>
            /// Asynchronously invokes the 'GetCompletedVideos' operation.
            /// </summary>
            /// <param name="callback">Callback to invoke on completion.</param>
            /// <param name="asyncState">Optional state object.</param>
            /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
            [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/DataService/GetCompletedVideosDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
            [OperationContract(AsyncPattern=true, Action="http://tempuri.org/DataService/GetCompletedVideos", ReplyAction="http://tempuri.org/DataService/GetCompletedVideosResponse")]
            [WebGet()]
            IAsyncResult BeginGetCompletedVideos(AsyncCallback callback, object asyncState);
            
            /// <summary>
            /// Completes the asynchronous operation begun by 'BeginGetCompletedVideos'.
            /// </summary>
            /// <param name="result">The IAsyncResult returned from 'BeginGetCompletedVideos'.</param>
            /// <returns>The 'QueryResult' returned from the 'GetCompletedVideos' operation.</returns>
            QueryResult<Task> EndGetCompletedVideos(IAsyncResult result);
            
            /// <summary>
            /// Asynchronously invokes the 'GetCompletedWebinars' operation.
            /// </summary>
            /// <param name="callback">Callback to invoke on completion.</param>
            /// <param name="asyncState">Optional state object.</param>
            /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
            [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/DataService/GetCompletedWebinarsDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
            [OperationContract(AsyncPattern=true, Action="http://tempuri.org/DataService/GetCompletedWebinars", ReplyAction="http://tempuri.org/DataService/GetCompletedWebinarsResponse")]
            [WebGet()]
            IAsyncResult BeginGetCompletedWebinars(AsyncCallback callback, object asyncState);
            
            /// <summary>
            /// Completes the asynchronous operation begun by 'BeginGetCompletedWebinars'.
            /// </summary>
            /// <param name="result">The IAsyncResult returned from 'BeginGetCompletedWebinars'.</param>
            /// <returns>The 'QueryResult' returned from the 'GetCompletedWebinars' operation.</returns>
            QueryResult<Task> EndGetCompletedWebinars(IAsyncResult result);
            
            /// <summary>
            /// Asynchronously invokes the 'GetContactNotes' operation.
            /// </summary>
            /// <param name="contactID">The value for the 'contactID' parameter of this action.</param>
            /// <param name="callback">Callback to invoke on completion.</param>
            /// <param name="asyncState">Optional state object.</param>
            /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
            [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/DataService/GetContactNotesDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
            [OperationContract(AsyncPattern=true, Action="http://tempuri.org/DataService/GetContactNotes", ReplyAction="http://tempuri.org/DataService/GetContactNotesResponse")]
            [WebGet()]
            IAsyncResult BeginGetContactNotes(long contactID, AsyncCallback callback, object asyncState);
            
            /// <summary>
            /// Completes the asynchronous operation begun by 'BeginGetContactNotes'.
            /// </summary>
            /// <param name="result">The IAsyncResult returned from 'BeginGetContactNotes'.</param>
            /// <returns>The 'QueryResult' returned from the 'GetContactNotes' operation.</returns>
            QueryResult<ContactNote> EndGetContactNotes(IAsyncResult result);
            
            /// <summary>
            /// Asynchronously invokes the 'GetContacts' operation.
            /// </summary>
            /// <param name="userID">The value for the 'userID' parameter of this action.</param>
            /// <param name="callback">Callback to invoke on completion.</param>
            /// <param name="asyncState">Optional state object.</param>
            /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
            [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/DataService/GetContactsDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
            [OperationContract(AsyncPattern=true, Action="http://tempuri.org/DataService/GetContacts", ReplyAction="http://tempuri.org/DataService/GetContactsResponse")]
            [WebGet()]
            IAsyncResult BeginGetContacts(long userID, AsyncCallback callback, object asyncState);
            
            /// <summary>
            /// Completes the asynchronous operation begun by 'BeginGetContacts'.
            /// </summary>
            /// <param name="result">The IAsyncResult returned from 'BeginGetContacts'.</param>
            /// <returns>The 'QueryResult' returned from the 'GetContacts' operation.</returns>
            QueryResult<Contact> EndGetContacts(IAsyncResult result);
            
            /// <summary>
            /// Asynchronously invokes the 'GetContextNotes' operation.
            /// </summary>
            /// <param name="contextID">The value for the 'contextID' parameter of this action.</param>
            /// <param name="callback">Callback to invoke on completion.</param>
            /// <param name="asyncState">Optional state object.</param>
            /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
            [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/DataService/GetContextNotesDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
            [OperationContract(AsyncPattern=true, Action="http://tempuri.org/DataService/GetContextNotes", ReplyAction="http://tempuri.org/DataService/GetContextNotesResponse")]
            [WebGet()]
            IAsyncResult BeginGetContextNotes(long contextID, AsyncCallback callback, object asyncState);
            
            /// <summary>
            /// Completes the asynchronous operation begun by 'BeginGetContextNotes'.
            /// </summary>
            /// <param name="result">The IAsyncResult returned from 'BeginGetContextNotes'.</param>
            /// <returns>The 'QueryResult' returned from the 'GetContextNotes' operation.</returns>
            QueryResult<ContextNote> EndGetContextNotes(IAsyncResult result);
            
            /// <summary>
            /// Asynchronously invokes the 'GetContexts' operation.
            /// </summary>
            /// <param name="userID">The value for the 'userID' parameter of this action.</param>
            /// <param name="callback">Callback to invoke on completion.</param>
            /// <param name="asyncState">Optional state object.</param>
            /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
            [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/DataService/GetContextsDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
            [OperationContract(AsyncPattern=true, Action="http://tempuri.org/DataService/GetContexts", ReplyAction="http://tempuri.org/DataService/GetContextsResponse")]
            [WebGet()]
            IAsyncResult BeginGetContexts(long userID, AsyncCallback callback, object asyncState);
            
            /// <summary>
            /// Completes the asynchronous operation begun by 'BeginGetContexts'.
            /// </summary>
            /// <param name="result">The IAsyncResult returned from 'BeginGetContexts'.</param>
            /// <returns>The 'QueryResult' returned from the 'GetContexts' operation.</returns>
            QueryResult<Context> EndGetContexts(IAsyncResult result);
            
            /// <summary>
            /// Asynchronously invokes the 'GetOverdueTasks' operation.
            /// </summary>
            /// <param name="userID">The value for the 'userID' parameter of this action.</param>
            /// <param name="callback">Callback to invoke on completion.</param>
            /// <param name="asyncState">Optional state object.</param>
            /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
            [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/DataService/GetOverdueTasksDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
            [OperationContract(AsyncPattern=true, Action="http://tempuri.org/DataService/GetOverdueTasks", ReplyAction="http://tempuri.org/DataService/GetOverdueTasksResponse")]
            [WebGet()]
            IAsyncResult BeginGetOverdueTasks(long userID, AsyncCallback callback, object asyncState);
            
            /// <summary>
            /// Completes the asynchronous operation begun by 'BeginGetOverdueTasks'.
            /// </summary>
            /// <param name="result">The IAsyncResult returned from 'BeginGetOverdueTasks'.</param>
            /// <returns>The 'QueryResult' returned from the 'GetOverdueTasks' operation.</returns>
            QueryResult<Task> EndGetOverdueTasks(IAsyncResult result);
            
            /// <summary>
            /// Asynchronously invokes the 'GetPriorities' operation.
            /// </summary>
            /// <param name="callback">Callback to invoke on completion.</param>
            /// <param name="asyncState">Optional state object.</param>
            /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
            [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/DataService/GetPrioritiesDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
            [OperationContract(AsyncPattern=true, Action="http://tempuri.org/DataService/GetPriorities", ReplyAction="http://tempuri.org/DataService/GetPrioritiesResponse")]
            [WebGet()]
            IAsyncResult BeginGetPriorities(AsyncCallback callback, object asyncState);
            
            /// <summary>
            /// Completes the asynchronous operation begun by 'BeginGetPriorities'.
            /// </summary>
            /// <param name="result">The IAsyncResult returned from 'BeginGetPriorities'.</param>
            /// <returns>The 'QueryResult' returned from the 'GetPriorities' operation.</returns>
            QueryResult<Priority> EndGetPriorities(IAsyncResult result);
            
            /// <summary>
            /// Asynchronously invokes the 'GetProjectNotes' operation.
            /// </summary>
            /// <param name="projectID">The value for the 'projectID' parameter of this action.</param>
            /// <param name="callback">Callback to invoke on completion.</param>
            /// <param name="asyncState">Optional state object.</param>
            /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
            [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/DataService/GetProjectNotesDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
            [OperationContract(AsyncPattern=true, Action="http://tempuri.org/DataService/GetProjectNotes", ReplyAction="http://tempuri.org/DataService/GetProjectNotesResponse")]
            [WebGet()]
            IAsyncResult BeginGetProjectNotes(long projectID, AsyncCallback callback, object asyncState);
            
            /// <summary>
            /// Completes the asynchronous operation begun by 'BeginGetProjectNotes'.
            /// </summary>
            /// <param name="result">The IAsyncResult returned from 'BeginGetProjectNotes'.</param>
            /// <returns>The 'QueryResult' returned from the 'GetProjectNotes' operation.</returns>
            QueryResult<ProjectNote> EndGetProjectNotes(IAsyncResult result);
            
            /// <summary>
            /// Asynchronously invokes the 'GetProjects' operation.
            /// </summary>
            /// <param name="userID">The value for the 'userID' parameter of this action.</param>
            /// <param name="callback">Callback to invoke on completion.</param>
            /// <param name="asyncState">Optional state object.</param>
            /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
            [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/DataService/GetProjectsDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
            [OperationContract(AsyncPattern=true, Action="http://tempuri.org/DataService/GetProjects", ReplyAction="http://tempuri.org/DataService/GetProjectsResponse")]
            [WebGet()]
            IAsyncResult BeginGetProjects(long userID, AsyncCallback callback, object asyncState);
            
            /// <summary>
            /// Completes the asynchronous operation begun by 'BeginGetProjects'.
            /// </summary>
            /// <param name="result">The IAsyncResult returned from 'BeginGetProjects'.</param>
            /// <returns>The 'QueryResult' returned from the 'GetProjects' operation.</returns>
            QueryResult<Project> EndGetProjects(IAsyncResult result);
            
            /// <summary>
            /// Asynchronously invokes the 'GetProjectsDueThisWeek' operation.
            /// </summary>
            /// <param name="userID">The value for the 'userID' parameter of this action.</param>
            /// <param name="callback">Callback to invoke on completion.</param>
            /// <param name="asyncState">Optional state object.</param>
            /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
            [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/DataService/GetProjectsDueThisWeekDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
            [OperationContract(AsyncPattern=true, Action="http://tempuri.org/DataService/GetProjectsDueThisWeek", ReplyAction="http://tempuri.org/DataService/GetProjectsDueThisWeekResponse")]
            [WebGet()]
            IAsyncResult BeginGetProjectsDueThisWeek(long userID, AsyncCallback callback, object asyncState);
            
            /// <summary>
            /// Completes the asynchronous operation begun by 'BeginGetProjectsDueThisWeek'.
            /// </summary>
            /// <param name="result">The IAsyncResult returned from 'BeginGetProjectsDueThisWeek'.</param>
            /// <returns>The 'QueryResult' returned from the 'GetProjectsDueThisWeek' operation.</returns>
            QueryResult<Project> EndGetProjectsDueThisWeek(IAsyncResult result);
            
            /// <summary>
            /// Asynchronously invokes the 'GetTaskCategories' operation.
            /// </summary>
            /// <param name="callback">Callback to invoke on completion.</param>
            /// <param name="asyncState">Optional state object.</param>
            /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
            [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/DataService/GetTaskCategoriesDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
            [OperationContract(AsyncPattern=true, Action="http://tempuri.org/DataService/GetTaskCategories", ReplyAction="http://tempuri.org/DataService/GetTaskCategoriesResponse")]
            [WebGet()]
            IAsyncResult BeginGetTaskCategories(AsyncCallback callback, object asyncState);
            
            /// <summary>
            /// Completes the asynchronous operation begun by 'BeginGetTaskCategories'.
            /// </summary>
            /// <param name="result">The IAsyncResult returned from 'BeginGetTaskCategories'.</param>
            /// <returns>The 'QueryResult' returned from the 'GetTaskCategories' operation.</returns>
            QueryResult<TaskCategory> EndGetTaskCategories(IAsyncResult result);
            
            /// <summary>
            /// Asynchronously invokes the 'GetTaskCountForContact' operation.
            /// </summary>
            /// <param name="id">The value for the 'id' parameter of this action.</param>
            /// <param name="callback">Callback to invoke on completion.</param>
            /// <param name="asyncState">Optional state object.</param>
            /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
            [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/DataService/GetTaskCountForContactDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
            [OperationContract(AsyncPattern=true, Action="http://tempuri.org/DataService/GetTaskCountForContact", ReplyAction="http://tempuri.org/DataService/GetTaskCountForContactResponse")]
            IAsyncResult BeginGetTaskCountForContact(long id, AsyncCallback callback, object asyncState);
            
            /// <summary>
            /// Completes the asynchronous operation begun by 'BeginGetTaskCountForContact'.
            /// </summary>
            /// <param name="result">The IAsyncResult returned from 'BeginGetTaskCountForContact'.</param>
            /// <returns>The 'Int32' returned from the 'GetTaskCountForContact' operation.</returns>
            int EndGetTaskCountForContact(IAsyncResult result);
            
            /// <summary>
            /// Asynchronously invokes the 'GetTaskCountForContext' operation.
            /// </summary>
            /// <param name="id">The value for the 'id' parameter of this action.</param>
            /// <param name="callback">Callback to invoke on completion.</param>
            /// <param name="asyncState">Optional state object.</param>
            /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
            [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/DataService/GetTaskCountForContextDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
            [OperationContract(AsyncPattern=true, Action="http://tempuri.org/DataService/GetTaskCountForContext", ReplyAction="http://tempuri.org/DataService/GetTaskCountForContextResponse")]
            IAsyncResult BeginGetTaskCountForContext(long id, AsyncCallback callback, object asyncState);
            
            /// <summary>
            /// Completes the asynchronous operation begun by 'BeginGetTaskCountForContext'.
            /// </summary>
            /// <param name="result">The IAsyncResult returned from 'BeginGetTaskCountForContext'.</param>
            /// <returns>The 'Int32' returned from the 'GetTaskCountForContext' operation.</returns>
            int EndGetTaskCountForContext(IAsyncResult result);
            
            /// <summary>
            /// Asynchronously invokes the 'GetTaskCountForProject' operation.
            /// </summary>
            /// <param name="id">The value for the 'id' parameter of this action.</param>
            /// <param name="callback">Callback to invoke on completion.</param>
            /// <param name="asyncState">Optional state object.</param>
            /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
            [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/DataService/GetTaskCountForProjectDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
            [OperationContract(AsyncPattern=true, Action="http://tempuri.org/DataService/GetTaskCountForProject", ReplyAction="http://tempuri.org/DataService/GetTaskCountForProjectResponse")]
            IAsyncResult BeginGetTaskCountForProject(long id, AsyncCallback callback, object asyncState);
            
            /// <summary>
            /// Completes the asynchronous operation begun by 'BeginGetTaskCountForProject'.
            /// </summary>
            /// <param name="result">The IAsyncResult returned from 'BeginGetTaskCountForProject'.</param>
            /// <returns>The 'Int32' returned from the 'GetTaskCountForProject' operation.</returns>
            int EndGetTaskCountForProject(IAsyncResult result);
            
            /// <summary>
            /// Asynchronously invokes the 'GetTaskNotes' operation.
            /// </summary>
            /// <param name="taskID">The value for the 'taskID' parameter of this action.</param>
            /// <param name="callback">Callback to invoke on completion.</param>
            /// <param name="asyncState">Optional state object.</param>
            /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
            [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/DataService/GetTaskNotesDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
            [OperationContract(AsyncPattern=true, Action="http://tempuri.org/DataService/GetTaskNotes", ReplyAction="http://tempuri.org/DataService/GetTaskNotesResponse")]
            [WebGet()]
            IAsyncResult BeginGetTaskNotes(long taskID, AsyncCallback callback, object asyncState);
            
            /// <summary>
            /// Completes the asynchronous operation begun by 'BeginGetTaskNotes'.
            /// </summary>
            /// <param name="result">The IAsyncResult returned from 'BeginGetTaskNotes'.</param>
            /// <returns>The 'QueryResult' returned from the 'GetTaskNotes' operation.</returns>
            QueryResult<TaskNote> EndGetTaskNotes(IAsyncResult result);
            
            /// <summary>
            /// Asynchronously invokes the 'GetTasksByContact' operation.
            /// </summary>
            /// <param name="userID">The value for the 'userID' parameter of this action.</param>
            /// <param name="contactID">The value for the 'contactID' parameter of this action.</param>
            /// <param name="showCompleted">The value for the 'showCompleted' parameter of this action.</param>
            /// <param name="showDue">The value for the 'showDue' parameter of this action.</param>
            /// <param name="callback">Callback to invoke on completion.</param>
            /// <param name="asyncState">Optional state object.</param>
            /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
            [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/DataService/GetTasksByContactDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
            [OperationContract(AsyncPattern=true, Action="http://tempuri.org/DataService/GetTasksByContact", ReplyAction="http://tempuri.org/DataService/GetTasksByContactResponse")]
            [WebGet()]
            IAsyncResult BeginGetTasksByContact(long userID, long contactID, bool showCompleted, bool showDue, AsyncCallback callback, object asyncState);
            
            /// <summary>
            /// Completes the asynchronous operation begun by 'BeginGetTasksByContact'.
            /// </summary>
            /// <param name="result">The IAsyncResult returned from 'BeginGetTasksByContact'.</param>
            /// <returns>The 'QueryResult' returned from the 'GetTasksByContact' operation.</returns>
            QueryResult<Task> EndGetTasksByContact(IAsyncResult result);
            
            /// <summary>
            /// Asynchronously invokes the 'GetTasksByContext' operation.
            /// </summary>
            /// <param name="userID">The value for the 'userID' parameter of this action.</param>
            /// <param name="contextID">The value for the 'contextID' parameter of this action.</param>
            /// <param name="showCompleted">The value for the 'showCompleted' parameter of this action.</param>
            /// <param name="showDue">The value for the 'showDue' parameter of this action.</param>
            /// <param name="callback">Callback to invoke on completion.</param>
            /// <param name="asyncState">Optional state object.</param>
            /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
            [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/DataService/GetTasksByContextDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
            [OperationContract(AsyncPattern=true, Action="http://tempuri.org/DataService/GetTasksByContext", ReplyAction="http://tempuri.org/DataService/GetTasksByContextResponse")]
            [WebGet()]
            IAsyncResult BeginGetTasksByContext(long userID, long contextID, bool showCompleted, bool showDue, AsyncCallback callback, object asyncState);
            
            /// <summary>
            /// Completes the asynchronous operation begun by 'BeginGetTasksByContext'.
            /// </summary>
            /// <param name="result">The IAsyncResult returned from 'BeginGetTasksByContext'.</param>
            /// <returns>The 'QueryResult' returned from the 'GetTasksByContext' operation.</returns>
            QueryResult<Task> EndGetTasksByContext(IAsyncResult result);
            
            /// <summary>
            /// Asynchronously invokes the 'GetTasksByProject' operation.
            /// </summary>
            /// <param name="userID">The value for the 'userID' parameter of this action.</param>
            /// <param name="projectID">The value for the 'projectID' parameter of this action.</param>
            /// <param name="showCompleted">The value for the 'showCompleted' parameter of this action.</param>
            /// <param name="showDue">The value for the 'showDue' parameter of this action.</param>
            /// <param name="callback">Callback to invoke on completion.</param>
            /// <param name="asyncState">Optional state object.</param>
            /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
            [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/DataService/GetTasksByProjectDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
            [OperationContract(AsyncPattern=true, Action="http://tempuri.org/DataService/GetTasksByProject", ReplyAction="http://tempuri.org/DataService/GetTasksByProjectResponse")]
            [WebGet()]
            IAsyncResult BeginGetTasksByProject(long userID, long projectID, bool showCompleted, bool showDue, AsyncCallback callback, object asyncState);
            
            /// <summary>
            /// Completes the asynchronous operation begun by 'BeginGetTasksByProject'.
            /// </summary>
            /// <param name="result">The IAsyncResult returned from 'BeginGetTasksByProject'.</param>
            /// <returns>The 'QueryResult' returned from the 'GetTasksByProject' operation.</returns>
            QueryResult<Task> EndGetTasksByProject(IAsyncResult result);
            
            /// <summary>
            /// Asynchronously invokes the 'GetTasksByTaskCategory' operation.
            /// </summary>
            /// <param name="userID">The value for the 'userID' parameter of this action.</param>
            /// <param name="taskCategoryID">The value for the 'taskCategoryID' parameter of this action.</param>
            /// <param name="showCompleted">The value for the 'showCompleted' parameter of this action.</param>
            /// <param name="showDue">The value for the 'showDue' parameter of this action.</param>
            /// <param name="callback">Callback to invoke on completion.</param>
            /// <param name="asyncState">Optional state object.</param>
            /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
            [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/DataService/GetTasksByTaskCategoryDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
            [OperationContract(AsyncPattern=true, Action="http://tempuri.org/DataService/GetTasksByTaskCategory", ReplyAction="http://tempuri.org/DataService/GetTasksByTaskCategoryResponse")]
            [WebGet()]
            IAsyncResult BeginGetTasksByTaskCategory(long userID, long taskCategoryID, bool showCompleted, bool showDue, AsyncCallback callback, object asyncState);
            
            /// <summary>
            /// Completes the asynchronous operation begun by 'BeginGetTasksByTaskCategory'.
            /// </summary>
            /// <param name="result">The IAsyncResult returned from 'BeginGetTasksByTaskCategory'.</param>
            /// <returns>The 'QueryResult' returned from the 'GetTasksByTaskCategory' operation.</returns>
            QueryResult<Task> EndGetTasksByTaskCategory(IAsyncResult result);
            
            /// <summary>
            /// Asynchronously invokes the 'GetTasksDueThisWeek' operation.
            /// </summary>
            /// <param name="userID">The value for the 'userID' parameter of this action.</param>
            /// <param name="callback">Callback to invoke on completion.</param>
            /// <param name="asyncState">Optional state object.</param>
            /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
            [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/DataService/GetTasksDueThisWeekDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
            [OperationContract(AsyncPattern=true, Action="http://tempuri.org/DataService/GetTasksDueThisWeek", ReplyAction="http://tempuri.org/DataService/GetTasksDueThisWeekResponse")]
            [WebGet()]
            IAsyncResult BeginGetTasksDueThisWeek(long userID, AsyncCallback callback, object asyncState);
            
            /// <summary>
            /// Completes the asynchronous operation begun by 'BeginGetTasksDueThisWeek'.
            /// </summary>
            /// <param name="result">The IAsyncResult returned from 'BeginGetTasksDueThisWeek'.</param>
            /// <returns>The 'QueryResult' returned from the 'GetTasksDueThisWeek' operation.</returns>
            QueryResult<Task> EndGetTasksDueThisWeek(IAsyncResult result);
            
            /// <summary>
            /// Asynchronously invokes the 'GetUsers' operation.
            /// </summary>
            /// <param name="callback">Callback to invoke on completion.</param>
            /// <param name="asyncState">Optional state object.</param>
            /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
            [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/DataService/GetUsersDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
            [OperationContract(AsyncPattern=true, Action="http://tempuri.org/DataService/GetUsers", ReplyAction="http://tempuri.org/DataService/GetUsersResponse")]
            [WebGet()]
            IAsyncResult BeginGetUsers(AsyncCallback callback, object asyncState);
            
            /// <summary>
            /// Completes the asynchronous operation begun by 'BeginGetUsers'.
            /// </summary>
            /// <param name="result">The IAsyncResult returned from 'BeginGetUsers'.</param>
            /// <returns>The 'QueryResult' returned from the 'GetUsers' operation.</returns>
            QueryResult<TaskItUser> EndGetUsers(IAsyncResult result);
            
            /// <summary>
            /// Asynchronously invokes the 'Tweet' operation.
            /// </summary>
            /// <param name="username">The value for the 'username' parameter of this action.</param>
            /// <param name="password">The value for the 'password' parameter of this action.</param>
            /// <param name="message">The value for the 'message' parameter of this action.</param>
            /// <param name="callback">Callback to invoke on completion.</param>
            /// <param name="asyncState">Optional state object.</param>
            /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
            [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/DataService/TweetDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
            [OperationContract(AsyncPattern=true, Action="http://tempuri.org/DataService/Tweet", ReplyAction="http://tempuri.org/DataService/TweetResponse")]
            IAsyncResult BeginTweet(string username, string password, string message, AsyncCallback callback, object asyncState);
            
            /// <summary>
            /// Completes the asynchronous operation begun by 'BeginTweet'.
            /// </summary>
            /// <param name="result">The IAsyncResult returned from 'BeginTweet'.</param>
            void EndTweet(IAsyncResult result);
            
            /// <summary>
            /// Asynchronously invokes the 'SubmitChanges' operation.
            /// </summary>
            /// <param name="changeSet">The change-set to submit.</param>
            /// <param name="callback">Callback to invoke on completion.</param>
            /// <param name="asyncState">Optional state object.</param>
            /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
            [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/DataService/SubmitChangesDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
            [OperationContract(AsyncPattern=true, Action="http://tempuri.org/DataService/SubmitChanges", ReplyAction="http://tempuri.org/DataService/SubmitChangesResponse")]
            IAsyncResult BeginSubmitChanges(IEnumerable<ChangeSetEntry> changeSet, AsyncCallback callback, object asyncState);
            
            /// <summary>
            /// Completes the asynchronous operation begun by 'BeginSubmitChanges'.
            /// </summary>
            /// <param name="result">The IAsyncResult returned from 'BeginSubmitChanges'.</param>
            /// <returns>The collection of change-set entry elements returned from 'SubmitChanges'.</returns>
            IEnumerable<ChangeSetEntry> EndSubmitChanges(IAsyncResult result);
        }
        
        internal sealed class DataContextEntityContainer : EntityContainer
        {
            
            public DataContextEntityContainer()
            {
                this.CreateEntitySet<Contact>(EntitySetOperations.All);
                this.CreateEntitySet<ContactNote>((EntitySetOperations.Add | EntitySetOperations.Remove));
                this.CreateEntitySet<Context>(EntitySetOperations.All);
                this.CreateEntitySet<ContextNote>((EntitySetOperations.Add | EntitySetOperations.Remove));
                this.CreateEntitySet<Priority>(EntitySetOperations.None);
                this.CreateEntitySet<Project>(EntitySetOperations.All);
                this.CreateEntitySet<ProjectNote>((EntitySetOperations.Add | EntitySetOperations.Remove));
                this.CreateEntitySet<Task>(EntitySetOperations.All);
                this.CreateEntitySet<TaskCategory>(EntitySetOperations.None);
                this.CreateEntitySet<TaskItUser>(EntitySetOperations.All);
                this.CreateEntitySet<TaskNote>((EntitySetOperations.Add | EntitySetOperations.Remove));
            }
        }
    }
}
