PageRenderTime 23ms CodeModel.GetById 5ms app.highlight 7ms RepoModel.GetById 0ms app.codeStats 1ms

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

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

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