예제 #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);
        }
예제 #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);
        }