public static ActivityViewModel InitializeWith(Action activity) { var model = new ActivityViewModel(); var act = activity as CommentCardAction; if (act != null) { model = new CommentActivityViewModel { Text = act.Data.Text, LastEditedDate = act.Data.DateLastEdited, TargetName = act.Data.Card.Name }; } model.Id = activity.Id; model.Member = new MemberViewModel(activity.MemberCreator); model.Timestamp = activity.Date.ToLocalTime(); return model; }
public static ActivityViewModel InitializeWith(Action activity) { var model = new ActivityViewModel(); var act = activity as CommentCardAction; if (act != null) { model = new CommentActivityViewModel { Text = act.Data.Text, LastEditedDate = act.Data.DateLastEdited, TargetName = act.Data.Card.Name }; } model.Id = activity.Id; model.Member = new MemberViewModel(activity.MemberCreator); model.Timestamp = activity.Date.ToLocalTime(); return(model); }