Click here to Skip to main content
15,895,011 members
Articles / Web Development

Service Based Membership Providers for ASP.NET

Rate me:
Please Sign up or sign in to vote.
4.93/5 (45 votes)
4 May 2014CPOL29 min read 132.1K   8.2K   173  
Service based, multi-application ASP.NET custom membership, role and profile providers with a hierarchical role system.
//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool from CryptoGateway Software Inc.
//     Tool name: CGW X-Script RDB visual Layer Generator
//
//     Archymeta Information Technologies Co., Ltd.
//
//     Changes to this file, could be overwritten if the code is re-generated.
//     Add (if not yet) a code-manager node to the generator to specify 
//     how existing files are processed.
// </auto-generated>
//------------------------------------------------------------------------------

using System;
using System.Configuration;
using System.Collections.Generic;
using System.Reflection;
using System.Linq;
using System.Linq.Expressions;
using System.Threading;
using System.Runtime.Serialization;

namespace CryptoGateway.RDB.Data.AspNetMember
{
    /// <summary>
    /// A structure representing possible combination of foreign key constraint of the data set of "UsersInRoles".
    /// </summary>
    [DataContract]
    public class UsersInRoleSetConstraints
    {
        /// <summary>
        /// internal use.
        /// </summary>
        public string CacheKey
        {
            get 
            {
                if (_cacheKey == null) 
                    _cacheKey = (RoleIDWrap != null ? RoleIDWrap.CacheKey : "" ) + "_" + (UserIDWrap != null ? UserIDWrap.CacheKey : "" ) + "_"; 
                return _cacheKey;
            }
        }
        private string _cacheKey = null;

        /// <summary>
        /// The wrapper for the RoleID key value.
        /// </summary>
        [DataMember]
        public ForeignKeyData<int> RoleIDWrap
        {
            get;
            set;
        }
        /// <summary>
        /// The wrapper for the UserID key value.
        /// </summary>
        [DataMember]
        public ForeignKeyData<string> UserIDWrap
        {
            get;
            set;
        }
        /// <summary>
        /// The corresponding item count.
        /// </summary>
        [DataMember]
        public int ItemCount
        {
            get;
            set;
        }

        /// <summary>
        /// Is it the same as the input one
        /// </summary>
        /// <param name="constraints">The one to be compared with.</param>
        /// <returns></returns>
        public bool IsTheSameAs(UsersInRoleSetConstraints constraints)
        {
            return RoleIDWrap.KeyValue == constraints.RoleIDWrap.KeyValue && UserIDWrap.KeyValue == constraints.UserIDWrap.KeyValue;
        }
    }

    /// <summary>
    /// A structure representing a limited set of available constraints of "UsersInRoles".
    /// </summary>
    [DataContract]
    public class UsersInRoleSetConstraintsColl
    {
        /// <summary>
        /// Total number
        /// </summary>
        [DataMember]
        public Int64 AllCounts
        {
            get;
            set;
        }

        /// <summary>
        /// Next page id
        /// </summary>
        [DataMember]
        public string NextPageId
        {
            get;
            set;
        }

        /// <summary>
        /// A list of non-trivial constraints. 
        /// </summary>
        /// <remarks>If the total is tool large, it will be set to null so that the client will do active search.</remarks>
        [DataMember]
        public UsersInRoleSetConstraints[] AvailableOnes
        {
            get;
            set;
        }

    }

    /// <summary>
    /// A structure representing the data set of "UsersInRoles".
    /// </summary>
    [DataContract]
    public class UsersInRoleSet
    {
        /// <summary>
        /// The size of a page in the set.
        /// </summary>
        [DataMember]
        public int PageSize_
        {
            get { return _pageSize; }
            set { _pageSize = value; }
        }
        private int _pageSize = 15;

        /// <summary>
        /// The size of a page block in the set. A block of page frames are retrieved from the service at a time.
        /// </summary>
        [DataMember]
        public int PageBlockSize
        {
            get { return _pageBlockSize; }
            set { _pageBlockSize = value; }
        }
        private int _pageBlockSize = 10;

        /// <summary>
        /// The namespace. It is used internally.
        /// </summary>
        public string NameSpace
        {
            get;
            set;
        }

        /// <summary>
        /// The kind of the set.
        /// </summary>
        [DataMember]
        public string SetKindName
        {
            get;
            set;
        }

        /// <summary>
        /// The name of the set.
        /// </summary>
        [DataMember]
        public string Name
        {
            get;
            set;
        }

        /// <summary>
        /// The entity name of the set.
        /// </summary>
        [DataMember]
        public string EntityName
        {
            get;
            set;
        }

        /// <summary>
        /// Whether or not there is a backing data store at present.
        /// </summary>
        [DataMember]
        public bool DoesSetExist
        {
            get { return _doesSetExist; }
            set { _doesSetExist = value; }
        }
        private bool _doesSetExist = false;

        /// <summary>
        /// Whether or not the set has a sync-timestamp field
        /// </summary>
        [DataMember]
        public bool HasSyncTimeStampField
        {
            get { return _syncTimeStampFieldExist; }
            set { _syncTimeStampFieldExist = value; }
        }
        private bool _syncTimeStampFieldExist = false;

        /// <summary>
        /// The number of entities inside the set.
        /// </summary>
        [DataMember]
        public Int64 EntityCount
        {
            get { return _entityCount; }
            set { _entityCount = value; }
        }
        private Int64 _entityCount = 0;

        /// <summary>
        /// The filter expression for the set. If it is not empty or null, the set is a sub-set of corresponding data set inside the data source.
        /// </summary>
        [DataMember]
        public string SetFilter
        {
            get;
            set;
        }

        /// <summary>
        /// The sorter options for the set.
        /// </summary>
        [DataMember]
        public List<QToken> Sorters
        {
            get;
            set;
        }

        /// <summary>
        /// The loaded pages of the set.
        /// </summary>
        [DataMember]
        public List<UsersInRolePage> Pages
        {
            get { return _pages; }
            set { _pages = value; }
        }
        private List<UsersInRolePage> _pages;

        /// <summary>
        /// The displaying page block of the set.
        /// </summary>
        [DataMember]
        public List<UsersInRolePage> PagesWindow
        {
            get { return _pagesWindow; }
            set { _pagesWindow = value; }
        }
        private List<UsersInRolePage> _pagesWindow;

        /// <summary>
        /// A key that identifies the set in caches.
        /// </summary>
        public string CacheKey
        {
            get
            {
                return "" + PageSize_ + "." + PageBlockSize + "." + (SetFilter == null ? "" : SetFilter);
            }
        }

        public UsersInRoleSet()
        {
            NameSpace = "dbo";
            //Name = "UsersInRoles " + StringResources.Table;
            Name = "UsersInRoles " + "Table";
            EntityName = "UsersInRole";
            //... other init
            _pages = new List<UsersInRolePage>();
        }
    }

}

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
Founder CryptoGateway Software Inc.
Canada Canada


His interests in software research and development include security, domain specific meta-language development technologies and tools, meta-language driven code generation, generation of non-invasive and virtual SQL database for "un-structured" data (sqlization), automated relational data service production technologies, file system sqlization technologies and products, structured multi-lingual documentation tools and technologies, sqlization of user's personal data, like emails, etc..


He was a physicist before year 2000. He studied theoretical physics (the hidden symmetry between the past and future, quantum field theories, mirror universe, cosmological dark energies etc.) in which he think to had made fundamental breakthroughs[^] but the community is either not ready for it or is actively rejecting/ignoring it Smile | :) .



It struck me on Apr. 11, 2023 that the said theory above can even generate General Relativity naturally after a recent discussion in the Insider News group that triggers a rethinking of the subject on my side. The first stage of the work is completed in Sept. 2023, it is and will be continue to be published online

  • On Vacuum
  • Quantum and Gravity







    Most recent software system to share:



    • V-NET[^] - Full stack virtualization management system including networking, storage, virtual machines and containers, with an emphasis on networking ... to be released.

Comments and Discussions