//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//     Runtime Version:4.0.30128.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;
    using TaskIt.Web;
    
    
    /// <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));
            }
        }
        
        /// <summary>
        /// Gets a user representing the authenticated identity.
        /// </summary>
        public new User User
        {
            get
            {
                return ((User)(base.User));
            }
        }
    }
}
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;
    using System.ServiceModel.DomainServices;
    using System.ServiceModel.DomainServices.Client;
    using System.ServiceModel.DomainServices.Client.ApplicationServices;
    using System.ServiceModel.Web;
    using TaskIt.Web.Resources;
    
    
    public sealed partial class AuthenticationContext : global::System.ServiceModel.DomainServices.Client.ApplicationServices.AuthenticationDomainContextBase
    {
        
        #region Extensibility Method Definitions

        /// <summary>
        /// This method is invoked from the constructor once initialization is complete and
        /// can be used for further object setup.
        /// </summary>
        partial void OnCreated();

        #endregion
        
        
        /// <summary>
        /// Default constructor.
        /// </summary>
        public AuthenticationContext() : 
                this(new WebDomainClient<IAuthenticationServiceContract>(new Uri("TaskIt-Web-AuthenticationService.svc", UriKind.Relative)))
        {
        }
        
        /// <summary>
        /// Constructor used to specify a data service URI.
        /// </summary>
        /// <param name="serviceUri">
        /// The AuthenticationService data service URI.
        /// </param>
        public AuthenticationContext(Uri serviceUri) : 
                this(new WebDomainClient<IAuthenticationServiceContract>(serviceUri))
        {
        }
        
        /// <summary>
        /// Constructor used to specify a DomainClient instance.
        /// </summary>
        /// <param name="domainClient">
        /// The DomainClient instance the DomainContext should use.
        /// </param>
        public AuthenticationContext(DomainClient domainClient) : 
                base(domainClient)
        {
            this.OnCreated();
        }
        
        public EntitySet<User> Users
        {
            get
            {
                return base.EntityContainer.GetEntitySet<User>();
            }
        }
        
        /// <summary>
        /// Returns an EntityQuery for query operation 'GetUser'.
        /// </summary>
        public EntityQuery<User> GetUserQuery()
        {
            this.ValidateMethod("GetUserQuery", null);
            return base.CreateQuery<User>("GetUser", null, false, false);
        }
        
        /// <summary>
        /// Returns an EntityQuery for query operation 'Login'.
        /// </summary>
        public EntityQuery<User> LoginQuery(string userName, string password, bool isPersistent, string customData)
        {
            Dictionary<string, object> parameters = new Dictionary<string, object>();
            parameters.Add("userName", userName);
            parameters.Add("password", password);
            parameters.Add("isPersistent", isPersistent);
            parameters.Add("customData", customData);
            this.ValidateMethod("LoginQuery", parameters);
            return base.CreateQuery<User>("Login", parameters, true, false);
        }
        
        /// <summary>
        /// Returns an EntityQuery for query operation 'Logout'.
        /// </summary>
        public EntityQuery<User> LogoutQuery()
        {
            this.ValidateMethod("LogoutQuery", null);
            return base.CreateQuery<User>("Logout", null, true, false);
        }
        
        protected override EntityContainer CreateEntityContainer()
        {
            return new AuthenticationContextEntityContainer();
        }
        
        [ServiceContract()]
        public interface IAuthenticationServiceContract
        {
            
            [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/AuthenticationService/LoginDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
            [OperationContract(AsyncPattern=true, Action="http://tempuri.org/AuthenticationService/Login", ReplyAction="http://tempuri.org/AuthenticationService/LoginResponse")]
            IAsyncResult BeginLogin(string userName, string password, bool isPersistent, string customData, AsyncCallback callback, object asyncState);
            
            QueryResult<User> EndLogin(IAsyncResult result);
            
            [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/AuthenticationService/LogoutDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
            [OperationContract(AsyncPattern=true, Action="http://tempuri.org/AuthenticationService/Logout", ReplyAction="http://tempuri.org/AuthenticationService/LogoutResponse")]
            IAsyncResult BeginLogout(AsyncCallback callback, object asyncState);
            
            QueryResult<User> EndLogout(IAsyncResult result);
            
            [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/AuthenticationService/GetUserDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
            [OperationContract(AsyncPattern=true, Action="http://tempuri.org/AuthenticationService/GetUser", ReplyAction="http://tempuri.org/AuthenticationService/GetUserResponse")]
            [WebGet()]
            IAsyncResult BeginGetUser(AsyncCallback callback, object asyncState);
            
            QueryResult<User> EndGetUser(IAsyncResult result);
            
            [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/AuthenticationService/SubmitChangesDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
            [OperationContract(AsyncPattern=true, Action="http://tempuri.org/AuthenticationService/SubmitChanges", ReplyAction="http://tempuri.org/AuthenticationService/SubmitChangesResponse")]
            IAsyncResult BeginSubmitChanges(IEnumerable<ChangeSetEntry> changeSet, AsyncCallback callback, object asyncState);
            
            IEnumerable<ChangeSetEntry> EndSubmitChanges(IAsyncResult result);
        }
        
        internal sealed class AuthenticationContextEntityContainer : EntityContainer
        {
            
            public AuthenticationContextEntityContainer()
            {
                this.CreateEntitySet<User>(EntitySetOperations.Edit);
            }
        }
    }
    
    [DataContract(Namespace="http://schemas.datacontract.org/2004/07/TaskIt.Web")]
    public sealed partial class RegistrationData : Entity
    {
        
        private string _answer;
        
        private string _email;
        
        private string _friendlyName;
        
        private string _password;
        
        private string _question;
        
        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 OnAnswerChanging(string value);
        partial void OnAnswerChanged();
        partial void OnEmailChanging(string value);
        partial void OnEmailChanged();
        partial void OnFriendlyNameChanging(string value);
        partial void OnFriendlyNameChanged();
        partial void OnPasswordChanging(string value);
        partial void OnPasswordChanged();
        partial void OnQuestionChanging(string value);
        partial void OnQuestionChanged();
        partial void OnUserNameChanging(string value);
        partial void OnUserNameChanged();

        #endregion
        
        
        /// <summary>
        /// Default constructor.
        /// </summary>
        public RegistrationData()
        {
            this.OnCreated();
        }
        
        [DataMember()]
        [Display(Name="SecurityAnswerLabel", Order=6, ResourceType=typeof(RegistrationDataResources))]
        [Required(ErrorMessageResourceName="ValidationErrorRequiredField", ErrorMessageResourceType=typeof(ErrorResources))]
        public string Answer
        {
            get
            {
                return this._answer;
            }
            set
            {
                if ((this._answer != value))
                {
                    this.OnAnswerChanging(value);
                    this.RaiseDataMemberChanging("Answer");
                    this.ValidateProperty("Answer", value);
                    this._answer = value;
                    this.RaiseDataMemberChanged("Answer");
                    this.OnAnswerChanged();
                }
            }
        }
        
        [DataMember()]
        [Display(Name="EmailLabel", Order=2, ResourceType=typeof(RegistrationDataResources))]
        [Key()]
        [RegularExpression("^([\\w-\\.]+)@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.)|(([\\w-]+\\.)+))([a-zA-Z]{2,4" +
            "}|[0-9]{1,3})(\\]?)$", ErrorMessageResourceName="ValidationErrorInvalidEmail", ErrorMessageResourceType=typeof(ErrorResources))]
        [Required(ErrorMessageResourceName="ValidationErrorRequiredField", ErrorMessageResourceType=typeof(ErrorResources))]
        [RoundtripOriginal()]
        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();
                }
            }
        }
        
        [DataMember()]
        [Display(Description="FriendlyNameDescription", Name="FriendlyNameLabel", Order=1, ResourceType=typeof(RegistrationDataResources))]
        [StringLength(255, ErrorMessageResourceName="ValidationErrorBadFriendlyNameLength", ErrorMessageResourceType=typeof(ErrorResources))]
        public string FriendlyName
        {
            get
            {
                return this._friendlyName;
            }
            set
            {
                if ((this._friendlyName != value))
                {
                    this.OnFriendlyNameChanging(value);
                    this.RaiseDataMemberChanging("FriendlyName");
                    this.ValidateProperty("FriendlyName", value);
                    this._friendlyName = value;
                    this.RaiseDataMemberChanged("FriendlyName");
                    this.OnFriendlyNameChanged();
                }
            }
        }
        
        [DataMember()]
        [Display(Description="PasswordDescription", Name="PasswordLabel", Order=3, ResourceType=typeof(RegistrationDataResources))]
        [RegularExpression("^.*[^a-zA-Z0-9].*$", ErrorMessageResourceName="ValidationErrorBadPasswordStrength", ErrorMessageResourceType=typeof(ErrorResources))]
        [Required(ErrorMessageResourceName="ValidationErrorRequiredField", ErrorMessageResourceType=typeof(ErrorResources))]
        [StringLength(50, ErrorMessageResourceName="ValidationErrorBadPasswordLength", ErrorMessageResourceType=typeof(ErrorResources), MinimumLength=7)]
        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();
                }
            }
        }
        
        [DataMember()]
        [Display(Name="SecurityQuestionLabel", Order=5, ResourceType=typeof(RegistrationDataResources))]
        [Required(ErrorMessageResourceName="ValidationErrorRequiredField", ErrorMessageResourceType=typeof(ErrorResources))]
        public string Question
        {
            get
            {
                return this._question;
            }
            set
            {
                if ((this._question != value))
                {
                    this.OnQuestionChanging(value);
                    this.RaiseDataMemberChanging("Question");
                    this.ValidateProperty("Question", value);
                    this._question = value;
                    this.RaiseDataMemberChanged("Question");
                    this.OnQuestionChanged();
                }
            }
        }
        
        [DataMember()]
        [Display(Name="UserNameLabel", Order=0, ResourceType=typeof(RegistrationDataResources))]
        [Key()]
        [RegularExpression("^[a-zA-Z0-9_]*$", ErrorMessageResourceName="ValidationErrorInvalidUserName", ErrorMessageResourceType=typeof(ErrorResources))]
        [Required(ErrorMessageResourceName="ValidationErrorRequiredField", ErrorMessageResourceType=typeof(ErrorResources))]
        [RoundtripOriginal()]
        [StringLength(255, ErrorMessageResourceName="ValidationErrorBadUserNameLength", ErrorMessageResourceType=typeof(ErrorResources), MinimumLength=4)]
        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();
                }
            }
        }
        
        public override object GetIdentity()
        {
            if (((this._email == null) 
                        || (this._userName == null)))
            {
                return null;
            }
            return EntityKey.Create(this._email, this._userName);
        }
    }
    
    [DataContract(Namespace="http://schemas.datacontract.org/2004/07/TaskIt.Web")]
    public sealed partial class User : Entity, global::System.Security.Principal.IIdentity, global::System.Security.Principal.IPrincipal
    {
        
        private string _friendlyName;
        
        private string _name = string.Empty;
        
        private IEnumerable<string> _roles;
        
        #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 OnFriendlyNameChanging(string value);
        partial void OnFriendlyNameChanged();
        partial void OnNameChanging(string value);
        partial void OnNameChanged();
        partial void OnRolesChanging(IEnumerable<string> value);
        partial void OnRolesChanged();

        #endregion
        
        
        /// <summary>
        /// Default constructor.
        /// </summary>
        public User()
        {
            this.OnCreated();
        }
        
        [DataMember()]
        public string FriendlyName
        {
            get
            {
                return this._friendlyName;
            }
            set
            {
                if ((this._friendlyName != value))
                {
                    this.OnFriendlyNameChanging(value);
                    this.RaiseDataMemberChanging("FriendlyName");
                    this.ValidateProperty("FriendlyName", value);
                    this._friendlyName = value;
                    this.RaiseDataMemberChanged("FriendlyName");
                    this.OnFriendlyNameChanged();
                }
            }
        }
        
        [DataMember()]
        [Key()]
        [RoundtripOriginal()]
        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();
                    this.RaisePropertyChanged("IsAuthenticated");
                }
            }
        }
        
        [DataMember()]
        [Editable(false)]
        public IEnumerable<string> Roles
        {
            get
            {
                return this._roles;
            }
            set
            {
                if ((this._roles != value))
                {
                    this.OnRolesChanging(value);
                    this.ValidateProperty("Roles", value);
                    this._roles = value;
                    this.RaisePropertyChanged("Roles");
                    this.OnRolesChanged();
                }
            }
        }
        
        string global::System.Security.Principal.IIdentity.AuthenticationType
        {
            get
            {
                return string.Empty;
            }
        }
        
        /// <summary>
        /// Gets a value indicating whether the identity is authenticated.
        /// </summary>
        /// <remarks>
        /// This value is <c>true</c> if <see cref="Name"/> is not <c>null</c> or empty.
        /// </remarks>
        public bool IsAuthenticated
        {
            get
            {
                return (true != string.IsNullOrEmpty(this.Name));
            }
        }
        
        string global::System.Security.Principal.IIdentity.Name
        {
            get
            {
                return this.Name;
            }
        }
        
        global::System.Security.Principal.IIdentity global::System.Security.Principal.IPrincipal.Identity
        {
            get
            {
                return this;
            }
        }
        
        public override object GetIdentity()
        {
            return this._name;
        }
        
        /// <summary>
        /// Return whether the principal is in the role.
        /// </summary>
        /// <remarks>
        /// Returns whether the specified role is contained in the roles.
        /// This implementation is case sensitive.
        /// </remarks>
        /// <param name="role">The name of the role for which to check membership.</param>
        /// <returns>Whether the principal is in the role.</returns>
        public bool IsInRole(string role)
        {
            if ((this.Roles == null))
            {
                return false;
            }
            return global::System.Linq.Enumerable.Contains(this.Roles, role);
        }
    }
    
    public sealed partial class UserRegistrationContext : DomainContext
    {
        
        #region Extensibility Method Definitions

        /// <summary>
        /// This method is invoked from the constructor once initialization is complete and
        /// can be used for further object setup.
        /// </summary>
        partial void OnCreated();

        #endregion
        
        
        /// <summary>
        /// Default constructor.
        /// </summary>
        public UserRegistrationContext() : 
                this(new WebDomainClient<IUserRegistrationServiceContract>(new Uri("TaskIt-Web-UserRegistrationService.svc", UriKind.Relative)))
        {
        }
        
        /// <summary>
        /// Constructor used to specify a data service URI.
        /// </summary>
        /// <param name="serviceUri">
        /// The UserRegistrationService data service URI.
        /// </param>
        public UserRegistrationContext(Uri serviceUri) : 
                this(new WebDomainClient<IUserRegistrationServiceContract>(serviceUri))
        {
        }
        
        /// <summary>
        /// Constructor used to specify a DomainClient instance.
        /// </summary>
        /// <param name="domainClient">
        /// The DomainClient instance the DomainContext should use.
        /// </param>
        public UserRegistrationContext(DomainClient domainClient) : 
                base(domainClient)
        {
            this.OnCreated();
        }
        
        public EntitySet<RegistrationData> RegistrationDatas
        {
            get
            {
                return base.EntityContainer.GetEntitySet<RegistrationData>();
            }
        }
        
        /// <summary>
        /// Returns an EntityQuery for query operation 'GetUsers'.
        /// </summary>
        public EntityQuery<RegistrationData> GetUsersQuery()
        {
            this.ValidateMethod("GetUsersQuery", null);
            return base.CreateQuery<RegistrationData>("GetUsers", null, false, true);
        }
        
        protected override EntityContainer CreateEntityContainer()
        {
            return new UserRegistrationContextEntityContainer();
        }
        
        [ServiceContract()]
        public interface IUserRegistrationServiceContract
        {
            
            [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/UserRegistrationService/GetUsersDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
            [OperationContract(AsyncPattern=true, Action="http://tempuri.org/UserRegistrationService/GetUsers", ReplyAction="http://tempuri.org/UserRegistrationService/GetUsersResponse")]
            [WebGet()]
            IAsyncResult BeginGetUsers(AsyncCallback callback, object asyncState);
            
            QueryResult<RegistrationData> EndGetUsers(IAsyncResult result);
            
            [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/UserRegistrationService/SubmitChangesDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
            [OperationContract(AsyncPattern=true, Action="http://tempuri.org/UserRegistrationService/SubmitChanges", ReplyAction="http://tempuri.org/UserRegistrationService/SubmitChangesResponse")]
            IAsyncResult BeginSubmitChanges(IEnumerable<ChangeSetEntry> changeSet, AsyncCallback callback, object asyncState);
            
            IEnumerable<ChangeSetEntry> EndSubmitChanges(IAsyncResult result);
        }
        
        internal sealed class UserRegistrationContextEntityContainer : EntityContainer
        {
            
            public UserRegistrationContextEntityContainer()
            {
                this.CreateEntitySet<RegistrationData>(EntitySetOperations.Add);
            }
        }
    }
}
namespace TaskIt.Web.Models
{
    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;
    
    
    [DataContract(Namespace="http://schemas.datacontract.org/2004/07/TaskIt.Web.Models")]
    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>
        /// Default constructor.
        /// </summary>
        public Contact()
        {
            this.OnCreated();
        }
        
        [Association("Contact_ContactNote", "ID", "ContactID")]
        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;
            }
        }
        
        [ConcurrencyCheck()]
        [DataMember()]
        [RoundtripOriginal()]
        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();
                }
            }
        }
        
        [ConcurrencyCheck()]
        [DataMember()]
        [RoundtripOriginal()]
        [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();
                }
            }
        }
        
        [ConcurrencyCheck()]
        [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();
                }
            }
        }
        
        [ConcurrencyCheck()]
        [DataMember()]
        [RoundtripOriginal()]
        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();
                }
            }
        }
        
        [ConcurrencyCheck()]
        [DataMember()]
        [Required()]
        [RoundtripOriginal()]
        [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();
                }
            }
        }
        
        [Association("Contact_Task", "ID", "ContactID")]
        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;
            }
        }
        
        [ConcurrencyCheck()]
        [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();
                }
            }
        }
        
        [ConcurrencyCheck()]
        [DataMember()]
        [RoundtripOriginal()]
        [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);
        }
        
        public override object GetIdentity()
        {
            return this._id;
        }
    }
    
    [DataContract(Namespace="http://schemas.datacontract.org/2004/07/TaskIt.Web.Models")]
    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>
        /// Default constructor.
        /// </summary>
        public ContactNote()
        {
            this.OnCreated();
        }
        
        [Association("Contact_ContactNote", "ContactID", "ID", IsForeignKey=true)]
        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");
                }
            }
        }
        
        [ConcurrencyCheck()]
        [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();
                }
            }
        }
        
        [ConcurrencyCheck()]
        [DataMember()]
        [RoundtripOriginal()]
        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();
                }
            }
        }
        
        [ConcurrencyCheck()]
        [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();
                }
            }
        }
        
        [Association("TaskItUser_ContactNote", "UserID", "ID", IsForeignKey=true)]
        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");
                }
            }
        }
        
        [ConcurrencyCheck()]
        [DataMember()]
        [Required()]
        [RoundtripOriginal()]
        [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();
                }
            }
        }
        
        [ConcurrencyCheck()]
        [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);
        }
        
        public override object GetIdentity()
        {
            return this._id;
        }
    }
    
    [DataContract(Namespace="http://schemas.datacontract.org/2004/07/TaskIt.Web.Models")]
    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>
        /// Default constructor.
        /// </summary>
        public Context()
        {
            this.OnCreated();
        }
        
        [Association("Context_ContextNote", "ID", "ContextID")]
        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;
            }
        }
        
        [ConcurrencyCheck()]
        [DataMember()]
        [RoundtripOriginal()]
        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();
                }
            }
        }
        
        [ConcurrencyCheck()]
        [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();
                }
            }
        }
        
        [ConcurrencyCheck()]
        [DataMember()]
        [RoundtripOriginal()]
        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();
                }
            }
        }
        
        [ConcurrencyCheck()]
        [DataMember()]
        [Required()]
        [RoundtripOriginal()]
        [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();
                }
            }
        }
        
        [Association("Context_Task", "ID", "ContextID")]
        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;
            }
        }
        
        [ConcurrencyCheck()]
        [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 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);
        }
        
        public override object GetIdentity()
        {
            return this._id;
        }
    }
    
    [DataContract(Namespace="http://schemas.datacontract.org/2004/07/TaskIt.Web.Models")]
    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>
        /// Default constructor.
        /// </summary>
        public ContextNote()
        {
            this.OnCreated();
        }
        
        [Association("Context_ContextNote", "ContextID", "ID", IsForeignKey=true)]
        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");
                }
            }
        }
        
        [ConcurrencyCheck()]
        [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();
                }
            }
        }
        
        [ConcurrencyCheck()]
        [DataMember()]
        [RoundtripOriginal()]
        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();
                }
            }
        }
        
        [ConcurrencyCheck()]
        [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();
                }
            }
        }
        
        [Association("TaskItUser_ContextNote", "UserID", "ID", IsForeignKey=true)]
        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");
                }
            }
        }
        
        [ConcurrencyCheck()]
        [DataMember()]
        [Required()]
        [RoundtripOriginal()]
        [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();
                }
            }
        }
        
        [ConcurrencyCheck()]
        [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);
        }
        
        public override object GetIdentity()
        {
            return this._id;
        }
    }
    
    [DataContract(Namespace="http://schemas.datacontract.org/2004/07/TaskIt.Web.Models")]
    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>
        /// Default constructor.
        /// </summary>
        public Priority()
        {
            this.OnCreated();
        }
        
        [ConcurrencyCheck()]
        [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();
                }
            }
        }
        
        [ConcurrencyCheck()]
        [DataMember()]
        [Required()]
        [RoundtripOriginal()]
        [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();
                }
            }
        }
        
        [Association("Priority_Priority", "ID", "ID", IsForeignKey=true)]
        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;
                    }
                    if ((value != null))
                    {
                        this.ID = value.ID;
                    }
                    else
                    {
                        this.ID = default(long);
                    }
                    this._priority1.Entity = value;
                    if ((value != null))
                    {
                        value.Priority2 = this;
                    }
                    this.RaisePropertyChanged("Priority1");
                }
            }
        }
        
        [Association("Priority_Priority", "ID", "ID")]
        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;
                    }
                    this._priority2.Entity = value;
                    if ((value != null))
                    {
                        value.Priority1 = this;
                    }
                    this.RaisePropertyChanged("Priority2");
                }
            }
        }
        
        [Association("Priority_Task", "ID", "PriorityID")]
        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);
        }
        
        public override object GetIdentity()
        {
            return this._id;
        }
    }
    
    [DataContract(Namespace="http://schemas.datacontract.org/2004/07/TaskIt.Web.Models")]
    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>
        /// Default constructor.
        /// </summary>
        public Project()
        {
            this.OnCreated();
        }
        
        [ConcurrencyCheck()]
        [DataMember()]
        [RoundtripOriginal()]
        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();
                }
            }
        }
        
        [ConcurrencyCheck()]
        [DataMember()]
        [RoundtripOriginal()]
        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();
                }
            }
        }
        
        [ConcurrencyCheck()]
        [DataMember()]
        [RoundtripOriginal()]
        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();
                }
            }
        }
        
        [ConcurrencyCheck()]
        [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();
                }
            }
        }
        
        [ConcurrencyCheck()]
        [DataMember()]
        [RoundtripOriginal()]
        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();
                }
            }
        }
        
        [ConcurrencyCheck()]
        [DataMember()]
        [Required()]
        [RoundtripOriginal()]
        [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();
                }
            }
        }
        
        [ConcurrencyCheck()]
        [DataMember()]
        [RoundtripOriginal()]
        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();
                }
            }
        }
        
        [Association("Project_ProjectNote", "ID", "ProjectID")]
        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;
            }
        }
        
        [Association("Project_Task", "ID", "ProjectID")]
        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;
            }
        }
        
        [ConcurrencyCheck()]
        [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 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);
        }
        
        public override object GetIdentity()
        {
            return this._id;
        }
    }
    
    [DataContract(Namespace="http://schemas.datacontract.org/2004/07/TaskIt.Web.Models")]
    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>
        /// Default constructor.
        /// </summary>
        public ProjectNote()
        {
            this.OnCreated();
        }
        
        [ConcurrencyCheck()]
        [DataMember()]
        [RoundtripOriginal()]
        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();
                }
            }
        }
        
        [ConcurrencyCheck()]
        [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();
                }
            }
        }
        
        [Association("Project_ProjectNote", "ProjectID", "ID", IsForeignKey=true)]
        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");
                }
            }
        }
        
        [ConcurrencyCheck()]
        [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();
                }
            }
        }
        
        [Association("TaskItUser_ProjectNote", "UserID", "ID", IsForeignKey=true)]
        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");
                }
            }
        }
        
        [ConcurrencyCheck()]
        [DataMember()]
        [Required()]
        [RoundtripOriginal()]
        [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();
                }
            }
        }
        
        [ConcurrencyCheck()]
        [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);
        }
        
        public override object GetIdentity()
        {
            return this._id;
        }
    }
    
    [DataContract(Namespace="http://schemas.datacontract.org/2004/07/TaskIt.Web.Models")]
    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>
        /// Default constructor.
        /// </summary>
        public Task()
        {
            this.OnCreated();
        }
        
        [ConcurrencyCheck()]
        [DataMember()]
        [RoundtripOriginal()]
        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();
                }
            }
        }
        
        [Association("Contact_Task", "ContactID", "ID", IsForeignKey=true)]
        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");
                }
            }
        }
        
        [ConcurrencyCheck()]
        [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();
                }
            }
        }
        
        [Association("Context_Task", "ContextID", "ID", IsForeignKey=true)]
        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");
                }
            }
        }
        
        [ConcurrencyCheck()]
        [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();
                }
            }
        }
        
        [ConcurrencyCheck()]
        [DataMember()]
        [RoundtripOriginal()]
        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();
                }
            }
        }
        
        [ConcurrencyCheck()]
        [DataMember()]
        [RoundtripOriginal()]
        [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();
                }
            }
        }
        
        [ConcurrencyCheck()]
        [DataMember()]
        [RoundtripOriginal()]
        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();
                }
            }
        }
        
        [ConcurrencyCheck()]
        [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();
                }
            }
        }
        
        [ConcurrencyCheck()]
        [DataMember()]
        [RoundtripOriginal()]
        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();
                }
            }
        }
        
        [ConcurrencyCheck()]
        [DataMember()]
        [Required()]
        [RoundtripOriginal()]
        [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();
                }
            }
        }
        
        [Association("Priority_Task", "PriorityID", "ID", IsForeignKey=true)]
        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");
                }
            }
        }
        
        [ConcurrencyCheck()]
        [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();
                }
            }
        }
        
        [Association("Project_Task", "ProjectID", "ID", IsForeignKey=true)]
        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");
                }
            }
        }
        
        [ConcurrencyCheck()]
        [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();
                }
            }
        }
        
        [Association("TaskCategory_Task", "TaskCategoryID", "ID", IsForeignKey=true)]
        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");
                }
            }
        }
        
        [ConcurrencyCheck()]
        [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();
                }
            }
        }
        
        [Association("Task_TaskNote", "ID", "TaskID")]
        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;
            }
        }
        
        [ConcurrencyCheck()]
        [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 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);
        }
        
        public override object GetIdentity()
        {
            return this._id;
        }
    }
    
    [DataContract(Namespace="http://schemas.datacontract.org/2004/07/TaskIt.Web.Models")]
    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>
        /// Default constructor.
        /// </summary>
        public TaskCategory()
        {
            this.OnCreated();
        }
        
        [ConcurrencyCheck()]
        [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();
                }
            }
        }
        
        [ConcurrencyCheck()]
        [DataMember()]
        [Required()]
        [RoundtripOriginal()]
        [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();
                }
            }
        }
        
        [Association("TaskCategory_Task", "ID", "TaskCategoryID")]
        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);
        }
        
        public override object GetIdentity()
        {
            return this._id;
        }
    }
    
    [DataContract(Namespace="http://schemas.datacontract.org/2004/07/TaskIt.Web.Models")]
    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>
        /// Default constructor.
        /// </summary>
        public TaskItUser()
        {
            this.OnCreated();
        }
        
        [Association("TaskItUser_ContactNote", "ID", "UserID")]
        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;
            }
        }
        
        [Association("TaskItUser_ContextNote", "ID", "UserID")]
        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;
            }
        }
        
        [ConcurrencyCheck()]
        [DataMember()]
        [RoundtripOriginal()]
        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();
                }
            }
        }
        
        [ConcurrencyCheck()]
        [DataMember()]
        [RoundtripOriginal()]
        [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();
                }
            }
        }
        
        [ConcurrencyCheck()]
        [DataMember()]
        [RoundtripOriginal()]
        [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();
                }
            }
        }
        
        [ConcurrencyCheck()]
        [DataMember()]
        [RoundtripOriginal()]
        [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();
                }
            }
        }
        
        [ConcurrencyCheck()]
        [DataMember()]
        [RoundtripOriginal()]
        [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();
                }
            }
        }
        
        [ConcurrencyCheck()]
        [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();
                }
            }
        }
        
        [ConcurrencyCheck()]
        [DataMember()]
        [RoundtripOriginal()]
        [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();
                }
            }
        }
        
        [ConcurrencyCheck()]
        [DataMember()]
        [RoundtripOriginal()]
        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();
                }
            }
        }
        
        [ConcurrencyCheck()]
        [DataMember()]
        [Required()]
        [RoundtripOriginal()]
        [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();
                }
            }
        }
        
        [Association("TaskItUser_ProjectNote", "ID", "UserID")]
        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;
            }
        }
        
        [Association("TaskItUser_TaskNote", "ID", "UserID")]
        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;
            }
        }
        
        [ConcurrencyCheck()]
        [DataMember()]
        [RoundtripOriginal()]
        [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();
                }
            }
        }
        
        [ConcurrencyCheck()]
        [DataMember()]
        [RoundtripOriginal()]
        [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();
                }
            }
        }
        
        [ConcurrencyCheck()]
        [DataMember()]
        [Required()]
        [RoundtripOriginal()]
        [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);
        }
        
        public override object GetIdentity()
        {
            return this._id;
        }
    }
    
    [DataContract(Namespace="http://schemas.datacontract.org/2004/07/TaskIt.Web.Models")]
    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>
        /// Default constructor.
        /// </summary>
        public TaskNote()
        {
            this.OnCreated();
        }
        
        [ConcurrencyCheck()]
        [DataMember()]
        [RoundtripOriginal()]
        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();
                }
            }
        }
        
        [ConcurrencyCheck()]
        [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();
                }
            }
        }
        
        [Association("Task_TaskNote", "TaskID", "ID", IsForeignKey=true)]
        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");
                }
            }
        }
        
        [ConcurrencyCheck()]
        [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();
                }
            }
        }
        
        [Association("TaskItUser_TaskNote", "UserID", "ID", IsForeignKey=true)]
        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");
                }
            }
        }
        
        [ConcurrencyCheck()]
        [DataMember()]
        [Required()]
        [RoundtripOriginal()]
        [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();
                }
            }
        }
        
        [ConcurrencyCheck()]
        [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);
        }
        
        public override object GetIdentity()
        {
            return this._id;
        }
    }
    
    [DataContract(Namespace="http://schemas.datacontract.org/2004/07/TaskIt.Web.Models")]
    public sealed partial class TasksOverview : Entity
    {
        
        private int _completedThisMonth;
        
        private int _completedThisWeek;
        
        private int _dueThisMonth;
        
        private int _dueThisWeek;
        
        private int _overdue;
        
        #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 OnCompletedThisMonthChanging(int value);
        partial void OnCompletedThisMonthChanged();
        partial void OnCompletedThisWeekChanging(int value);
        partial void OnCompletedThisWeekChanged();
        partial void OnDueThisMonthChanging(int value);
        partial void OnDueThisMonthChanged();
        partial void OnDueThisWeekChanging(int value);
        partial void OnDueThisWeekChanged();
        partial void OnOverdueChanging(int value);
        partial void OnOverdueChanged();

        #endregion
        
        
        /// <summary>
        /// Default constructor.
        /// </summary>
        public TasksOverview()
        {
            this.OnCreated();
        }
        
        [ConcurrencyCheck()]
        [DataMember()]
        [Key()]
        [RoundtripOriginal()]
        public int CompletedThisMonth
        {
            get
            {
                return this._completedThisMonth;
            }
            set
            {
                if ((this._completedThisMonth != value))
                {
                    this.OnCompletedThisMonthChanging(value);
                    this.RaiseDataMemberChanging("CompletedThisMonth");
                    this.ValidateProperty("CompletedThisMonth", value);
                    this._completedThisMonth = value;
                    this.RaiseDataMemberChanged("CompletedThisMonth");
                    this.OnCompletedThisMonthChanged();
                }
            }
        }
        
        [ConcurrencyCheck()]
        [DataMember()]
        [RoundtripOriginal()]
        public int CompletedThisWeek
        {
            get
            {
                return this._completedThisWeek;
            }
            set
            {
                if ((this._completedThisWeek != value))
                {
                    this.OnCompletedThisWeekChanging(value);
                    this.RaiseDataMemberChanging("CompletedThisWeek");
                    this.ValidateProperty("CompletedThisWeek", value);
                    this._completedThisWeek = value;
                    this.RaiseDataMemberChanged("CompletedThisWeek");
                    this.OnCompletedThisWeekChanged();
                }
            }
        }
        
        [ConcurrencyCheck()]
        [DataMember()]
        [RoundtripOriginal()]
        public int DueThisMonth
        {
            get
            {
                return this._dueThisMonth;
            }
            set
            {
                if ((this._dueThisMonth != value))
                {
                    this.OnDueThisMonthChanging(value);
                    this.RaiseDataMemberChanging("DueThisMonth");
                    this.ValidateProperty("DueThisMonth", value);
                    this._dueThisMonth = value;
                    this.RaiseDataMemberChanged("DueThisMonth");
                    this.OnDueThisMonthChanged();
                }
            }
        }
        
        [ConcurrencyCheck()]
        [DataMember()]
        [RoundtripOriginal()]
        public int DueThisWeek
        {
            get
            {
                return this._dueThisWeek;
            }
            set
            {
                if ((this._dueThisWeek != value))
                {
                    this.OnDueThisWeekChanging(value);
                    this.RaiseDataMemberChanging("DueThisWeek");
                    this.ValidateProperty("DueThisWeek", value);
                    this._dueThisWeek = value;
                    this.RaiseDataMemberChanged("DueThisWeek");
                    this.OnDueThisWeekChanged();
                }
            }
        }
        
        [ConcurrencyCheck()]
        [DataMember()]
        [RoundtripOriginal()]
        public int Overdue
        {
            get
            {
                return this._overdue;
            }
            set
            {
                if ((this._overdue != value))
                {
                    this.OnOverdueChanging(value);
                    this.RaiseDataMemberChanging("Overdue");
                    this.ValidateProperty("Overdue", value);
                    this._overdue = value;
                    this.RaiseDataMemberChanged("Overdue");
                    this.OnOverdueChanged();
                }
            }
        }
        
        public override object GetIdentity()
        {
            return this._completedThisMonth;
        }
    }
}
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.Models;
    
    
    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>
        /// Default constructor.
        /// </summary>
        public DataContext() : 
                this(new WebDomainClient<IDataServiceContract>(new Uri("TaskIt-Web-Services-DataService.svc", UriKind.Relative)))
        {
        }
        
        /// <summary>
        /// Constructor used to specify a data service URI.
        /// </summary>
        /// <param name="serviceUri">
        /// The DataService data service URI.
        /// </param>
        public DataContext(Uri serviceUri) : 
                this(new WebDomainClient<IDataServiceContract>(serviceUri))
        {
        }
        
        /// <summary>
        /// Constructor used to specify a DomainClient instance.
        /// </summary>
        /// <param name="domainClient">
        /// The DomainClient instance the DomainContext should use.
        /// </param>
        public DataContext(DomainClient domainClient) : 
                base(domainClient)
        {
            this.OnCreated();
        }
        
        public EntitySet<Task> Tasks
        {
            get
            {
                return base.EntityContainer.GetEntitySet<Task>();
            }
        }
        
        public EntitySet<ContactNote> ContactNotes
        {
            get
            {
                return base.EntityContainer.GetEntitySet<ContactNote>();
            }
        }
        
        public EntitySet<Contact> Contacts
        {
            get
            {
                return base.EntityContainer.GetEntitySet<Contact>();
            }
        }
        
        public EntitySet<ContextNote> ContextNotes
        {
            get
            {
                return base.EntityContainer.GetEntitySet<ContextNote>();
            }
        }
        
        public EntitySet<Context> Contexts
        {
            get
            {
                return base.EntityContainer.GetEntitySet<Context>();
            }
        }
        
        public EntitySet<Priority> Priorities
        {
            get
            {
                return base.EntityContainer.GetEntitySet<Priority>();
            }
        }
        
        public EntitySet<ProjectNote> ProjectNotes
        {
            get
            {
                return base.EntityContainer.GetEntitySet<ProjectNote>();
            }
        }
        
        public EntitySet<Project> Projects
        {
            get
            {
                return base.EntityContainer.GetEntitySet<Project>();
            }
        }
        
        public EntitySet<TaskCategory> TaskCategories
        {
            get
            {
                return base.EntityContainer.GetEntitySet<TaskCategory>();
            }
        }
        
        public EntitySet<TaskNote> TaskNotes
        {
            get
            {
                return base.EntityContainer.GetEntitySet<TaskNote>();
            }
        }
        
        public EntitySet<TasksOverview> TasksOverviews
        {
            get
            {
                return base.EntityContainer.GetEntitySet<TasksOverview>();
            }
        }
        
        public EntitySet<TaskItUser> TaskItUsers
        {
            get
            {
                return base.EntityContainer.GetEntitySet<TaskItUser>();
            }
        }
        
        /// <summary>
        /// Returns an EntityQuery for query operation 'GetAllTasks'.
        /// </summary>
        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>
        /// Returns an EntityQuery for query operation 'GetBlogPosts'.
        /// </summary>
        public EntityQuery<Task> GetBlogPostsQuery()
        {
            this.ValidateMethod("GetBlogPostsQuery", null);
            return base.CreateQuery<Task>("GetBlogPosts", null, false, true);
        }
        
        /// <summary>
        /// Returns an EntityQuery for query operation 'GetContactNotes'.
        /// </summary>
        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>
        /// Returns an EntityQuery for query operation 'GetContacts'.
        /// </summary>
        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>
        /// Returns an EntityQuery for query operation 'GetContextNotes'.
        /// </summary>
        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>
        /// Returns an EntityQuery for query operation 'GetContexts'.
        /// </summary>
        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>
        /// Returns an EntityQuery for query operation 'GetOverdueTasks'.
        /// </summary>
        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>
        /// Returns an EntityQuery for query operation 'GetPriorities'.
        /// </summary>
        public EntityQuery<Priority> GetPrioritiesQuery()
        {
            this.ValidateMethod("GetPrioritiesQuery", null);
            return base.CreateQuery<Priority>("GetPriorities", null, false, true);
        }
        
        /// <summary>
        /// Returns an EntityQuery for query operation 'GetProjectNotes'.
        /// </summary>
        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>
        /// Returns an EntityQuery for query operation 'GetProjects'.
        /// </summary>
        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>
        /// Returns an EntityQuery for query operation 'GetProjectsDueThisWeek'.
        /// </summary>
        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>
        /// Returns an EntityQuery for query operation 'GetTaskCategories'.
        /// </summary>
        public EntityQuery<TaskCategory> GetTaskCategoriesQuery()
        {
            this.ValidateMethod("GetTaskCategoriesQuery", null);
            return base.CreateQuery<TaskCategory>("GetTaskCategories", null, false, true);
        }
        
        /// <summary>
        /// Returns an EntityQuery for query operation 'GetTaskNotes'.
        /// </summary>
        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>
        /// Returns an EntityQuery for query operation 'GetTasksByContact'.
        /// </summary>
        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>
        /// Returns an EntityQuery for query operation 'GetTasksByContext'.
        /// </summary>
        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>
        /// Returns an EntityQuery for query operation 'GetTasksByProject'.
        /// </summary>
        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>
        /// Returns an EntityQuery for query operation 'GetTasksByTaskCategory'.
        /// </summary>
        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>
        /// Returns an EntityQuery for query operation 'GetTasksDueThisWeek'.
        /// </summary>
        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>
        /// Returns an EntityQuery for query operation 'GetTasksOverview'.
        /// </summary>
        public EntityQuery<TasksOverview> GetTasksOverviewQuery(long userID)
        {
            Dictionary<string, object> parameters = new Dictionary<string, object>();
            parameters.Add("userID", userID);
            this.ValidateMethod("GetTasksOverviewQuery", parameters);
            return base.CreateQuery<TasksOverview>("GetTasksOverview", parameters, false, true);
        }
        
        /// <summary>
        /// Returns an EntityQuery for query operation 'GetUsers'.
        /// </summary>
        public EntityQuery<TaskItUser> GetUsersQuery()
        {
            this.ValidateMethod("GetUsersQuery", null);
            return base.CreateQuery<TaskItUser>("GetUsers", null, false, true);
        }
        
        /// <summary>
        /// Returns an EntityQuery for query operation 'GetVideos'.
        /// </summary>
        public EntityQuery<Task> GetVideosQuery()
        {
            this.ValidateMethod("GetVideosQuery", null);
            return base.CreateQuery<Task>("GetVideos", null, false, true);
        }
        
        /// <summary>
        /// Returns an EntityQuery for query operation 'GetWebinars'.
        /// </summary>
        public EntityQuery<Task> GetWebinarsQuery()
        {
            this.ValidateMethod("GetWebinarsQuery", null);
            return base.CreateQuery<Task>("GetWebinars", null, false, true);
        }
        
        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);
        }
        
        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);
        }
        
        protected override EntityContainer CreateEntityContainer()
        {
            return new DataContextEntityContainer();
        }
        
        [ServiceContract()]
        public interface IDataServiceContract
        {
            
            [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);
            
            QueryResult<Contact> EndGetContacts(IAsyncResult result);
            
            [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);
            
            QueryResult<ContactNote> EndGetContactNotes(IAsyncResult result);
            
            [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);
            
            QueryResult<Context> EndGetContexts(IAsyncResult result);
            
            [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);
            
            QueryResult<ContextNote> EndGetContextNotes(IAsyncResult result);
            
            [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);
            
            QueryResult<Priority> EndGetPriorities(IAsyncResult result);
            
            [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);
            
            QueryResult<Project> EndGetProjects(IAsyncResult result);
            
            [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);
            
            QueryResult<Project> EndGetProjectsDueThisWeek(IAsyncResult result);
            
            [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);
            
            QueryResult<ProjectNote> EndGetProjectNotes(IAsyncResult result);
            
            [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);
            
            QueryResult<Task> EndGetTasksByTaskCategory(IAsyncResult result);
            
            [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);
            
            QueryResult<Task> EndGetAllTasks(IAsyncResult result);
            
            [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);
            
            QueryResult<Task> EndGetTasksByProject(IAsyncResult result);
            
            [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/DataService/GetBlogPostsDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
            [OperationContract(AsyncPattern=true, Action="http://tempuri.org/DataService/GetBlogPosts", ReplyAction="http://tempuri.org/DataService/GetBlogPostsResponse")]
            [WebGet()]
            IAsyncResult BeginGetBlogPosts(AsyncCallback callback, object asyncState);
            
            QueryResult<Task> EndGetBlogPosts(IAsyncResult result);
            
            [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/DataService/GetVideosDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
            [OperationContract(AsyncPattern=true, Action="http://tempuri.org/DataService/GetVideos", ReplyAction="http://tempuri.org/DataService/GetVideosResponse")]
            [WebGet()]
            IAsyncResult BeginGetVideos(AsyncCallback callback, object asyncState);
            
            QueryResult<Task> EndGetVideos(IAsyncResult result);
            
            [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/DataService/GetWebinarsDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
            [OperationContract(AsyncPattern=true, Action="http://tempuri.org/DataService/GetWebinars", ReplyAction="http://tempuri.org/DataService/GetWebinarsResponse")]
            [WebGet()]
            IAsyncResult BeginGetWebinars(AsyncCallback callback, object asyncState);
            
            QueryResult<Task> EndGetWebinars(IAsyncResult result);
            
            [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);
            
            QueryResult<Task> EndGetTasksByContext(IAsyncResult result);
            
            [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);
            
            QueryResult<Task> EndGetTasksByContact(IAsyncResult result);
            
            [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);
            
            QueryResult<Task> EndGetTasksDueThisWeek(IAsyncResult result);
            
            [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);
            
            QueryResult<Task> EndGetOverdueTasks(IAsyncResult result);
            
            [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);
            
            QueryResult<TaskNote> EndGetTaskNotes(IAsyncResult result);
            
            [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);
            
            QueryResult<TaskCategory> EndGetTaskCategories(IAsyncResult result);
            
            [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);
            
            QueryResult<TaskItUser> EndGetUsers(IAsyncResult result);
            
            [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/DataService/GetTasksOverviewDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
            [OperationContract(AsyncPattern=true, Action="http://tempuri.org/DataService/GetTasksOverview", ReplyAction="http://tempuri.org/DataService/GetTasksOverviewResponse")]
            [WebGet()]
            IAsyncResult BeginGetTasksOverview(long userID, AsyncCallback callback, object asyncState);
            
            QueryResult<TasksOverview> EndGetTasksOverview(IAsyncResult result);
            
            [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);
            
            void EndTweet(IAsyncResult result);
            
            [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);
            
            IEnumerable<ChangeSetEntry> EndSubmitChanges(IAsyncResult result);
        }
        
        internal sealed class DataContextEntityContainer : EntityContainer
        {
            
            public DataContextEntityContainer()
            {
                this.CreateEntitySet<Contact>(EntitySetOperations.All);
                this.CreateEntitySet<ContactNote>(EntitySetOperations.Add);
                this.CreateEntitySet<Context>(EntitySetOperations.All);
                this.CreateEntitySet<ContextNote>(EntitySetOperations.Add);
                this.CreateEntitySet<Priority>(EntitySetOperations.None);
                this.CreateEntitySet<Project>(EntitySetOperations.All);
                this.CreateEntitySet<ProjectNote>(EntitySetOperations.Add);
                this.CreateEntitySet<Task>(EntitySetOperations.All);
                this.CreateEntitySet<TaskCategory>(EntitySetOperations.None);
                this.CreateEntitySet<TaskItUser>(EntitySetOperations.All);
                this.CreateEntitySet<TaskNote>(EntitySetOperations.Add);
                this.CreateEntitySet<TasksOverview>(EntitySetOperations.None);
            }
        }
    }
}
