In my project, I have two entities first one is the Business entity(BE)
which is coming from a client (or) customer and another one is Data Entity(DE)
which is from the database.
GoodsReceipt.cs
public class GoodsReceipt
{
public Guid Id { get; set; }
public string PurchaseOrderId { get; set; }
public string Note { get; set; }
public virtual ICollection<GoodsReceiptProduct> GoodsReceiptProducts { get; set; }
}
GoodsReceiptProduct.cs
public class GoodsReceiptProduct
{
public Guid Id { get; set; }
public Guid GoodsReceiptId { get; set; }
public Guid PurchaseOrderId { get; set; }
public Guid ProductId { get; set; }
}
My requirement is to get whether a new item is added
or updated
or deleted
in the GoodsReceiptProducts
collection. And the PurchaseOrderId
in GoodsReceiptProduct is a unique one for all the object in the list.
The user will send the BE
GoodsReceipt
along with a collection of GoodsReceiptProduct
. So what are the possible ways to get that unique object from the list which may get added or updated or deleted on comparing that list with an existing DE
list on the server.