示例#1
0
 public MessageProfile()
 {
     CreateMap <Message, MessageViewModel>()
     .ForMember(dst => dst.From, opt => opt.MapFrom(x => x.FromUser.FullName))
     .ForMember(dst => dst.To, opt => opt.MapFrom(x => x.ToRoom.Name))
     .ForMember(dst => dst.Avatar, opt => opt.MapFrom(x => x.FromUser.Avatar))
     .ForMember(dst => dst.Content, opt => opt.MapFrom(x => BasicEmojis.ParseEmojis(x.Content)))
     .ForMember(dst => dst.Timestamp, opt => opt.MapFrom(x => x.Timestamp));
     CreateMap <MessageViewModel, Message>();
 }
示例#2
0
        public MessageProfile()
        {
            CreateMap <Message, MessageViewModel>()
            .ForMember(dst => dst.From, opt => opt.MapFrom(x => x.FromUser.DisplayName))
            .ForMember(dst => dst.To, opt => opt.MapFrom(x => x.ToRoom.Name))
            .ForMember(dst => dst.Avatar, opt => opt.MapFrom(x => x.FromUser.Avatar))
            .ForMember(dst => dst.Content, opt => opt.MapFrom(x => BasicEmojis.ParseEmojis(x.Content)))
            .ForMember(dst => dst.Timestamp, opt => opt.MapFrom(x => new DateTime(long.Parse(x.Timestamp)).ToLongTimeString()));

            CreateMap <MessageViewModel, Message>();
        }
示例#3
0
        public MessageProfile()
        {
            CreateMap <Message, MessageViewModel>()
            .ForMember(dst => dst.From, opt => opt.MapFrom(x => x.FromUser.UserName))
            .ForMember(dst => dst.To, opt => opt.MapFrom(x => x.ToRoom.Name))
            .ForMember(dst => dst.Avatar, opt => opt.MapFrom(x => "data:image/false;base64,iVBORw0KGgoAAAANSUhEUgAAADEAAAAwCAYAAAC4wJK5AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH4QMXDScUU2WCOgAADGRJREFUaN61mWlsXNd1x3/3LbO9mSE1FNehbFmbaW22ZFaw48hb7CiRFcNJ7CSunSiq0xgu3KJAG8NJk6IQUNSGgcBtuiRAG0lxnQKV4+SDU7mWpUZWHUnRYomUKC6iK1McieIs3GZ/y+2HGQ4XDYdDqj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ZhqJr/cfOcmurovvBXw+3YKIeZVd6PDUaKxWCFNRsZR4p/gFnaJh4WAJjFB5PLHmFah0bt0qZ9cLjfvBum6dmJpXfAx1W2kp/s4ZxCTdubcR9x912YudHX+zPB6vqapaqxSj3b9+jAjiRGGoqN09V9hjS/Di8tj2KNZnNEsm9wTvLA8SnQ0zcX+QUzT4ty5jrJcMh0J3S79zXBj6PHjvzsZ/ZuXvjX3TDXXF9eGCpJ7NDbcvWL5rW86Um62bPu2cs9mMhlW3b4W1RssNKSKYHzc4b0TJoxnaRI57lspkQgy2TzRkTH+dd9eRhMJRBm1UFUUxzA8uxpCNX999Njx8Y3rN/LTf5s7s+e99Xv2ycc5ffbM1d6+iw8HDO93hRDxGxYRgo/OdZQIS1fg/R4VFYmK5MQngoxZvLkQgmQqQ/fFiyizTkJAXtfUj5rqa9dd6Dq/z5YyD9BxvqOij/M2Lx1dPVO5Hxv+7ztWrXw7b1umQDQ7Ui6ZHHh0TWfrgw+jCEHWgr3HVSxnqrBrvYK2RgmKSu/FLg4e+DW6yzUJ01JTlfe8Xs/u3r6LLw5evRrTPUu4fPlSdeN+tTz/nRd24jWWcvz0yUt9fd1/7nHr99b4fU963PpBXdfo7+sp6QedEYXstEFNV+Bwr0BVQNU0Os5+hKbr6LoW9XndrwYM74b6UPBLXRfP/xzgMw9sxcyOVK9ZVPvga/+0j0wqNqUf+n3XO7s6f9Hb1/3ZP/jKNk8+Nf5Ucmx0j2NZ3R0RmbFt6YgS40tGUuR6h+y4nc/+10h06AfNS2vW9/f3NHT3dL3ceaHjwrJwQ6kTPHTk6IJawf8F+rdOGK5m1l8AAAAASUVORK5CYII="))
            .ForMember(dst => dst.Content, opt => opt.MapFrom(x => BasicEmojis.ParseEmojis(x.Content)))
            .ForMember(dst => dst.Timestamp, opt => opt.MapFrom(x => new DateTime(long.Parse(x.Timestamp)).ToLongTimeString()));

            CreateMap <MessageViewModel, Message>();
        }