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

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

            return(null);
        }