是否可以在单独的项目中迁移继承的类?例如:
var express = require('express');
var app = express();
var mongoose = require('mongoose');
var passport = require('passport');
var flash = require('connect-flash');
var morgan = require('morgan');
var cookieParser = require('cookie-parser');
var bodyParser = require('body-parser');
var session = require('express-session');
var config = require('./config/database');
var methodOverride = require('method-override')
mongoose.connect(config.database, function(err, db){
if(!err){
console.log('Conectado');
}
});
var server = require('http').Server(app);
var io = require('socket.io')(server);
var cors = require('cors');
require('./config/passport')(passport);
app.use(morgan('dev'));
app.use(cookieParser('secret'));
app.use(bodyParser.urlencoded({extended: true}));
app.use(bodyParser.json());
app.use(session({ secret: 'SecretSession', resave: false, saveUninitialized: true }));
app.use(passport.initialize());
app.use(passport.session());
app.use(methodOverride());
app.use(express.static(__dirname + '/public'))
app.use(cors());
require('./app/routes')(app, passport);
server.listen(3030, function(){
console.log('Rodando ');
});
使用TPH(存储在Services表中的所有记录),这是一个有效的模式/结构,是否可以使用EF Code First Migrations?如果是这样,我该怎么做呢?
我尝试将迁移添加到MyServiceProject,指向DBProject作为启动项目等,但它并没有将FieldSpecificToMyService作为模型的更改(除非我完全错误)。
我尝试将MyServiceProjectContext添加到MyServiceProject,该MyServiceProject继承自MyContext并添加迁移;没有接受改变。
我尝试过共享项目路线,但完全失败,可能是由于我缺乏了解。