Exploring the most efficient approach for POSTing relational data and evaluating the backend setup.
Is there a streamlined method to POST all data in one step? Or should I consider creating a service or pipe to link the initial table data and subsequently post related information to others? While this seems like my current best option, it might be an instance of overthinking.
Despite numerous attempts at posting, I am unable to populate the "related" database even with ICollection in EF Core (refer to code).
The backend model in .netcore 2.2 looks like this:
MainList {
public Guid JdbTdcMainListId { get; set; }
public string JTSubject { get; set; }
etc.
}
This main list aims to document all associated data linked to entries in referenced tables such as Cat & SubCat for categorization purposes, alongside reporting data and more.
Setting up the relationship with MainList in JTCats is done as follows:
JTCat {
public Guid JTCatId { get; set; }
etc.
}
Using a repository pattern and auto-generated controllers in VS Studio 2017.
Here is how the Angular model is configured:
import { JdbTdcMainList } from './jdbTdcMainList.model';
export interface JTCat {
jTCatId?: string;
etc.
}
Below is the angular template and component, seeking assistance with formatting validation:
<div class="container-fluid"><div class="row">
etc.
Additionally, here is the component where I struggle with validation and executing POST requests:
etc.
Uncertain about successfully executing the POST request, any insights on merging child data with the main form before proceeding would be greatly appreciated.
Referencing the interface being utilized:
export interface CreateRapport {
Data1: string;
etc.
}