PageRenderTime 20ms CodeModel.GetById 3ms app.highlight 9ms RepoModel.GetById 1ms app.codeStats 1ms

/glados_proto/glados_proto/Generated_Code/glados.Web.g.cs-82f061dc

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

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