AddOrUpdate是扩展方法,需要添加引用 using System.Data.Entity.Migrations; 转载于:https://www.cnblogs.com/techliang666/p/8350651.html