Editor.NET - MJoin + LeftJoin data?
Editor.NET - MJoin + LeftJoin data?
washuit-iamm
Posts: 121Questions: 51Answers: 2
in Editor
I have fixed this bug in Editor.NET https://datatables.net/forums/discussion/78882/editor-net-mjoin-leftjoin#latest
But I have yet to PR it, as I cant seem to get the LeftJoin data.
For example:
public class InventoryServerModel
{
public class InventoryServer
{
public string? Name { get; set; }
}
}
public class Warranty
{
public string CertificateNumber { get; set; }
// !!!
// How to populate???
// !!!
public class InventoryServerWarrantyProvider
{
public string Name { get; set; }
}
}
var editor = new Editor(db, "InventoryServer", "Id")
.Model<InventoryServerModel>()
.Field(new Field("InventoryServer.Id").Set(false)) // Id is DB autogenerated
.MJoin(new MJoin("InventoryServerWarranty")
.Set(false)
.Link("InventoryServer.Id", "InventoryServerInventoryServerWarrantyLine.InventoryServerId")
.Link("InventoryServerWarranty.Id", "InventoryServerInventoryServerWarrantyLine.InventoryServerWarrantyId")
.Order("InventoryServerWarranty.CertificateNumber")
.Model<Warranty>()
.LeftJoin("InventoryServerWarrantyProvider", "InventoryServerWarrantyProvider.Id", "=", "InventoryServerWarranty.InventoryServerWarrantyProviderId")
)
Answers
This finally did it:
IE manually adding the fields
.Field(new Field("InventoryServerWarrantyProvider.Name"))
why did it not do that for me? Seems to work fine for the linked table, but not the LeftJoin.