public static ToolsViewModel MapDbModelToViewModel(Tool dbModel) { var viewModel = new ToolsViewModel(); viewModel.Id = dbModel.Id; viewModel.Name = dbModel.Name; viewModel.Json = dbModel.Json; return(viewModel); }
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); }