Пример #1
0
 public PersonalMessage Convert(Database.Entities.User.PersonalMessage source, PersonalMessage destination, ResolutionContext context)
 {
     return(new PersonalMessage
     {
         Id = source.Id,
         From = new PmUser
         {
             Id = source.FromUserId,
             Avatar = GetAvatar(source.FromUser),
             NickName = source.FromUser.NickNames.Current() ?? "anonymous"
         },
         To = new PmUser
         {
             Id = source.ToUserId,
             Avatar = GetAvatar(source.ToUser),
             NickName = source.ToUser.NickNames.Current() ?? "anonymous"
         },
         IsReadByToUser = source.IsReadByToUser,
         Message = source.Message,
         Since = source.Created.GetSinceStamp()
     });
 }
Пример #2
0
 public Database.Entities.User.PersonalMessage Convert(Models.User.CRUD.PersonalMessage source, Database.Entities.User.PersonalMessage destination, ResolutionContext context)
 {
     return(new Database.Entities.User.PersonalMessage
     {
         FromUserId = source.FromUserId,
         ToUserId = source.ToUserId,
         Message = source.Message,
         Created = DateTime.Now
     });
 }