Exemple #1
0
        public static AlertsViewModel MapDbModelToViewModel(Alert dbModel)
        {
            var viewModel = new  AlertsViewModel();

            viewModel.Id        = dbModel.Id;
            viewModel.Name      = dbModel.Name;
            viewModel.AlertJson = dbModel.AlertJson;
            return(viewModel);
        }
Exemple #2
0
        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);
        }