Пример #1
0
        public static ToolsViewModel MapDbModelToViewModel(Tool dbModel)
        {
            var viewModel = new  ToolsViewModel();

            viewModel.Id   = dbModel.Id;
            viewModel.Name = dbModel.Name;
            viewModel.Json = dbModel.Json;
            return(viewModel);
        }
Пример #2
0
        public static Tool MapInsertModelToDbModel(ToolsViewModel model, Tool newDomainModel = null)
        {
            if (newDomainModel == null)
            {
                newDomainModel = new Tool();
            }

            newDomainModel.Id   = model.Id;
            newDomainModel.Name = model.Name;
            newDomainModel.Json = model.Json;

            return(newDomainModel);
        }