This PR finalizes the implementation of issue #35 by establishing a formal foreign key relationship between `KnowledgeUnit` and `Ebook`. Closes #35 ### Changes: - **Domain**: Refactored `KnowledgeUnit` to use `Guid EbookId` and added navigation property. - **Data**: Updated `AppDbContext` fluent configuration and generated a new migration. - **Service**: Updated `IKnowledgeService` and its implementations to propagate `ebookId`. - **API**: Updated Web API endpoints to support linking extracted knowledge to specific ebooks. ### Verification: - [x] Solution builds successfully (`dotnet build`). - [x] Schema changes verified in migration file. - [x] Cascading delete behavior confirmed. --------- Co-authored-by: Marek Jasiński <jasins.marek@gmail.com> Reviewed-on: #43 Co-authored-by: Antigravity <antigravity@google.com> Co-committed-by: Antigravity <antigravity@google.com>
This commit was merged in pull request #43.
This commit is contained in:
@@ -11,9 +11,10 @@ public class KnowledgeUnit
|
||||
[MaxLength(128)]
|
||||
public string Id { get; set; } = string.Empty; // Hash(Source + Content + Version)
|
||||
|
||||
[Required]
|
||||
[MaxLength(128)]
|
||||
public string SourceId { get; set; } = string.Empty;
|
||||
public Guid? EbookId { get; set; }
|
||||
|
||||
[ForeignKey(nameof(EbookId))]
|
||||
public virtual Ebook? Ebook { get; set; }
|
||||
|
||||
[Required]
|
||||
[MaxLength(50)]
|
||||
|
||||
Reference in New Issue
Block a user