public static async Task<MessageDetailViewModel> ToViewModelAsync(this IMessage model)
        {
            if (model == null) return null;

            var viewModel = new MessageDetailViewModel();
            await model.ExtrudeDetailInfo(viewModel);
            return viewModel;
        }
 public async Task<ActionResult> Update(MessageDetailViewModel model)
 {
     return await ProcessResult(() => MessagesLibrary.UpdateMessage(model));
 }
 private static async Task ExtrudeDetailInfo(this IMessage model, MessageDetailViewModel viewModel)
 {
     viewModel.Id = model.Id;
     viewModel.Content = model.Content;
 }
Exemple #4
0
 public static async Task<MessageDetailViewModel> UpdateMessage(MessageDetailViewModel model)
 {
     return await (await Messages.UpdateAsync(model.Id, model.Content)).ToViewModelAsync();
 }