public static AomFieldMetaViewModel MapDbModelToViewModel(AomFieldMeta dbModel) { var viewModel = new AomFieldMetaViewModel(); viewModel.ID = dbModel.Id; viewModel.AomMetaId = dbModel.AomMetaId; viewModel.Name = dbModel.Name; viewModel.FieldTypeId = dbModel.FieldTypeId; return(viewModel); }
public static AomFieldMeta MapInsertModelToDbModel(AomFieldMetaViewModel model, AomFieldMeta newDomainModel = null) { if (newDomainModel == null) { newDomainModel = new AomFieldMeta(); } newDomainModel.Id = model.ID; newDomainModel.AomMetaId = model.AomMetaId; newDomainModel.Name = model.Name; newDomainModel.FieldTypeId = model.FieldTypeId; return(newDomainModel); }