17 votes

uMembership

uMembership - Alternative Umbraco Member Api

uMembership is an alternative and faster way of dealing with Members in Umbraco when you have 1000's or even 10000's of members each with loads of properties. It works directly against the database instead of using the API.

Opensource

This project is on Codeplex if you need the source code.

http://umembership.codeplex.com

Notes

Please note this has only been tested with Umbraco 4.7+ and SQL Express. I have no idea if it works with SQLCE.

Installing

Just unzip and copy the uMember.dll into your Umbraco bin folder

Using uMembership

The 'uMember' class shown below and is what the methods return and you work with, what I like about this whole new solution is that it will automatically pick up new properties as you add them.

public class uMember
{
    public int MemberId { get; set; }
    public string MemberLoginName { get; set; }
    public string MemberEmail { get; set; }
    public string MemberCreateDateTime { get; set; }
    public Dictionary<string, string> MemberProperties { get; set; }
}

Methods Included

The methods you can currently use to get members are the following

uMember GetMemberById(int memberId)
uMember GetCurrentMember()
uMember GetMemberByEmail(string email)
uMember GetMemberByLogin(string loginName)
IEnumerable<uMember> SearchMembersByDateCreated(DateTime dateFrom, DateTime dateTo)
IEnumerable<uMember> SearchMembersByPropertyValue(string propertyName, string search)
IEnumerable<uMember> SearchMembersByLogin(string search)
IEnumerable<uMember> GetMembersByCSV(string csv)
IEnumerable<uMember> GetAllMembers()
IEnumerable<uMember> GetMembersByGroup(string groupName) 

Some Example Usages

Getting All Members From Specific Member Group

var sb = new StringBuilder();
var db = new uMembership();
var members = db.GetMembersByGroup("MyMemberGroupName");
foreach (var mem in members)
{
    sb.AppendFormat("<p>{0}<p>", mem.MemberLoginName);
    sb.AppendFormat("<p>{0}<p>", mem.MemberProperties["PropertyNameHere"]);
} 

Get All Members By A Property Value

var sb = new StringBuilder();
var db = new uMembership();
var members = db.SearchMembersByPropertyValue("MyPropertyName", "ValueToSearchFor");
foreach (var mem in members)
{
    sb.AppendFormat("<p>{0}<p>", mem.MemberLoginName);
    sb.AppendFormat("<p>{0}<p>", mem.MemberProperties["PropertyNameHere"]);
}

Get Members By CSV

var sb = new StringBuilder();
var db = new uMembership();
var csv = "13210,2712,10502,8381,14927";
var members = db.GetMembersByCSV(csv);
foreach (var mem in members)
{
    sb.AppendFormat("<p>{0}<p>", mem.MemberLoginName);
    sb.AppendFormat("<p>{0}<p>", mem.MemberProperties["PropertyNameHere"]);
}

 

Screenshots

Project owner

Lee

Lee

Lee has 3032 karma points

Project Compatibility

This project is compatible with the following versions as reported by community members who have downloaded this package:
Untested or doesn't work on Umbraco Cloud
7.12.x (untested)
7.11.x (untested)
7.10.x (untested)
7.9.x (untested)
7.8.x (untested)
7.7.x (untested)
7.6.x (untested)
7.5.x (untested)
7.4.x (untested)
7.3.x (untested)
7.2.x (untested)
7.1.x (untested)
7.0.x (untested)
6.1.x (untested)
6.0.x (untested)

You must login before you can report on package compatibility.

Project Information

  • Project owner: Lee
  • Contributors: Jeroen Breuer
  • Created: 09/03/2013
  • Current version 1.3
  • License MIT
  • Downloads: 1020

External resources