in Education by
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)

1 Answer

0 votes
by
what do u mean one to one!!! i think your design is one to many. as Steve Py said in his comment ## The relationship between Order->Department and Order->Store is not One-to-One, it is Many-to-One. (Many orders could refer to the same Department) ## use virtual keyword for navigation properties. accroding to https://stackoverflow.com/a/41881299/18399373 you can use virtual keyword to load related data in lazy way use explicit loading and check it. Entity Framework supports three ways to load related data - eager loading, lazy loading and explicit loading

Related questions

0 votes
    Is there any way to add a custom parameter to identityserver auth request. I tried this way. but it ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 13, 2022 in Education by JackTerrance
0 votes
    How do I restrict records in a entity dataset to say five records. I have to list best sellers ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 18, 2022 in Education by JackTerrance
0 votes
    newbie question: how do i make my JSON output ignore null values? I don't want to necessarily set ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 7, 2022 in Education by JackTerrance
0 votes
    newbie question: how do i make my JSON output ignore null values? I don't want to necessarily set ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 7, 2022 in Education by JackTerrance
0 votes
    I have an AWS Lambda function built in .NET Core 2.1. Which is triggered by a SQS Queue. This ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 3, 2022 in Education by JackTerrance
0 votes
    I create a project with "dotnet new angular". When a breakpoint is set on a Typescript instruction, it ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 2, 2022 in Education by JackTerrance
0 votes
    i am using serilog in asp net core application and using a json formatter to create a daily log file ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 1, 2022 in Education by JackTerrance
0 votes
    I'm doing a simple dotnet restoreon my mac. I'm using the (for now) latest dotnet CLI version 2. ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 24, 2022 in Education by JackTerrance
0 votes
    I have an AWS Lambda function built in .NET Core 2.1. Which is triggered by a SQS Queue. This ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 22, 2022 in Education by JackTerrance
0 votes
    F# allows constraining generic types on the type's members, similar to: type ClassWithMemberConstraint = class end ... for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 4, 2022 in Education by JackTerrance
0 votes
    I'm new to React with Redux and I've been working on a new web application that has some basic ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 29, 2022 in Education by JackTerrance
0 votes
    I created a sample web application with ASP.NET Core to test the storage and retrieval of the cookie. ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 26, 2022 in Education by JackTerrance
0 votes
    I am developing a .NET core application with Identity login which provides a Bootstrap form In the /Identity ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 23, 2022 in Education by JackTerrance
0 votes
    I have an ASP.Net core 1.1 website and I want to embed Power BI reports into the site. Azure ... JsonConvert.DeserializeObject(result); Select the correct answer from above options...
asked Feb 8, 2022 in Education by JackTerrance
0 votes
    Which forms has a relation that possesses data about an individual entity? (a) 2NF (b) 3NF (c) ... Answers, Database Interview Questions and Answers for Freshers and Experience...
asked Oct 11, 2021 in Education by JackTerrance
...