Exemple #1
0
        public async Task <ISiteRole> FetchRole(int roleId)
        {
            using (DbDataReader reader = dbRoles.GetById(roleId))
            {
                if (reader.Read())
                {
                    SiteRole role = new SiteRole();
                    role.LoadFromReader(reader);
                    return(role);
                }
            }

            return(null);
        }
        public async Task <ISiteRole> FetchRole(int roleId, CancellationToken cancellationToken = default(CancellationToken))
        {
            cancellationToken.ThrowIfCancellationRequested();
            using (DbDataReader reader = dbRoles.GetById(roleId))
            {
                if (reader.Read())
                {
                    SiteRole role = new SiteRole();
                    role.LoadFromReader(reader);
                    return(role);
                }
            }

            return(null);
        }