매우 오랫동안 문제가 있습니다. 이 예를 상상할 수 있습니다 : 나는 두 가지 모델을 만들었습니다Microsoft.EntityFrameworkCore.dll에서 'Microsoft.EntityFrameworkCore.DbUpdateException'유형의 예외가 발생했습니다.
public class Coordinate {
public int id {get;set;}
public int x {get;set;}
public int y {get;set;}
}
public class Planet {
public int id {get;set;}
public string name {get;set;}
public Coordinate coordinate {get;set;}
}
, 그리고 모델 행성이 모델은 속성으로 좌표했다. 이제 코드 어딘가에 하나의 좌표를 만들고 데이터베이스에 저장한다고 상상해보십시오. 이것이 상상 좌표 :
Coordinate c = new Coordinate();
c.x = 1;
c.y = 2;
가 그럼 난 내 데이터베이스에 추가하고이 저장됩니다.
하지만 행성을 만들고 내가 수행 할 때
An exception of type 'Microsoft.EntityFrameworkCore.DbUpdateException' occurred in Microsoft.EntityFrameworkCore.dll but was not handled in user code
Additional information: An error occurred while updating the entries. See the inner exception for details.
내가 속성을 변경할 수 있습니다 알고
planet.coordinate = c;
그리고 나는 데이터베이스에 추가하려고 나는 다음과 같은 오류가 public Coordinate coordinate
~ public int coordinate_id
이지만 대신 좌표 모델을 사용하여이 작업을 수행하고 싶습니다.
나는 당신에게 무슨 일이 잘못에 대한 상세한 설명을 줄 것이다 내부 예외를 살펴 갖는 ASP NET CORE 1.0
Cumps
(예를 들어, 단지 추가로하지만, 지구를 추가 관계 픽스 동일한 결과로 연결되어야 좌표) "세부 사항에 대한 내부 예외 참조." 그래서 그것은 무엇을 말하는가? – DavidG