Beispiel #1
0
        public async Task <ISiteRole> FetchRole(int siteId, string roleName)
        {
            SiteRole role = null;

            using (DbDataReader reader = await dbRoles.GetByName(siteId, roleName))
            {
                if (reader.Read())
                {
                    role = new SiteRole();
                    role.LoadFromReader(reader);
                }
            }

            return(role);
        }
Beispiel #2
0
        public async Task <ISiteRole> FetchRole(int siteId, string roleName, CancellationToken cancellationToken = default(CancellationToken))
        {
            cancellationToken.ThrowIfCancellationRequested();
            SiteRole role = null;

            using (DbDataReader reader = await dbRoles.GetByName(siteId, roleName))
            {
                if (reader.Read())
                {
                    role = new SiteRole();
                    role.LoadFromReader(reader);
                }
            }

            return(role);
        }
Beispiel #3
0
        public async Task <ISiteRole> FetchRole(int siteId, string roleName)
        {
            if (multiTenantOptions.UseRelatedSitesMode)
            {
                siteId = multiTenantOptions.RelatedSiteId;
            }
            SiteRole role = null;

            using (DbDataReader reader = await dbRoles.GetByName(siteId, roleName))
            {
                if (reader.Read())
                {
                    role = new SiteRole();
                    role.LoadFromReader(reader);
                }
            }

            return(role);
        }