当我调用构造函数时,程序会得到一个StackOverflowException。
public class User{
public User(string email, string pass){
this.email = email;
this.pass = pass;
}
public string email{
get => email;
set => email = email;
}
public string pass{
get => pass;
set => pass = pass;
}
}
由于StackOverflowException,进程正在终止。
答案 0 :(得分:2)
这将导致无限循环
window.onload = function() {
Dropzone.autoDiscover = false;
$('#myDropzone').dropzone({
url: "{% url 'dashboard/import' %}",
addRemoveLinks: true,
success: function (file, response) {
console.log("Successfully uploaded");
},
error: function (file, response) {
console.log("something goes wrong");
}
});
}
如何修复
this.email = email
具有属性
public class User{
public string e;
public string p;
public User(string email, string pass){
this.e= email;
this.p= pass;
}
}