Exemplo n.º 1
0
        public static ContainerAlertsViewModel MapDbModelToViewModel(ContainerAlert dbModel)
        {
            var viewModel = new  ContainerAlertsViewModel();

            viewModel.Id          = dbModel.Id;
            viewModel.AlertId     = dbModel.AlertId;
            viewModel.ContainerId = dbModel.ContainerId;
            return(viewModel);
        }
Exemplo n.º 2
0
        public static ContainerAlert MapInsertModelToDbModel(ContainerAlertsViewModel model, ContainerAlert newDomainModel = null)
        {
            if (newDomainModel == null)
            {
                newDomainModel = new ContainerAlert();
            }

            newDomainModel.Id          = model.Id;
            newDomainModel.AlertId     = model.AlertId;
            newDomainModel.ContainerId = model.ContainerId;

            return(newDomainModel);
        }