public static Node ToModel(NodeVM vm) { var node = Mapper.Map <Node>(vm); node.Entries = node.Entries.Where(n => !string.IsNullOrWhiteSpace(n.Key)).OrderBy(n => n.Key).ToList(); return(node); }
public static NodeVM FromModel(Node node = null) { NodeVM vm; if (node == null) { vm = new NodeVM(); } else { vm = Mapper.Map <NodeVM>(node); } if (vm.Entries == null) { vm.Entries = new List <EntryVM>(ENTRY_STEP); } return(vm); }