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

            viewModel.MigrationId    = dbModel.MigrationId;
            viewModel.ContextKey     = dbModel.ContextKey;
            viewModel.Model          = dbModel.Model;
            viewModel.ProductVersion = dbModel.ProductVersion;
            return(viewModel);
        }
コード例 #2
0
        public static MigrationHistory MapInsertModelToDbModel(MigrationHistoryViewModel model, MigrationHistory newDomainModel = null)
        {
            if (newDomainModel == null)
            {
                newDomainModel = new MigrationHistory();
            }

            newDomainModel.MigrationId    = model.MigrationId;
            newDomainModel.ContextKey     = model.ContextKey;
            newDomainModel.Model          = model.Model;
            newDomainModel.ProductVersion = model.ProductVersion;

            return(newDomainModel);
        }