PageRenderTime 20ms CodeModel.GetById 6ms app.highlight 57ms RepoModel.GetById 4ms app.codeStats 1ms

/glados_proto/glados_proto/Generated_Code/glados.Web.g.cs

https://bitbucket.org/lucky_geck/tsys
C# | 5490 lines | 3474 code | 581 blank | 1435 comment | 263 complexity | cab37df988f6307caed2a42a087b87be MD5 | raw file

Large files files are truncated, but you can click here to view the full file

   1//------------------------------------------------------------------------------
   2// <auto-generated>
   3//     This code was generated by a tool.
   4//     Runtime Version:4.0.30319.1
   5//
   6//     Changes to this file may cause incorrect behavior and will be lost if
   7//     the code is regenerated.
   8// </auto-generated>
   9//------------------------------------------------------------------------------
  10
  11namespace glados
  12{
  13    using System;
  14    using System.Collections.Generic;
  15    using System.ComponentModel;
  16    using System.ComponentModel.DataAnnotations;
  17    using System.Linq;
  18    using System.ServiceModel.DomainServices;
  19    using System.ServiceModel.DomainServices.Client;
  20    using System.ServiceModel.DomainServices.Client.ApplicationServices;
  21    using glados.Web;
  22    
  23    
  24    /// <summary>
  25    /// Context for the RIA application.
  26    /// </summary>
  27    /// <remarks>
  28    /// This context extends the base to make application services and types available
  29    /// for consumption from code and xaml.
  30    /// </remarks>
  31    public sealed partial class WebContext : WebContextBase
  32    {
  33        
  34        #region Extensibility Method Definitions
  35
  36        /// <summary>
  37        /// This method is invoked from the constructor once initialization is complete and
  38        /// can be used for further object setup.
  39        /// </summary>
  40        partial void OnCreated();
  41
  42        #endregion
  43        
  44        
  45        /// <summary>
  46        /// Initializes a new instance of the WebContext class.
  47        /// </summary>
  48        public WebContext()
  49        {
  50            this.OnCreated();
  51        }
  52        
  53        /// <summary>
  54        /// Gets the context that is registered as a lifetime object with the current application.
  55        /// </summary>
  56        /// <exception cref="InvalidOperationException"> is thrown if there is no current application,
  57        /// no contexts have been added, or more than one context has been added.
  58        /// </exception>
  59        /// <seealso cref="System.Windows.Application.ApplicationLifetimeObjects"/>
  60        public new static WebContext Current
  61        {
  62            get
  63            {
  64                return ((WebContext)(WebContextBase.Current));
  65            }
  66        }
  67        
  68        /// <summary>
  69        /// Gets a user representing the authenticated identity.
  70        /// </summary>
  71        public new AuthUser User
  72        {
  73            get
  74            {
  75                return ((AuthUser)(base.User));
  76            }
  77        }
  78    }
  79}
  80namespace Glados.TestingModule.Interfaces
  81{
  82    using System;
  83    using System.Collections.Generic;
  84    using System.ComponentModel;
  85    using System.ComponentModel.DataAnnotations;
  86    using System.Linq;
  87    using System.ServiceModel.DomainServices;
  88    using System.ServiceModel.DomainServices.Client;
  89    using System.ServiceModel.DomainServices.Client.ApplicationServices;
  90    
  91    
  92    public enum ServerStatus
  93    {
  94        
  95        Idle = 0,
  96        
  97        Busy = 1,
  98        
  99        InternalError = 2,
 100        
 101        Unavailable = 3,
 102        
 103        Down = 4,
 104    }
 105}
 106namespace glados.Web
 107{
 108    using System;
 109    using System.Collections.Generic;
 110    using System.ComponentModel;
 111    using System.ComponentModel.DataAnnotations;
 112    using System.Linq;
 113    using System.Runtime.Serialization;
 114    using System.ServiceModel;
 115    using System.ServiceModel.DomainServices;
 116    using System.ServiceModel.DomainServices.Client;
 117    using System.ServiceModel.DomainServices.Client.ApplicationServices;
 118    using System.ServiceModel.Web;
 119    using System.Xml.Serialization;
 120    
 121    
 122    /// <summary>
 123    /// The 'Assignment' entity class.
 124    /// </summary>
 125    [DataContract(Namespace="http://schemas.datacontract.org/2004/07/glados.Web")]
 126    public sealed partial class Assignment : Entity
 127    {
 128        
 129        private int _id;
 130        
 131        private EntityRef<Participation> _participation;
 132        
 133        private int _participationId;
 134        
 135        private EntityRef<Problem> _problem;
 136        
 137        private int _problemId;
 138        
 139        private byte[] _state;
 140        
 141        private EntityCollection<Submission> _submission;
 142        
 143        #region Extensibility Method Definitions
 144
 145        /// <summary>
 146        /// This method is invoked from the constructor once initialization is complete and
 147        /// can be used for further object setup.
 148        /// </summary>
 149        partial void OnCreated();
 150        partial void OnIdChanging(int value);
 151        partial void OnIdChanged();
 152        partial void OnParticipationIdChanging(int value);
 153        partial void OnParticipationIdChanged();
 154        partial void OnProblemIdChanging(int value);
 155        partial void OnProblemIdChanged();
 156        partial void OnStateChanging(byte[] value);
 157        partial void OnStateChanged();
 158
 159        #endregion
 160        
 161        
 162        /// <summary>
 163        /// Initializes a new instance of the <see cref="Assignment"/> class.
 164        /// </summary>
 165        public Assignment()
 166        {
 167            this.OnCreated();
 168        }
 169        
 170        /// <summary>
 171        /// Gets or sets the 'Id' value.
 172        /// </summary>
 173        [DataMember()]
 174        [Editable(false, AllowInitialValue=true)]
 175        [Key()]
 176        [RoundtripOriginal()]
 177        public int Id
 178        {
 179            get
 180            {
 181                return this._id;
 182            }
 183            set
 184            {
 185                if ((this._id != value))
 186                {
 187                    this.OnIdChanging(value);
 188                    this.ValidateProperty("Id", value);
 189                    this._id = value;
 190                    this.RaisePropertyChanged("Id");
 191                    this.OnIdChanged();
 192                }
 193            }
 194        }
 195        
 196        /// <summary>
 197        /// Gets or sets the associated <see cref="Participation"/> entity.
 198        /// </summary>
 199        [Association("Participation_Assignment", "ParticipationId", "Id", IsForeignKey=true)]
 200        [XmlIgnore()]
 201        public Participation Participation
 202        {
 203            get
 204            {
 205                if ((this._participation == null))
 206                {
 207                    this._participation = new EntityRef<Participation>(this, "Participation", this.FilterParticipation);
 208                }
 209                return this._participation.Entity;
 210            }
 211            set
 212            {
 213                Participation previous = this.Participation;
 214                if ((previous != value))
 215                {
 216                    this.ValidateProperty("Participation", value);
 217                    if ((previous != null))
 218                    {
 219                        this._participation.Entity = null;
 220                        previous.Assignment.Remove(this);
 221                    }
 222                    if ((value != null))
 223                    {
 224                        this.ParticipationId = value.Id;
 225                    }
 226                    else
 227                    {
 228                        this.ParticipationId = default(int);
 229                    }
 230                    this._participation.Entity = value;
 231                    if ((value != null))
 232                    {
 233                        value.Assignment.Add(this);
 234                    }
 235                    this.RaisePropertyChanged("Participation");
 236                }
 237            }
 238        }
 239        
 240        /// <summary>
 241        /// Gets or sets the 'ParticipationId' value.
 242        /// </summary>
 243        [DataMember()]
 244        [RoundtripOriginal()]
 245        public int ParticipationId
 246        {
 247            get
 248            {
 249                return this._participationId;
 250            }
 251            set
 252            {
 253                if ((this._participationId != value))
 254                {
 255                    this.OnParticipationIdChanging(value);
 256                    this.RaiseDataMemberChanging("ParticipationId");
 257                    this.ValidateProperty("ParticipationId", value);
 258                    this._participationId = value;
 259                    this.RaiseDataMemberChanged("ParticipationId");
 260                    this.OnParticipationIdChanged();
 261                }
 262            }
 263        }
 264        
 265        /// <summary>
 266        /// Gets or sets the associated <see cref="Problem"/> entity.
 267        /// </summary>
 268        [Association("Problem_Assignment", "ProblemId", "Id", IsForeignKey=true)]
 269        [XmlIgnore()]
 270        public Problem Problem
 271        {
 272            get
 273            {
 274                if ((this._problem == null))
 275                {
 276                    this._problem = new EntityRef<Problem>(this, "Problem", this.FilterProblem);
 277                }
 278                return this._problem.Entity;
 279            }
 280            set
 281            {
 282                Problem previous = this.Problem;
 283                if ((previous != value))
 284                {
 285                    this.ValidateProperty("Problem", value);
 286                    if ((previous != null))
 287                    {
 288                        this._problem.Entity = null;
 289                        previous.Assignment.Remove(this);
 290                    }
 291                    if ((value != null))
 292                    {
 293                        this.ProblemId = value.Id;
 294                    }
 295                    else
 296                    {
 297                        this.ProblemId = default(int);
 298                    }
 299                    this._problem.Entity = value;
 300                    if ((value != null))
 301                    {
 302                        value.Assignment.Add(this);
 303                    }
 304                    this.RaisePropertyChanged("Problem");
 305                }
 306            }
 307        }
 308        
 309        /// <summary>
 310        /// Gets or sets the 'ProblemId' value.
 311        /// </summary>
 312        [DataMember()]
 313        [RoundtripOriginal()]
 314        public int ProblemId
 315        {
 316            get
 317            {
 318                return this._problemId;
 319            }
 320            set
 321            {
 322                if ((this._problemId != value))
 323                {
 324                    this.OnProblemIdChanging(value);
 325                    this.RaiseDataMemberChanging("ProblemId");
 326                    this.ValidateProperty("ProblemId", value);
 327                    this._problemId = value;
 328                    this.RaiseDataMemberChanged("ProblemId");
 329                    this.OnProblemIdChanged();
 330                }
 331            }
 332        }
 333        
 334        /// <summary>
 335        /// Gets or sets the 'State' value.
 336        /// </summary>
 337        [DataMember()]
 338        public byte[] State
 339        {
 340            get
 341            {
 342                return this._state;
 343            }
 344            set
 345            {
 346                if ((this._state != value))
 347                {
 348                    this.OnStateChanging(value);
 349                    this.RaiseDataMemberChanging("State");
 350                    this.ValidateProperty("State", value);
 351                    this._state = value;
 352                    this.RaiseDataMemberChanged("State");
 353                    this.OnStateChanged();
 354                }
 355            }
 356        }
 357        
 358        /// <summary>
 359        /// Gets the collection of associated <see cref="Submission"/> entity instances.
 360        /// </summary>
 361        [Association("Assignment_Submission", "Id", "AssignmentId")]
 362        [XmlIgnore()]
 363        public EntityCollection<Submission> Submission
 364        {
 365            get
 366            {
 367                if ((this._submission == null))
 368                {
 369                    this._submission = new EntityCollection<Submission>(this, "Submission", this.FilterSubmission, this.AttachSubmission, this.DetachSubmission);
 370                }
 371                return this._submission;
 372            }
 373        }
 374        
 375        private bool FilterParticipation(Participation entity)
 376        {
 377            return (entity.Id == this.ParticipationId);
 378        }
 379        
 380        private bool FilterProblem(Problem entity)
 381        {
 382            return (entity.Id == this.ProblemId);
 383        }
 384        
 385        private void AttachSubmission(Submission entity)
 386        {
 387            entity.Assignment = this;
 388        }
 389        
 390        private void DetachSubmission(Submission entity)
 391        {
 392            entity.Assignment = null;
 393        }
 394        
 395        private bool FilterSubmission(Submission entity)
 396        {
 397            return (entity.AssignmentId == this.Id);
 398        }
 399        
 400        /// <summary>
 401        /// Computes a value from the key fields that uniquely identifies this entity instance.
 402        /// </summary>
 403        /// <returns>An object instance that uniquely identifies this entity instance.</returns>
 404        public override object GetIdentity()
 405        {
 406            return this._id;
 407        }
 408    }
 409    
 410    /// <summary>
 411    /// The DomainContext corresponding to the 'AuthenticationDomainService' DomainService.
 412    /// </summary>
 413    public sealed partial class AuthenticationDomainContext : global::System.ServiceModel.DomainServices.Client.ApplicationServices.AuthenticationDomainContextBase
 414    {
 415        
 416        #region Extensibility Method Definitions
 417
 418        /// <summary>
 419        /// This method is invoked from the constructor once initialization is complete and
 420        /// can be used for further object setup.
 421        /// </summary>
 422        partial void OnCreated();
 423
 424        #endregion
 425        
 426        
 427        /// <summary>
 428        /// Initializes a new instance of the <see cref="AuthenticationDomainContext"/> class.
 429        /// </summary>
 430        public AuthenticationDomainContext() : 
 431                this(new WebDomainClient<IAuthenticationDomainServiceContract>(new Uri("glados-Web-AuthenticationDomainService.svc", UriKind.Relative)))
 432        {
 433        }
 434        
 435        /// <summary>
 436        /// Initializes a new instance of the <see cref="AuthenticationDomainContext"/> class with the specified service URI.
 437        /// </summary>
 438        /// <param name="serviceUri">The AuthenticationDomainService service URI.</param>
 439        public AuthenticationDomainContext(Uri serviceUri) : 
 440                this(new WebDomainClient<IAuthenticationDomainServiceContract>(serviceUri))
 441        {
 442        }
 443        
 444        /// <summary>
 445        /// Initializes a new instance of the <see cref="AuthenticationDomainContext"/> class with the specified <paramref name="domainClient"/>.
 446        /// </summary>
 447        /// <param name="domainClient">The DomainClient instance to use for this DomainContext.</param>
 448        public AuthenticationDomainContext(DomainClient domainClient) : 
 449                base(domainClient)
 450        {
 451            this.OnCreated();
 452        }
 453        
 454        /// <summary>
 455        /// Gets the set of <see cref="AuthUser"/> entity instances that have been loaded into this <see cref="AuthenticationDomainContext"/> instance.
 456        /// </summary>
 457        public EntitySet<AuthUser> AuthUsers
 458        {
 459            get
 460            {
 461                return base.EntityContainer.GetEntitySet<AuthUser>();
 462            }
 463        }
 464        
 465        /// <summary>
 466        /// Gets an EntityQuery instance that can be used to load <see cref="AuthUser"/> entity instances using the 'GetUser' query.
 467        /// </summary>
 468        /// <returns>An EntityQuery that can be loaded to retrieve <see cref="AuthUser"/> entity instances.</returns>
 469        public EntityQuery<AuthUser> GetUserQuery()
 470        {
 471            this.ValidateMethod("GetUserQuery", null);
 472            return base.CreateQuery<AuthUser>("GetUser", null, false, false);
 473        }
 474        
 475        /// <summary>
 476        /// Gets an EntityQuery instance that can be used to load <see cref="AuthUser"/> entity instances using the 'Login' query.
 477        /// </summary>
 478        /// <param name="userName">The value for the 'userName' parameter of the query.</param>
 479        /// <param name="password">The value for the 'password' parameter of the query.</param>
 480        /// <param name="isPersistent">The value for the 'isPersistent' parameter of the query.</param>
 481        /// <param name="customData">The value for the 'customData' parameter of the query.</param>
 482        /// <returns>An EntityQuery that can be loaded to retrieve <see cref="AuthUser"/> entity instances.</returns>
 483        public EntityQuery<AuthUser> LoginQuery(string userName, string password, bool isPersistent, string customData)
 484        {
 485            Dictionary<string, object> parameters = new Dictionary<string, object>();
 486            parameters.Add("userName", userName);
 487            parameters.Add("password", password);
 488            parameters.Add("isPersistent", isPersistent);
 489            parameters.Add("customData", customData);
 490            this.ValidateMethod("LoginQuery", parameters);
 491            return base.CreateQuery<AuthUser>("Login", parameters, true, false);
 492        }
 493        
 494        /// <summary>
 495        /// Gets an EntityQuery instance that can be used to load <see cref="AuthUser"/> entity instances using the 'Logout' query.
 496        /// </summary>
 497        /// <returns>An EntityQuery that can be loaded to retrieve <see cref="AuthUser"/> entity instances.</returns>
 498        public EntityQuery<AuthUser> LogoutQuery()
 499        {
 500            this.ValidateMethod("LogoutQuery", null);
 501            return base.CreateQuery<AuthUser>("Logout", null, true, false);
 502        }
 503        
 504        /// <summary>
 505        /// Creates a new EntityContainer for this DomainContext's EntitySets.
 506        /// </summary>
 507        /// <returns>A new container instance.</returns>
 508        protected override EntityContainer CreateEntityContainer()
 509        {
 510            return new AuthenticationDomainContextEntityContainer();
 511        }
 512        
 513        /// <summary>
 514        /// Service contract for the 'AuthenticationDomainService' DomainService.
 515        /// </summary>
 516        [ServiceContract()]
 517        public interface IAuthenticationDomainServiceContract
 518        {
 519            
 520            /// <summary>
 521            /// Asynchronously invokes the 'GetUser' operation.
 522            /// </summary>
 523            /// <param name="callback">Callback to invoke on completion.</param>
 524            /// <param name="asyncState">Optional state object.</param>
 525            /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
 526            [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/AuthenticationDomainService/GetUserDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
 527            [OperationContract(AsyncPattern=true, Action="http://tempuri.org/AuthenticationDomainService/GetUser", ReplyAction="http://tempuri.org/AuthenticationDomainService/GetUserResponse")]
 528            [WebGet()]
 529            IAsyncResult BeginGetUser(AsyncCallback callback, object asyncState);
 530            
 531            /// <summary>
 532            /// Completes the asynchronous operation begun by 'BeginGetUser'.
 533            /// </summary>
 534            /// <param name="result">The IAsyncResult returned from 'BeginGetUser'.</param>
 535            /// <returns>The 'QueryResult' returned from the 'GetUser' operation.</returns>
 536            QueryResult<AuthUser> EndGetUser(IAsyncResult result);
 537            
 538            /// <summary>
 539            /// Asynchronously invokes the 'Login' operation.
 540            /// </summary>
 541            /// <param name="userName">The value for the 'userName' parameter of this action.</param>
 542            /// <param name="password">The value for the 'password' parameter of this action.</param>
 543            /// <param name="isPersistent">The value for the 'isPersistent' parameter of this action.</param>
 544            /// <param name="customData">The value for the 'customData' parameter of this action.</param>
 545            /// <param name="callback">Callback to invoke on completion.</param>
 546            /// <param name="asyncState">Optional state object.</param>
 547            /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
 548            [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/AuthenticationDomainService/LoginDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
 549            [OperationContract(AsyncPattern=true, Action="http://tempuri.org/AuthenticationDomainService/Login", ReplyAction="http://tempuri.org/AuthenticationDomainService/LoginResponse")]
 550            IAsyncResult BeginLogin(string userName, string password, bool isPersistent, string customData, AsyncCallback callback, object asyncState);
 551            
 552            /// <summary>
 553            /// Completes the asynchronous operation begun by 'BeginLogin'.
 554            /// </summary>
 555            /// <param name="result">The IAsyncResult returned from 'BeginLogin'.</param>
 556            /// <returns>The 'QueryResult' returned from the 'Login' operation.</returns>
 557            QueryResult<AuthUser> EndLogin(IAsyncResult result);
 558            
 559            /// <summary>
 560            /// Asynchronously invokes the 'Logout' operation.
 561            /// </summary>
 562            /// <param name="callback">Callback to invoke on completion.</param>
 563            /// <param name="asyncState">Optional state object.</param>
 564            /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
 565            [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/AuthenticationDomainService/LogoutDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
 566            [OperationContract(AsyncPattern=true, Action="http://tempuri.org/AuthenticationDomainService/Logout", ReplyAction="http://tempuri.org/AuthenticationDomainService/LogoutResponse")]
 567            IAsyncResult BeginLogout(AsyncCallback callback, object asyncState);
 568            
 569            /// <summary>
 570            /// Completes the asynchronous operation begun by 'BeginLogout'.
 571            /// </summary>
 572            /// <param name="result">The IAsyncResult returned from 'BeginLogout'.</param>
 573            /// <returns>The 'QueryResult' returned from the 'Logout' operation.</returns>
 574            QueryResult<AuthUser> EndLogout(IAsyncResult result);
 575            
 576            /// <summary>
 577            /// Asynchronously invokes the 'SubmitChanges' operation.
 578            /// </summary>
 579            /// <param name="changeSet">The change-set to submit.</param>
 580            /// <param name="callback">Callback to invoke on completion.</param>
 581            /// <param name="asyncState">Optional state object.</param>
 582            /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
 583            [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/AuthenticationDomainService/SubmitChangesDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
 584            [OperationContract(AsyncPattern=true, Action="http://tempuri.org/AuthenticationDomainService/SubmitChanges", ReplyAction="http://tempuri.org/AuthenticationDomainService/SubmitChangesResponse")]
 585            IAsyncResult BeginSubmitChanges(IEnumerable<ChangeSetEntry> changeSet, AsyncCallback callback, object asyncState);
 586            
 587            /// <summary>
 588            /// Completes the asynchronous operation begun by 'BeginSubmitChanges'.
 589            /// </summary>
 590            /// <param name="result">The IAsyncResult returned from 'BeginSubmitChanges'.</param>
 591            /// <returns>The collection of change-set entry elements returned from 'SubmitChanges'.</returns>
 592            IEnumerable<ChangeSetEntry> EndSubmitChanges(IAsyncResult result);
 593        }
 594        
 595        internal sealed class AuthenticationDomainContextEntityContainer : EntityContainer
 596        {
 597            
 598            public AuthenticationDomainContextEntityContainer()
 599            {
 600                this.CreateEntitySet<AuthUser>(EntitySetOperations.Edit);
 601            }
 602        }
 603    }
 604    
 605    /// <summary>
 606    /// The 'AuthUser' entity class.
 607    /// </summary>
 608    [DataContract(Namespace="http://schemas.datacontract.org/2004/07/glados.Web")]
 609    public sealed partial class AuthUser : Entity, global::System.Security.Principal.IIdentity, global::System.Security.Principal.IPrincipal
 610    {
 611        
 612        private string _name = string.Empty;
 613        
 614        private IEnumerable<string> _roles;
 615        
 616        #region Extensibility Method Definitions
 617
 618        /// <summary>
 619        /// This method is invoked from the constructor once initialization is complete and
 620        /// can be used for further object setup.
 621        /// </summary>
 622        partial void OnCreated();
 623        partial void OnNameChanging(string value);
 624        partial void OnNameChanged();
 625        partial void OnRolesChanging(IEnumerable<string> value);
 626        partial void OnRolesChanged();
 627
 628        #endregion
 629        
 630        
 631        /// <summary>
 632        /// Initializes a new instance of the <see cref="AuthUser"/> class.
 633        /// </summary>
 634        public AuthUser()
 635        {
 636            this.OnCreated();
 637        }
 638        
 639        /// <summary>
 640        /// Gets or sets the 'Name' value.
 641        /// </summary>
 642        [DataMember()]
 643        [Editable(false, AllowInitialValue=true)]
 644        [Key()]
 645        [RoundtripOriginal()]
 646        public string Name
 647        {
 648            get
 649            {
 650                return this._name;
 651            }
 652            set
 653            {
 654                if ((this._name != value))
 655                {
 656                    this.OnNameChanging(value);
 657                    this.ValidateProperty("Name", value);
 658                    this._name = value;
 659                    this.RaisePropertyChanged("Name");
 660                    this.OnNameChanged();
 661                    this.RaisePropertyChanged("IsAuthenticated");
 662                }
 663            }
 664        }
 665        
 666        /// <summary>
 667        /// Gets or sets the 'Roles' value.
 668        /// </summary>
 669        [DataMember()]
 670        [Editable(false)]
 671        public IEnumerable<string> Roles
 672        {
 673            get
 674            {
 675                return this._roles;
 676            }
 677            set
 678            {
 679                if ((this._roles != value))
 680                {
 681                    this.OnRolesChanging(value);
 682                    this.ValidateProperty("Roles", value);
 683                    this._roles = value;
 684                    this.RaisePropertyChanged("Roles");
 685                    this.OnRolesChanged();
 686                }
 687            }
 688        }
 689        
 690        string global::System.Security.Principal.IIdentity.AuthenticationType
 691        {
 692            get
 693            {
 694                return string.Empty;
 695            }
 696        }
 697        
 698        /// <summary>
 699        /// Gets a value indicating whether the identity is authenticated.
 700        /// </summary>
 701        /// <remarks>
 702        /// This value is <c>true</c> if <see cref="Name"/> is not <c>null</c> or empty.
 703        /// </remarks>
 704        public bool IsAuthenticated
 705        {
 706            get
 707            {
 708                return (true != string.IsNullOrEmpty(this.Name));
 709            }
 710        }
 711        
 712        string global::System.Security.Principal.IIdentity.Name
 713        {
 714            get
 715            {
 716                return this.Name;
 717            }
 718        }
 719        
 720        global::System.Security.Principal.IIdentity global::System.Security.Principal.IPrincipal.Identity
 721        {
 722            get
 723            {
 724                return this;
 725            }
 726        }
 727        
 728        /// <summary>
 729        /// Computes a value from the key fields that uniquely identifies this entity instance.
 730        /// </summary>
 731        /// <returns>An object instance that uniquely identifies this entity instance.</returns>
 732        public override object GetIdentity()
 733        {
 734            return this._name;
 735        }
 736        
 737        /// <summary>
 738        /// Return whether the principal is in the role.
 739        /// </summary>
 740        /// <remarks>
 741        /// Returns whether the specified role is contained in the roles.
 742        /// This implementation is case sensitive.
 743        /// </remarks>
 744        /// <param name="role">The name of the role for which to check membership.</param>
 745        /// <returns>Whether the principal is in the role.</returns>
 746        public bool IsInRole(string role)
 747        {
 748            if ((this.Roles == null))
 749            {
 750                return false;
 751            }
 752            return global::System.Linq.Enumerable.Contains(this.Roles, role);
 753        }
 754    }
 755    
 756    /// <summary>
 757    /// The 'Course' entity class.
 758    /// </summary>
 759    [DataContract(Namespace="http://schemas.datacontract.org/2004/07/glados.Web")]
 760    public sealed partial class Course : Entity
 761    {
 762        
 763        private int _id;
 764        
 765        private string _name;
 766        
 767        private EntityCollection<Participation> _participation;
 768        
 769        private byte[] _state;
 770        
 771        private string _type;
 772        
 773        #region Extensibility Method Definitions
 774
 775        /// <summary>
 776        /// This method is invoked from the constructor once initialization is complete and
 777        /// can be used for further object setup.
 778        /// </summary>
 779        partial void OnCreated();
 780        partial void OnIdChanging(int value);
 781        partial void OnIdChanged();
 782        partial void OnNameChanging(string value);
 783        partial void OnNameChanged();
 784        partial void OnStateChanging(byte[] value);
 785        partial void OnStateChanged();
 786        partial void OnTypeChanging(string value);
 787        partial void OnTypeChanged();
 788
 789        #endregion
 790        
 791        
 792        /// <summary>
 793        /// Initializes a new instance of the <see cref="Course"/> class.
 794        /// </summary>
 795        public Course()
 796        {
 797            this.OnCreated();
 798        }
 799        
 800        /// <summary>
 801        /// Gets or sets the 'Id' value.
 802        /// </summary>
 803        [DataMember()]
 804        [Editable(false, AllowInitialValue=true)]
 805        [Key()]
 806        [RoundtripOriginal()]
 807        public int Id
 808        {
 809            get
 810            {
 811                return this._id;
 812            }
 813            set
 814            {
 815                if ((this._id != value))
 816                {
 817                    this.OnIdChanging(value);
 818                    this.ValidateProperty("Id", value);
 819                    this._id = value;
 820                    this.RaisePropertyChanged("Id");
 821                    this.OnIdChanged();
 822                }
 823            }
 824        }
 825        
 826        /// <summary>
 827        /// Gets or sets the 'Name' value.
 828        /// </summary>
 829        [DataMember()]
 830        [Required()]
 831        public string Name
 832        {
 833            get
 834            {
 835                return this._name;
 836            }
 837            set
 838            {
 839                if ((this._name != value))
 840                {
 841                    this.OnNameChanging(value);
 842                    this.RaiseDataMemberChanging("Name");
 843                    this.ValidateProperty("Name", value);
 844                    this._name = value;
 845                    this.RaiseDataMemberChanged("Name");
 846                    this.OnNameChanged();
 847                }
 848            }
 849        }
 850        
 851        /// <summary>
 852        /// Gets the collection of associated <see cref="Participation"/> entity instances.
 853        /// </summary>
 854        [Association("Course_Participation", "Id", "CourseId")]
 855        [XmlIgnore()]
 856        public EntityCollection<Participation> Participation
 857        {
 858            get
 859            {
 860                if ((this._participation == null))
 861                {
 862                    this._participation = new EntityCollection<Participation>(this, "Participation", this.FilterParticipation, this.AttachParticipation, this.DetachParticipation);
 863                }
 864                return this._participation;
 865            }
 866        }
 867        
 868        /// <summary>
 869        /// Gets or sets the 'State' value.
 870        /// </summary>
 871        [DataMember()]
 872        public byte[] State
 873        {
 874            get
 875            {
 876                return this._state;
 877            }
 878            set
 879            {
 880                if ((this._state != value))
 881                {
 882                    this.OnStateChanging(value);
 883                    this.RaiseDataMemberChanging("State");
 884                    this.ValidateProperty("State", value);
 885                    this._state = value;
 886                    this.RaiseDataMemberChanged("State");
 887                    this.OnStateChanged();
 888                }
 889            }
 890        }
 891        
 892        /// <summary>
 893        /// Gets or sets the 'Type' value.
 894        /// </summary>
 895        [DataMember()]
 896        public string Type
 897        {
 898            get
 899            {
 900                return this._type;
 901            }
 902            set
 903            {
 904                if ((this._type != value))
 905                {
 906                    this.OnTypeChanging(value);
 907                    this.RaiseDataMemberChanging("Type");
 908                    this.ValidateProperty("Type", value);
 909                    this._type = value;
 910                    this.RaiseDataMemberChanged("Type");
 911                    this.OnTypeChanged();
 912                }
 913            }
 914        }
 915        
 916        private void AttachParticipation(Participation entity)
 917        {
 918            entity.Course = this;
 919        }
 920        
 921        private void DetachParticipation(Participation entity)
 922        {
 923            entity.Course = null;
 924        }
 925        
 926        private bool FilterParticipation(Participation entity)
 927        {
 928            return (entity.CourseId == this.Id);
 929        }
 930        
 931        /// <summary>
 932        /// Computes a value from the key fields that uniquely identifies this entity instance.
 933        /// </summary>
 934        /// <returns>An object instance that uniquely identifies this entity instance.</returns>
 935        public override object GetIdentity()
 936        {
 937            return this._id;
 938        }
 939    }
 940    
 941    /// <summary>
 942    /// The 'Group' entity class.
 943    /// </summary>
 944    [DataContract(Namespace="http://schemas.datacontract.org/2004/07/glados.Web")]
 945    public sealed partial class Group : Entity
 946    {
 947        
 948        private int _id;
 949        
 950        private EntityCollection<Membership> _membership;
 951        
 952        private string _name;
 953        
 954        #region Extensibility Method Definitions
 955
 956        /// <summary>
 957        /// This method is invoked from the constructor once initialization is complete and
 958        /// can be used for further object setup.
 959        /// </summary>
 960        partial void OnCreated();
 961        partial void OnIdChanging(int value);
 962        partial void OnIdChanged();
 963        partial void OnNameChanging(string value);
 964        partial void OnNameChanged();
 965
 966        #endregion
 967        
 968        
 969        /// <summary>
 970        /// Initializes a new instance of the <see cref="Group"/> class.
 971        /// </summary>
 972        public Group()
 973        {
 974            this.OnCreated();
 975        }
 976        
 977        /// <summary>
 978        /// Gets or sets the 'Id' value.
 979        /// </summary>
 980        [DataMember()]
 981        [Editable(false, AllowInitialValue=true)]
 982        [Key()]
 983        [RoundtripOriginal()]
 984        public int Id
 985        {
 986            get
 987            {
 988                return this._id;
 989            }
 990            set
 991            {
 992                if ((this._id != value))
 993                {
 994                    this.OnIdChanging(value);
 995                    this.ValidateProperty("Id", value);
 996                    this._id = value;
 997                    this.RaisePropertyChanged("Id");
 998                    this.OnIdChanged();
 999                }
1000            }
1001        }
1002        
1003        /// <summary>
1004        /// Gets the collection of associated <see cref="Membership"/> entity instances.
1005        /// </summary>
1006        [Association("Group_Membership", "Id", "GroupId")]
1007        [XmlIgnore()]
1008        public EntityCollection<Membership> Membership
1009        {
1010            get
1011            {
1012                if ((this._membership == null))
1013                {
1014                    this._membership = new EntityCollection<Membership>(this, "Membership", this.FilterMembership, this.AttachMembership, this.DetachMembership);
1015                }
1016                return this._membership;
1017            }
1018        }
1019        
1020        /// <summary>
1021        /// Gets or sets the 'Name' value.
1022        /// </summary>
1023        [DataMember()]
1024        [Required()]
1025        public string Name
1026        {
1027            get
1028            {
1029                return this._name;
1030            }
1031            set
1032            {
1033                if ((this._name != value))
1034                {
1035                    this.OnNameChanging(value);
1036                    this.RaiseDataMemberChanging("Name");
1037                    this.ValidateProperty("Name", value);
1038                    this._name = value;
1039                    this.RaiseDataMemberChanged("Name");
1040                    this.OnNameChanged();
1041                }
1042            }
1043        }
1044        
1045        private void AttachMembership(Membership entity)
1046        {
1047            entity.Group = this;
1048        }
1049        
1050        private void DetachMembership(Membership entity)
1051        {
1052            entity.Group = null;
1053        }
1054        
1055        private bool FilterMembership(Membership entity)
1056        {
1057            return (entity.GroupId == this.Id);
1058        }
1059        
1060        /// <summary>
1061        /// Computes a value from the key fields that uniquely identifies this entity instance.
1062        /// </summary>
1063        /// <returns>An object instance that uniquely identifies this entity instance.</returns>
1064        public override object GetIdentity()
1065        {
1066            return this._id;
1067        }
1068    }
1069    
1070    /// <summary>
1071    /// The 'Membership' entity class.
1072    /// </summary>
1073    [DataContract(Namespace="http://schemas.datacontract.org/2004/07/glados.Web")]
1074    public sealed partial class Membership : Entity
1075    {
1076        
1077        private EntityRef<Group> _group;
1078        
1079        private int _groupId;
1080        
1081        private int _id;
1082        
1083        private EntityRef<User> _user;
1084        
1085        private int _userId;
1086        
1087        #region Extensibility Method Definitions
1088
1089        /// <summary>
1090        /// This method is invoked from the constructor once initialization is complete and
1091        /// can be used for further object setup.
1092        /// </summary>
1093        partial void OnCreated();
1094        partial void OnGroupIdChanging(int value);
1095        partial void OnGroupIdChanged();
1096        partial void OnIdChanging(int value);
1097        partial void OnIdChanged();
1098        partial void OnUserIdChanging(int value);
1099        partial void OnUserIdChanged();
1100
1101        #endregion
1102        
1103        
1104        /// <summary>
1105        /// Initializes a new instance of the <see cref="Membership"/> class.
1106        /// </summary>
1107        public Membership()
1108        {
1109            this.OnCreated();
1110        }
1111        
1112        /// <summary>
1113        /// Gets or sets the associated <see cref="Group"/> entity.
1114        /// </summary>
1115        [Association("Group_Membership", "GroupId", "Id", IsForeignKey=true)]
1116        [XmlIgnore()]
1117        public Group Group
1118        {
1119            get
1120            {
1121                if ((this._group == null))
1122                {
1123                    this._group = new EntityRef<Group>(this, "Group", this.FilterGroup);
1124                }
1125                return this._group.Entity;
1126            }
1127            set
1128            {
1129                Group previous = this.Group;
1130                if ((previous != value))
1131                {
1132                    this.ValidateProperty("Group", value);
1133                    if ((previous != null))
1134                    {
1135                        this._group.Entity = null;
1136                        previous.Membership.Remove(this);
1137                    }
1138                    if ((value != null))
1139                    {
1140                        this.GroupId = value.Id;
1141                    }
1142                    else
1143                    {
1144                        this.GroupId = default(int);
1145                    }
1146                    this._group.Entity = value;
1147                    if ((value != null))
1148                    {
1149                        value.Membership.Add(this);
1150                    }
1151                    this.RaisePropertyChanged("Group");
1152                }
1153            }
1154        }
1155        
1156        /// <summary>
1157        /// Gets or sets the 'GroupId' value.
1158        /// </summary>
1159        [DataMember()]
1160        [RoundtripOriginal()]
1161        public int GroupId
1162        {
1163            get
1164            {
1165                return this._groupId;
1166            }
1167            set
1168            {
1169                if ((this._groupId != value))
1170                {
1171                    this.OnGroupIdChanging(value);
1172                    this.RaiseDataMemberChanging("GroupId");
1173                    this.ValidateProperty("GroupId", value);
1174                    this._groupId = value;
1175                    this.RaiseDataMemberChanged("GroupId");
1176                    this.OnGroupIdChanged();
1177                }
1178            }
1179        }
1180        
1181        /// <summary>
1182        /// Gets or sets the 'Id' value.
1183        /// </summary>
1184        [DataMember()]
1185        [Editable(false, AllowInitialValue=true)]
1186        [Key()]
1187        [RoundtripOriginal()]
1188        public int Id
1189        {
1190            get
1191            {
1192                return this._id;
1193            }
1194            set
1195            {
1196                if ((this._id != value))
1197                {
1198                    this.OnIdChanging(value);
1199                    this.ValidateProperty("Id", value);
1200                    this._id = value;
1201                    this.RaisePropertyChanged("Id");
1202                    this.OnIdChanged();
1203                }
1204            }
1205        }
1206        
1207        /// <summary>
1208        /// Gets or sets the associated <see cref="User"/> entity.
1209        /// </summary>
1210        [Association("User_Membership", "UserId", "Id", IsForeignKey=true)]
1211        [XmlIgnore()]
1212        public User User
1213        {
1214            get
1215            {
1216                if ((this._user == null))
1217                {
1218                    this._user = new EntityRef<User>(this, "User", this.FilterUser);
1219                }
1220                return this._user.Entity;
1221            }
1222            set
1223            {
1224                User previous = this.User;
1225                if ((previous != value))
1226                {
1227                    this.ValidateProperty("User", value);
1228                    if ((previous != null))
1229                    {
1230                        this._user.Entity = null;
1231                        previous.Membership.Remove(this);
1232                    }
1233                    if ((value != null))
1234                    {
1235                        this.UserId = value.Id;
1236                    }
1237                    else
1238                    {
1239                        this.UserId = default(int);
1240                    }
1241                    this._user.Entity = value;
1242                    if ((value != null))
1243                    {
1244                        value.Membership.Add(this);
1245                    }
1246                    this.RaisePropertyChanged("User");
1247                }
1248            }
1249        }
1250        
1251        /// <summary>
1252        /// Gets or sets the 'UserId' value.
1253        /// </summary>
1254        [DataMember()]
1255        [RoundtripOriginal()]
1256        public int UserId
1257        {
1258            get
1259            {
1260                return this._userId;
1261            }
1262            set
1263            {
1264                if ((this._userId != value))
1265                {
1266                    this.OnUserIdChanging(value);
1267                    this.RaiseDataMemberChanging("UserId");
1268                    this.ValidateProperty("UserId", value);
1269                    this._userId = value;
1270                    this.RaiseDataMemberChanged("UserId");
1271                    this.OnUserIdChanged();
1272                }
1273            }
1274        }
1275        
1276        private bool FilterGroup(Group entity)
1277        {
1278            return (entity.Id == this.GroupId);
1279        }
1280        
1281        private bool FilterUser(User entity)
1282        {
1283            return (entity.Id == this.UserId);
1284        }
1285        
1286        /// <summary>
1287        /// Computes a value from the key fields that uniquely identifies this entity instance.
1288        /// </summary>
1289        /// <returns>An object instance that uniquely identifies this entity instance.</returns>
1290        public override object GetIdentity()
1291        {
1292            return this._id;
1293        }
1294    }
1295    
1296    /// <summary>
1297    /// The 'Message' entity class.
1298    /// </summary>
1299    [DataContract(Namespace="http://schemas.datacontract.org/2004/07/glados.Web")]
1300    public sealed partial class Message : Entity
1301    {
1302        
1303        private int _id;
1304        
1305        private int _receiverId;
1306        
1307        private int _senderId;
1308        
1309        private DateTime _sentTime;
1310        
1311        private int _status;
1312        
1313        private string _subject;
1314        
1315        private string _text;
1316        
1317        #region Extensibility Method Definitions
1318
1319        /// <summary>
1320        /// This method is invoked from the constructor once initialization is complete and
1321        /// can be used for further object setup.
1322        /// </summary>
1323        partial void OnCreated();
1324        partial void OnIdChanging(int value);
1325        partial void OnIdChanged();
1326        partial void OnReceiverIdChanging(int value);
1327        partial void OnReceiverIdChanged();
1328        partial void OnSenderIdChanging(int value);
1329        partial void OnSenderIdChanged();
1330        partial void OnSentTimeChanging(DateTime value);
1331        partial void OnSentTimeChanged();
1332        partial void OnStatusChanging(int value);
1333        partial void OnStatusChanged();
1334        partial void OnSubjectChanging(string value);
1335        partial void OnSubjectChanged();
1336        partial void OnTextChanging(string value);
1337        partial void OnTextChanged();
1338
1339        #endregion
1340        
1341        
1342        /// <summary>
1343        /// Initializes a new instance of the <see cref="Message"/> class.
1344        /// </summary>
1345        public Message()
1346        {
1347            this.OnCreated();
1348        }
1349        
1350        /// <summary>
1351        /// Gets or sets the 'Id' value.
1352        /// </summary>
1353        // The following attributes were not generated:
1354        // 
1355        // - The attribute 'System.ComponentModel.DataAnnotations.DatabaseGeneratedAttribute' is not visible in the client project 'glados.UI'. Are you missing an assembly reference?
1356        // [DatabaseGeneratedAttribute(Identity)]
1357        // 
1358        [DataMember()]
1359        [Editable(false, AllowInitialValue=true)]
1360        [Key()]
1361        [RoundtripOriginal()]
1362        public int Id
1363        {
1364            get
1365            {
1366                return this._id;
1367            }
1368            set
1369            {
1370                if ((this._id != value))
1371                {
1372                    this.OnIdChanging(value);
1373                    this.ValidateProperty("Id", value);
1374                    this._id = value;
1375                    this.RaisePropertyChanged("Id");
1376                    this.OnIdChanged();
1377                }
1378            }
1379        }
1380        
1381        /// <summary>
1382        /// Gets or sets the 'ReceiverId' value.
1383        /// </summary>
1384        [DataMember()]
1385        [RoundtripOriginal()]
1386        public int ReceiverId
1387        {
1388            get
1389            {
1390                return this._receiverId;
1391            }
1392            set
1393            {
1394                if ((this._receiverId != value))
1395                {
1396                    this.OnReceiverIdChanging(value);
1397                    this.RaiseDataMemberChanging("ReceiverId");
1398                    this.ValidateProperty("ReceiverId", value);
1399                    this._receiverId = value;
1400                    this.RaiseDataMemberChanged("ReceiverId");
1401                    this.OnReceiverIdChanged();
1402                }
1403            }
1404        }
1405        
1406        /// <summary>
1407        /// Gets or sets the 'SenderId' value.
1408        /// </summary>
1409        [DataMember()]
1410        [RoundtripOriginal()]
1411        public int SenderId
1412        {
1413            get
1414            {
1415                return this._senderId;
1416            }
1417            set
1418            {
1419                if ((this._senderId != value))
1420                {
1421                    this.OnSenderIdChanging(value);
1422                    this.RaiseDataMemberChanging("SenderId");
1423                    this.ValidateProperty("SenderId", value);
1424                    this._senderId = value;
1425                    this.RaiseDataMemberChanged("SenderId");
1426                    this.OnSenderIdChanged();
1427                }
1428            }
1429        }
1430        
1431        /// <summary>
1432     

Large files files are truncated, but you can click here to view the full file