DB level one to many relationship changed to one to one in DTO level

I’m implementing an order related project with C# code first method and the code goes like this.
There is a web system to make orders and there is other mechanism to received tracking status. (Order prepare, Order Dispatched, Order received to warehouse, delivered etc…)

Also orders can be made by phone calls and there are agents who prepare orders manually and quickly dispatch. In this scenario, it will add the order end of the day and tracking comes as expected.

Eg: Customer give a call and the store agent prepare it without adding information to the system. (But he is logging orders to a book, not to the system)
Then the courier service comes and scan tracking sticker (barcode sticker) and confirm the order is picked up. Same time it logged relevant info to our tacking table using courier service’s API. Likewise each and every point it has a tracking event. (if it comes to a warehouse, if it hand over to a linehaul, if it hand over to an air line shipping etc…)
At the end of the day there is computer operator and he enter all manual orders to the system.

public class Order //Here I mentioned only few relevant properties for making this question short.
{
 public int Id { get; set;}
 public Address CustomerAddress { get; set; }
 public string LabelNo { get; set;}

}

public class Tracking
{
 public int Id { get; set;}
 public int? OrderId { get; set; } //this is nullable since, it might received manual orders which enter to the system later.
 public Order Order{ get; set; }
 public string LabelNo { get; set;}
 public string Status { get; set;}
 public string Location { get; set;}
}

With a get API, I need to take last tracking object with the order.
Here are DTOs.

public class OrderDataDto
{
 public int Id { get; set;}
 public AddressDto CustomerAddress { get; set; }
 public string LabelNo { get; set;}
 public TrackingDto RecentTracking { get; set;}
}

public class TrackingDto
{
 public int Id { get; set;}
 public string Status { get; set;}
 public string Location { get; set;}
}

As you can see in this Dtos, there is a link between orderDto and tackingDto is one to one. (Actually this doesn’t work, I need to do simpler like this). But DB level entity has one to many relationship between Order and Tracking.

Here is the Get method.

public async Task<PagedResultDto<OrderDataDto>> GetOrders(InputDto input)
 {
     try
     {
         var query = await _orderManager.GetAllOrdersAsync();
         query = DtoFilter.FilterBy<Order, OrderDataDto>(query, input.Filter);//Filter means, it comes Odata from the query string.

         var totalCount = query.Count();

         List<Order> orders = query
         .OrderBy(input.Sorting)
         .Skip(input.SkipCount)
         .Take(input.MaxResultCount)
         .ToList();

         var orderDtoList = ObjectMapper.Map<List<Order>, List<OrderDataDto>>(orders);               
         return new PagedResultDto<OrderDataDto>(totalCount, orderDtoList);
     }
     catch (Exception ex)
     {
         throw new UserFriendlyException(ex.Message);
     }
 }

This is what I expect as a response at last,

{
    "result": {
        "totalcount": 22,
        "items": [
            {
                "id": "7894652",
                "customeraddress": {
                    "name": "john",
                    "phoneno": "0123456789",
                    "address": "45/B, Spenser building, Main street, Kalundali"
                },
                "labelno": "AE01254785",
                "recenttracking ": {
                    "id": 1548,
                    "status": "order dispatched",
                    "location": "Kalundali"
                }
            },
            {
               .....................
               .....................
               .....................
            }
        ]
    }
}

Also there is filter for query with OData.

Eg: If i need to get orders which having recent tracking status as “order dispatched”, then the query like below,

/api/orders/order/getorders?filter=recenttracking/status eq 'order dispatched'

The challenge is, DB level it has one to many relationship between Order and Tracking, while I need to get output as last tracking with OrderDto.

Any expert can advice me how to get a final output like above sample json with Odata filtration?

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật