具有 var children = grdDynamic.Children.ToList();
foreach (var child in children.Where(child => Grid.GetRow(child) == row)) {
grdDynamic.Children.Remove(child);
}
个关联的:
hasOne
和用户实例已经存在。我们如何添加新的const User = sequelize.define('user', {/* ... */})
const Project = sequelize.define('project', {/* ... */})
// One-way association
User.hasOne(Project)
并将其连接到Project
实例?
首先,我们需要找到User
:
User
接下来我们要做什么?如果const user = await models.users.findOne({
where: { id: 1 },
include: models.projects
});
是user.project
怎么办?
答案 0 :(得分:0)
这是什么?
Project.belongsTo(User)
http://docs.sequelizejs.com/class/lib/associations/belongs-to.js~BelongsTo.html