Click here to Skip to main content
15,896,118 members
Articles / Web Development / IIS

Skeleton for a Silverlight business application based on Ria Services and the Ria Services Class Library

Rate me:
Please Sign up or sign in to vote.
4.50/5 (7 votes)
7 Nov 2009CPOL13 min read 82.5K   1.5K   75  
This article presents the techniques and caveats of building Silverlight business applications. It describes breaking down applications into tiers, implementing a data access in N-tier applications, implementing a custom authentication, adding a support of https to Ria Services applications.
//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//     Runtime Version:2.0.50727.3082
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

[assembly: global::System.Data.Objects.DataClasses.EdmSchemaAttribute()]

// Original file name:
// Generation date: 2009-11-07 12:36:28
namespace BASample.Data.Model
{
    
    /// <summary>
    /// There are no comments for BASamplesEntities in the schema.
    /// </summary>
    public partial class BASamplesEntities : global::System.Data.Objects.ObjectContext
    {
        /// <summary>
        /// Initializes a new BASamplesEntities object using the connection string found in the 'BASamplesEntities' section of the application configuration file.
        /// </summary>
        public BASamplesEntities() : 
                base("name=BASamplesEntities", "BASamplesEntities")
        {
            this.OnContextCreated();
        }
        /// <summary>
        /// Initialize a new BASamplesEntities object.
        /// </summary>
        public BASamplesEntities(string connectionString) : 
                base(connectionString, "BASamplesEntities")
        {
            this.OnContextCreated();
        }
        /// <summary>
        /// Initialize a new BASamplesEntities object.
        /// </summary>
        public BASamplesEntities(global::System.Data.EntityClient.EntityConnection connection) : 
                base(connection, "BASamplesEntities")
        {
            this.OnContextCreated();
        }
        partial void OnContextCreated();
        /// <summary>
        /// There are no comments for AppUser in the schema.
        /// </summary>
        public global::System.Data.Objects.ObjectQuery<AppUser> AppUser
        {
            get
            {
                if ((this._AppUser == null))
                {
                    this._AppUser = base.CreateQuery<AppUser>("[AppUser]");
                }
                return this._AppUser;
            }
        }
        private global::System.Data.Objects.ObjectQuery<AppUser> _AppUser;
        /// <summary>
        /// There are no comments for AppUser in the schema.
        /// </summary>
        public void AddToAppUser(AppUser appUser)
        {
            base.AddObject("AppUser", appUser);
        }
    }
    /// <summary>
    /// There are no comments for BASample.Data.Model.AppUser in the schema.
    /// </summary>
    /// <KeyProperties>
    /// Id
    /// </KeyProperties>
    [global::System.Data.Objects.DataClasses.EdmEntityTypeAttribute(NamespaceName="BASample.Data.Model", Name="AppUser")]
    [global::System.Runtime.Serialization.DataContractAttribute(IsReference=true)]
    [global::System.Serializable()]
    public partial class AppUser : global::System.Data.Objects.DataClasses.EntityObject
    {
        /// <summary>
        /// Create a new AppUser object.
        /// </summary>
        /// <param name="id">Initial value of Id.</param>
        /// <param name="name">Initial value of Name.</param>
        /// <param name="password">Initial value of Password.</param>
        public static AppUser CreateAppUser(int id, string name, string password)
        {
            AppUser appUser = new AppUser();
            appUser.Id = id;
            appUser.Name = name;
            appUser.Password = password;
            return appUser;
        }
        /// <summary>
        /// There are no comments for Property Id in the schema.
        /// </summary>
        [global::System.Data.Objects.DataClasses.EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [global::System.Runtime.Serialization.DataMemberAttribute()]
        public int Id
        {
            get
            {
                return this._Id;
            }
            set
            {
                this.OnIdChanging(value);
                this.ReportPropertyChanging("Id");
                this._Id = global::System.Data.Objects.DataClasses.StructuralObject.SetValidValue(value);
                this.ReportPropertyChanged("Id");
                this.OnIdChanged();
            }
        }
        private int _Id;
        partial void OnIdChanging(int value);
        partial void OnIdChanged();
        /// <summary>
        /// There are no comments for Property Name in the schema.
        /// </summary>
        [global::System.Data.Objects.DataClasses.EdmScalarPropertyAttribute(IsNullable=false)]
        [global::System.Runtime.Serialization.DataMemberAttribute()]
        public string Name
        {
            get
            {
                return this._Name;
            }
            set
            {
                this.OnNameChanging(value);
                this.ReportPropertyChanging("Name");
                this._Name = global::System.Data.Objects.DataClasses.StructuralObject.SetValidValue(value, false);
                this.ReportPropertyChanged("Name");
                this.OnNameChanged();
            }
        }
        private string _Name;
        partial void OnNameChanging(string value);
        partial void OnNameChanged();
        /// <summary>
        /// There are no comments for Property Password in the schema.
        /// </summary>
        [global::System.Data.Objects.DataClasses.EdmScalarPropertyAttribute(IsNullable=false)]
        [global::System.Runtime.Serialization.DataMemberAttribute()]
        public string Password
        {
            get
            {
                return this._Password;
            }
            set
            {
                this.OnPasswordChanging(value);
                this.ReportPropertyChanging("Password");
                this._Password = global::System.Data.Objects.DataClasses.StructuralObject.SetValidValue(value, false);
                this.ReportPropertyChanged("Password");
                this.OnPasswordChanged();
            }
        }
        private string _Password;
        partial void OnPasswordChanging(string value);
        partial void OnPasswordChanged();
        /// <summary>
        /// There are no comments for Property EMail in the schema.
        /// </summary>
        [global::System.Data.Objects.DataClasses.EdmScalarPropertyAttribute()]
        [global::System.Runtime.Serialization.DataMemberAttribute()]
        public string EMail
        {
            get
            {
                return this._EMail;
            }
            set
            {
                this.OnEMailChanging(value);
                this.ReportPropertyChanging("EMail");
                this._EMail = global::System.Data.Objects.DataClasses.StructuralObject.SetValidValue(value, true);
                this.ReportPropertyChanged("EMail");
                this.OnEMailChanged();
            }
        }
        private string _EMail;
        partial void OnEMailChanging(string value);
        partial void OnEMailChanged();
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Team Leader www.maxpaulousky.com
Belarus Belarus
Max currently is a senior developer at software company.

He lives with his wife Tatiana and son Zakhar (4 yrs) in Minsk, Belarus, but they dream to live in New Zealand.

Comments and Discussions