public static void Initialize(PLFAppDbContext context) { context.Database.EnsureCreated(); if (!context.Member.Any()) { var member = new Member() { MobilePhone = "13212345678", Password = "******", NickName = "张三", HeadImageUrl = "" }; context.Member.Add(member); context.SaveChanges(); } }
public int SaveChanges() { return(context.SaveChanges()); }