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); }
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); }