I’m implementing a project using asp.net core and I'm new in this field. Employing DB first approach and creating models in Visual studio, in SQl server I have two tables called API and Applicant that have many to many relationship and there is also their junction table called ApiApplicant. Suppose these 3 tables has the following fields each:
Api: ID, name, date, isDeleted.
Applicant:Id,name,type
ApiAppliant:Id,ApiID,ApplicantId,ApiRequestDate,gateId, isDeleted
My ApiApplicant table also has many to one relationship with another table called Gate.
Gate table has the following fields:Id, name.
Now I want to know how can I update ApiApplicant table in my code I appreciate if anyone solve the above problem by showing me a sample relevant linq code.
What I have tried:
public partial class Apiapplicant
{
public int Id { get; set; }
public string ApiRequestDate { get; set; }
public int? ApiRequestNo { get; set; }
public int? Apiid { get; set; }
public int? ApplicantId { get; set; }
public int? GateId { get; set; }
public bool? IsDeleted { get; set; }
}
public virtual Api Api { get; set; }
public virtual Applicant Applicant { get; set; }
public virtual Gate Gate { get; set; }