本文整理汇总了C#中umbraco.cms.businesslogic.member.Member.PopulateMemberFromReader方法的典型用法代码示例。如果您正苦于以下问题:C# Member.PopulateMemberFromReader方法的具体用法?C# Member.PopulateMemberFromReader怎么用?C# Member.PopulateMemberFromReader使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类umbraco.cms.businesslogic.member.Member
的用法示例。
在下文中一共展示了Member.PopulateMemberFromReader方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetMemberByName
public static Member[] GetMemberByName(string usernameToMatch, bool matchByNameInsteadOfLogin)
{
string field = matchByNameInsteadOfLogin ? "umbracoNode.text" : "cmsMember.loginName";
var tmp = new List<Member>();
using (IRecordsReader dr = SqlHelper.ExecuteReader(
string.Format(m_SQLOptimizedMany.Trim(),
string.Format("{0} like @letter", field),
"umbracoNode.text"),
SqlHelper.CreateParameter("@nodeObjectType", Member._objectType),
SqlHelper.CreateParameter("@letter", usernameToMatch + "%")))
{
while (dr.Read())
{
Member m = new Member(dr.GetInt("id"), true);
m.PopulateMemberFromReader(dr);
tmp.Add(m);
}
}
return tmp.ToArray();
}
示例2: GetAllAsList
public static IEnumerable<Member> GetAllAsList()
{
var tmp = new List<Member>();
using (IRecordsReader dr = SqlHelper.ExecuteReader(
string.Format(m_SQLOptimizedMany.Trim(), "1=1", "umbracoNode.text"),
SqlHelper.CreateParameter("@nodeObjectType", Member._objectType)))
{
while (dr.Read())
{
Member m = new Member(dr.GetInt("id"), true);
m.PopulateMemberFromReader(dr);
tmp.Add(m);
}
}
return tmp.ToArray();
}
示例3: getAllOtherMembers
/// <summary>
/// Retrieves a list of members thats not start with a-z
/// </summary>
/// <returns>array of members</returns>
public static Member[] getAllOtherMembers()
{
var tmp = new List<Member>();
using (IRecordsReader dr = SqlHelper.ExecuteReader(
string.Format(m_SQLOptimizedMany.Trim(), "LOWER(SUBSTRING(text, 1, 1)) NOT IN ('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z')", "umbracoNode.text"),
SqlHelper.CreateParameter("@nodeObjectType", Member._objectType)))
{
while (dr.Read())
{
Member m = new Member(dr.GetInt("id"), true);
m.PopulateMemberFromReader(dr);
tmp.Add(m);
}
}
return tmp.ToArray();
}
示例4: GetMembersFromEmail
/// <summary>
/// Retrieve Members given an email
///
/// Used when authentifying a Member
/// </summary>
/// <param name="email">The email of the member(s)</param>
/// <returns>The members with the specified email</returns>
public static Member[] GetMembersFromEmail(string email)
{
if (string.IsNullOrEmpty(email))
return null;
var tmp = new List<Member>();
using (var dr = SqlHelper.ExecuteReader(string.Format(_sQLOptimizedMany.Trim(),
"Email = @email",
"umbracoNode.text"),
SqlHelper.CreateParameter("@nodeObjectType", Member._objectType),
SqlHelper.CreateParameter("@email", email.ToLower())))
{
while (dr.Read())
{
var m = new Member(dr.GetInt("id"), true);
m.PopulateMemberFromReader(dr);
tmp.Add(m);
}
}
return tmp.ToArray();
}