Пример #1
0
 public static async Task<ContentRecord> GetMemberIcon(string id)
 {
     UserAppMemberServiceProxy umsvc = new UserAppMemberServiceProxy();
     var um = await umsvc.LoadEntityByKeyAsync(Cntx, ApplicationContext.App.ID, id);
     if (um == null)
         return null;
     ContentRecord rec = new ContentRecord();
     rec.MimeType = um.IconMime;
     rec.LastModified = um.IconLastModified.HasValue ? um.IconLastModified.Value : DateTime.MaxValue;
     rec.Data = await umsvc.LoadEntityIconImgAsync(Cntx, ApplicationContext.App.ID, id);
     return rec;
 }
Пример #2
0
 public static async Task<ContentRecord> GetUserPhoto(string id)
 {
     UserDetailServiceProxy udsvc = new UserDetailServiceProxy();
     var ud = await udsvc.LoadEntityByKeyAsync(Cntx, ApplicationContext.App.ID, id);
     if (ud == null)
         return null;
     ContentRecord rec = new ContentRecord();
     rec.MimeType = ud.PhotoMime;
     if (ud.LastModified.HasValue)
         rec.LastModified = ud.LastModified.Value;
     rec.Data = udsvc.LoadEntityPhoto(Cntx, ApplicationContext.App.ID, id);
     return rec;
 }