public class User {
public int Id {get;set;}
}
public class Phone {
public int Id{get;set}
public int UserId{get;set;} // foreign key
}
How can i update a User.Id
property with PetaPoco
? user.Update("set id = @NewId where id = @OldId",new { NewId = new_id,OldId = id});
Did not work .
外键的Sql ON UPDATE CASCADE
选项是最简单的解决方案!
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.