public static GetProfileByUserName ( string userName ) : Carrotware.CMS.Core.UserProfile | ||
userName | string | |
Результат | Carrotware.CMS.Core.UserProfile |
public static UserProfile GetProfileByUserName(string userName)
{
using (CarrotCMSDataContext _db = CarrotCMSDataContext.Create()) {
return (from u in _db.membership_Users
join ud1 in _db.carrot_UserDatas on u.Id equals ud1.UserKey into ud2
from ud in ud2.DefaultIfEmpty()
where u.UserName == userName
select new UserProfile(u, ud)).FirstOrDefault();
}
}