public static AlertsViewModel MapDbModelToViewModel(Alert dbModel) { var viewModel = new AlertsViewModel(); viewModel.Id = dbModel.Id; viewModel.Name = dbModel.Name; viewModel.AlertJson = dbModel.AlertJson; return(viewModel); }
public static Alert MapInsertModelToDbModel(AlertsViewModel model, Alert newDomainModel = null) { if (newDomainModel == null) { newDomainModel = new Alert(); } newDomainModel.Id = model.Id; newDomainModel.Name = model.Name; newDomainModel.AlertJson = model.AlertJson; return(newDomainModel); }