コード例 #1
0
        public static AomObjectViewModel MapDbModelToViewModel(AomObject dbModel)
        {
            var viewModel = new  AomObjectViewModel();

            viewModel.ID        = dbModel.ID;
            viewModel.AomMetaId = dbModel.AomMetaId;
            viewModel.Name      = dbModel.Name;
            return(viewModel);
        }
コード例 #2
0
        public static AomObject MapInsertModelToDbModel(AomObjectViewModel model, AomObject newDomainModel = null)
        {
            if (newDomainModel == null)
            {
                newDomainModel = new AomObject();
            }

            newDomainModel.ID        = model.ID;
            newDomainModel.AomMetaId = model.AomMetaId;
            newDomainModel.Name      = model.Name;

            return(newDomainModel);
        }