Department and store model. They are a one to one relationship. when I do the (Include) only some models it brings me the complete data. The data is correctly in the database
var orders = await _context.Order.Include(o => o.Departament)
.Include(o => o.Store).ToArrayAsync();
Model Order
public class Order
{ [Key]
public string Order_Id { get; set; }
[DataType(DataType.Date)]
public DateTime Date { get; set; }
public string Number_Order { get; set; }
public int Qty { get; set; }
[DataType(DataType.DateTime)]
public DateTime Imported { get; set; }
[DataType(DataType.DateTime)]
public DateTime Modified { get; set; }
[DataType(DataType.DateTime)]
public DateTime Exported { get; set; }
public bool IsActive { get; set; }
[ForeignKey("Departament")]
public string DepartmentId { get; set; }
[ForeignKey("Store")]
public string StoreId { get; set; }
public virtual ICollection OrderDetails { get; set; }
public Departament Departament { get; set; }
public Store Store { get; set; }
}
.
I just need to solve that problem of getting the data correctly.
JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)