public static JsonInvoiceItemDTO ToDTO(this JsonInvoiceItem jsonInvoiceItem) { return(new JsonInvoiceItemDTO { ID = jsonInvoiceItem.ID, InvoiceItemID = jsonInvoiceItem.InvoiceItemID, JsonString = jsonInvoiceItem.JsonString }); }
public static JsonInvoiceItem ToDomain(this JsonInvoiceItemDTO jsonInvoiceItem, JsonInvoiceItem originalJsonInvoiceItem = null) { if (originalJsonInvoiceItem != null && originalJsonInvoiceItem.ID == jsonInvoiceItem.ID) { originalJsonInvoiceItem.InvoiceItemID = jsonInvoiceItem.InvoiceItemID; originalJsonInvoiceItem.JsonString = jsonInvoiceItem.JsonString; return(originalJsonInvoiceItem); } return(new JsonInvoiceItem() { ID = jsonInvoiceItem.ID, InvoiceItemID = jsonInvoiceItem.InvoiceItemID, JsonString = jsonInvoiceItem.JsonString }); }