|
|
client에서 할일
~/.ssh/id_rsa.pub 공개키 생성되면 접속할 서버에 ~/.ssh/authorized_keys 파일 안에 복사 해 넣는다. (ssh-copy-id user@server 를 쓰면 자동으로 복사된다.)
관리자 권한으로 /etc/sudoers.d/init-users 파일 생성하여 다음과 같이 작성
|
|
# User rules for id id ALL=(ALL) NOPASSWD:ALL |
ICollection 사용
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
|
public ICollection<Student> m_listLandSiteDataText { get; set; } protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.AddColumn<int>( name: "CourseId", table: "Students", nullable: true); migrationBuilder.CreateIndex( name: "IX_Students_CourseId", table: "Students", column: "CourseId"); migrationBuilder.AddForeignKey( name: "FK_Students_Courses_CourseId", table: "Students", column: "CourseId", principalTable: "Courses", principalColumn: "CourseId", onDelete: ReferentialAction.Restrict); } |
Index와 ForeignKey 없이 생성
|
|
[ForeignKey("Course")] public int CourseId { get; set; } // 또는 [ForeignKey("CourseId")] public int CourseId { get; set; } protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.AddColumn<int>( name: "CourseId", table: "Students", nullable: false, defaultValue: 0); } |
virtual 사용시
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
|
public int CourseId { get; set; } [ForeignKey("CourseId")] public virtual Course m_mvLandSiteDataImage { get; set; } protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.AddColumn<int>( name: "CourseId", table: "Students", nullable: false, defaultValue: 0); migrationBuilder.CreateIndex( name: "IX_Students_CourseId", table: "Students", column: "CourseId"); migrationBuilder.AddForeignKey( name: "FK_Students_Courses_CourseId", table: "Students", column: "CourseId", principalTable: "Courses", principalColumn: "CourseId", onDelete: ReferentialAction.Cascade); } |
|
링크
|