本文整理汇总了C#中cloudscribe.Core.Models.SiteUser.LoadFromReader方法的典型用法代码示例。如果您正苦于以下问题:C# SiteUser.LoadFromReader方法的具体用法?C# SiteUser.LoadFromReader怎么用?C# SiteUser.LoadFromReader使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cloudscribe.Core.Models.SiteUser
的用法示例。
在下文中一共展示了SiteUser.LoadFromReader方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: FetchByConfirmationGuid
public async Task<ISiteUser> FetchByConfirmationGuid(int siteId, Guid confirmGuid)
{
using (DbDataReader reader = await dbSiteUser.GetUserByRegistrationGuid(siteId, confirmGuid))
{
if (reader.Read())
{
SiteUser user = new SiteUser();
user.LoadFromReader(reader);
if (user.SiteId == siteId) { return user; }
}
}
return null;
}
示例2: Fetch
public async Task<ISiteUser> Fetch(int siteId, string email)
{
using (DbDataReader reader = await dbSiteUser.GetSingleUser(siteId, email))
{
if (reader.Read())
{
SiteUser user = new SiteUser();
user.LoadFromReader(reader);
return user;
}
}
return null;
}
示例3: GetUsersForClaim
public async Task<IList<ISiteUser>> GetUsersForClaim(
int siteId,
string claimType,
string claimValue)
{
IList<ISiteUser> users = new List<ISiteUser>();
using (DbDataReader reader = await dbUserClaims.GetUsersByClaim(siteId, claimType, claimValue))
{
while (reader.Read())
{
SiteUser user = new SiteUser();
user.LoadFromReader(reader);
users.Add(user);
}
}
return users;
}
示例4: Fetch
public async Task<ISiteUser> Fetch(
int siteId,
string email,
CancellationToken cancellationToken = default(CancellationToken))
{
cancellationToken.ThrowIfCancellationRequested();
using (DbDataReader reader = await dbSiteUser.GetSingleUser(
siteId,
email,
cancellationToken))
{
if (reader.Read())
{
SiteUser user = new SiteUser();
user.LoadFromReader(reader);
return user;
}
}
return null;
}
示例5: FetchByLoginName
public async Task<ISiteUser> FetchByLoginName(
int siteId,
string userName,
bool allowEmailFallback,
CancellationToken cancellationToken = default(CancellationToken))
{
cancellationToken.ThrowIfCancellationRequested();
using (DbDataReader reader = await dbSiteUser.GetSingleUserByLoginName(
siteId,
userName,
allowEmailFallback,
cancellationToken))
{
if (reader.Read())
{
SiteUser user = new SiteUser();
user.LoadFromReader(reader);
return user;
}
}
return null;
}
示例6: GetUsersForClaim
public async Task<IList<ISiteUser>> GetUsersForClaim(
int siteId,
string claimType,
string claimValue,
CancellationToken cancellationToken = default(CancellationToken))
{
cancellationToken.ThrowIfCancellationRequested();
IList<ISiteUser> users = new List<ISiteUser>();
using (DbDataReader reader = await dbUserClaims.GetUsersByClaim(
siteId,
claimType,
claimValue,
cancellationToken))
{
while (reader.Read())
{
SiteUser user = new SiteUser();
user.LoadFromReader(reader);
users.Add(user);
}
}
return users;
}
示例7: FetchByConfirmationGuid
public async Task<ISiteUser> FetchByConfirmationGuid(int siteId, Guid confirmGuid)
{
if (multiTenantOptions.UseRelatedSitesMode) { siteId = multiTenantOptions.RelatedSiteId; }
using (DbDataReader reader = dbSiteUser.GetUserByRegistrationGuid(siteId, confirmGuid))
{
if (reader.Read())
{
SiteUser user = new SiteUser();
user.LoadFromReader(reader);
if (user.SiteId == siteId) { return user; }
}
}
return null;
}
示例8: FetchByLoginName
public async Task<ISiteUser> FetchByLoginName(int siteId, string userName, bool allowEmailFallback)
{
if (multiTenantOptions.UseRelatedSitesMode) { siteId = multiTenantOptions.RelatedSiteId; }
using (DbDataReader reader = await dbSiteUser.GetSingleUserByLoginName(siteId, userName, allowEmailFallback))
{
if (reader.Read())
{
SiteUser user = new SiteUser();
user.LoadFromReader(reader);
return user;
}
}
return null;
}
示例9: GetUsersInRole
public async Task<IList<ISiteUser>> GetUsersInRole(
int siteId,
string roleName,
CancellationToken cancellationToken = default(CancellationToken))
{
cancellationToken.ThrowIfCancellationRequested();
IList<ISiteUser> users = new List<ISiteUser>();
ISiteRole role = await FetchRole(siteId, roleName);
int roleId = -3;
if (role != null)
{
roleId = role.RoleId;
}
using (DbDataReader reader = await dbRoles.GetUsersInRole(
siteId,
roleId,
string.Empty,
1,
100000,
cancellationToken))
{
while (reader.Read())
{
SiteUser user = new SiteUser();
user.LoadFromReader(reader);
users.Add(user);
}
}
return users;
}
示例10: Fetch
public async Task<ISiteUser> Fetch(int siteId, string email)
{
if (multiTenantOptions.UseRelatedSitesMode) { siteId = multiTenantOptions.RelatedSiteId; }
using (DbDataReader reader = await dbSiteUser.GetSingleUser(siteId, email))
{
if (reader.Read())
{
SiteUser user = new SiteUser();
user.LoadFromReader(reader);
return user;
}
}
return null;
}
示例11: GetUsersForClaim
public async Task<IList<ISiteUser>> GetUsersForClaim(
int siteId,
string claimType,
string claimValue)
{
IList<ISiteUser> users = new List<ISiteUser>();
if (multiTenantOptions.UseRelatedSitesMode) { siteId = multiTenantOptions.RelatedSiteId; }
using (DbDataReader reader = await dbUserClaims.GetUsersByClaim(siteId, claimType, claimValue))
{
while (reader.Read())
{
SiteUser user = new SiteUser();
user.LoadFromReader(reader);
users.Add(user);
}
}
return users;
}
示例12: Fetch
public async Task<ISiteUser> Fetch(int siteId, Guid userGuid, CancellationToken cancellationToken = default(CancellationToken))
{
cancellationToken.ThrowIfCancellationRequested();
using (DbDataReader reader = dbSiteUser.GetSingleUser(userGuid))
{
if (reader.Read())
{
SiteUser user = new SiteUser();
user.LoadFromReader(reader);
if (user.SiteId == siteId) { return user; }
}
}
return null;
}
示例13: FetchByLoginName
public async Task<ISiteUser> FetchByLoginName(int siteId, string userName, bool allowEmailFallback)
{
using (DbDataReader reader = await dbSiteUser.GetSingleUserByLoginName(siteId, userName, allowEmailFallback))
{
if (reader.Read())
{
SiteUser user = new SiteUser();
user.LoadFromReader(reader);
return user;
}
}
return null;
}
示例14: FetchByConfirmationGuid
public async Task<ISiteUser> FetchByConfirmationGuid(
int siteId,
Guid confirmGuid,
CancellationToken cancellationToken = default(CancellationToken))
{
cancellationToken.ThrowIfCancellationRequested();
using (DbDataReader reader = await dbSiteUser.GetUserByRegistrationGuid(
siteId,
confirmGuid,
cancellationToken))
{
if (reader.Read())
{
SiteUser user = new SiteUser();
user.LoadFromReader(reader);
if (user.SiteId == siteId) { return user; }
}
}
return null;
}
示例15: GetUsersInRole
public async Task<IList<ISiteUser>> GetUsersInRole(
int siteId,
string roleName)
{
IList<ISiteUser> users = new List<ISiteUser>();
ISiteRole role = await FetchRole(siteId, roleName);
int roleId = -3;
if(role != null)
{
roleId = role.RoleId;
}
using (DbDataReader reader = await dbRoles.GetUsersInRole(siteId, roleId, string.Empty, 1, 100000))
{
while (reader.Read())
{
SiteUser user = new SiteUser();
user.LoadFromReader(reader);
users.Add(user);
}
}
return users;
}