コード例 #1
0
        public void ApplayModel(Item item, ItemEditModel model)
        {
            if (model == null)
            {
                return;
            }

            item.Name     = model.Name;
            item.Category = model.Category;
            item.Code     = model.Code;
        }
コード例 #2
0
        public ItemEditModel ToModel(Item item)
        {
            if (item == null)
            {
                return(new ItemEditModel());
            }

            ItemEditModel model = new ItemEditModel();

            model.Id       = item.Id;
            model.Name     = item.Name;
            model.Category = item.Category;
            model.Code     = item.Code;
            return(model);
        }