Iago
Iago
CC#
Created by Iago on 5/21/2024 in #help
SqlException: The INSERT statement conflicted with the FOREIGN KEY
6 replies
CC#
Created by Iago on 5/21/2024 in #help
SqlException: The INSERT statement conflicted with the FOREIGN KEY
I'm using EF. I'm not sure, my model is like this
public class RegistrationFormModel
{
public int Id { get; set; }
public string Name { get; set; }
public DateTime DateTime { get; set; }
public string GeneralInformations { get; set; }
public int GenderId { get; set; }
public string BirthCertificateImageUrl { get; set; }

//Endereços
public string CEP { get; set; }
public string Street { get; set; }
public string Number { get; set; }
public string City { get; set; }
public string State { get; set; }

// Responsible Informations
public string ResponsibleName { get; set; }
public string PhoneNumber { get; set; }
public string Email { get; set; }

//Foreign Keys
public int StudyShift_id { get; set; }
public int Sport_id { get; set; }

//Navigation Properties
public GenderModel Gender { get; set; }
public StudyShiftModel StudyShift { get; set; }
public SportModel Sport { get; set; }

}
public class RegistrationFormModel
{
public int Id { get; set; }
public string Name { get; set; }
public DateTime DateTime { get; set; }
public string GeneralInformations { get; set; }
public int GenderId { get; set; }
public string BirthCertificateImageUrl { get; set; }

//Endereços
public string CEP { get; set; }
public string Street { get; set; }
public string Number { get; set; }
public string City { get; set; }
public string State { get; set; }

// Responsible Informations
public string ResponsibleName { get; set; }
public string PhoneNumber { get; set; }
public string Email { get; set; }

//Foreign Keys
public int StudyShift_id { get; set; }
public int Sport_id { get; set; }

//Navigation Properties
public GenderModel Gender { get; set; }
public StudyShiftModel StudyShift { get; set; }
public SportModel Sport { get; set; }

}
6 replies
CC#
Created by Iago on 5/1/2024 in #help
Middleware Error
true, I was importing from an asp.netcore class
4 replies
CC#
Created by Iago on 10/6/2022 in #help
name variables
I want to make a table that lists everything that is in the object, but to make the name, the number of columns would need to know this
4 replies