public static FieldTypesViewModel MapDbModelToViewModel(FieldType dbModel) { var viewModel = new FieldTypesViewModel(); viewModel.ID = dbModel.ID; viewModel.Name = dbModel.Name; return(viewModel); }
public static FieldType MapInsertModelToDbModel(FieldTypesViewModel model, FieldType newDomainModel = null) { if (newDomainModel == null) { newDomainModel = new FieldType(); } newDomainModel.ID = model.ID; newDomainModel.Name = model.Name; return(newDomainModel); }
// PUT: api/FieldType/5 public Response <FieldTypesViewModel> Put(int id, FieldTypesViewModel model) { Response <FieldTypesViewModel> result = FieldTypeService.Insert(model, null); return(result); }