//public static IInvoice MockSavedWithId(this IInvoice entity, Guid key) //{ // entity.Key = key; // ((Entity)entity).AddingEntity(); // entity.ResetDirtyProperties(); // return entity; //} public static IInvoiceLineItem MockSavedWithKey(this IInvoiceLineItem entity, Guid key) { entity.Key = key; ((Entity)entity).AddingEntity(); entity.ResetDirtyProperties(); return(entity); }
/// <summary> /// The build dto. /// </summary> /// <param name="entity"> /// The entity. /// </param> /// <returns> /// The <see cref="InvoiceItemDto"/>. /// </returns> public InvoiceItemDto BuildDto(IInvoiceLineItem entity) { var dto = new InvoiceItemDto() { Key = entity.Key, ContainerKey = entity.ContainerKey, LineItemTfKey = entity.LineItemTfKey, Sku = entity.Sku, Name = entity.Name, Quantity = entity.Quantity, Price = entity.Price, ExtendedData = entity.ExtendedData.SerializeToXml(), Exported = entity.Exported, UpdateDate = entity.UpdateDate, CreateDate = entity.CreateDate }; return(dto); }
public InvoiceItemDto BuildDto(IInvoiceLineItem entity) { var dto = new InvoiceItemDto() { Key = entity.Key, ContainerKey = entity.ContainerKey, LineItemTfKey = entity.LineItemTfKey, Sku = entity.Sku, Name = entity.Name, Quantity = entity.Quantity, Price = entity.Price, ExtendedData = entity.ExtendedData.SerializeToXml(), Exported = entity.Exported, UpdateDate = entity.UpdateDate, CreateDate = entity.CreateDate }; return dto; }
private bool Equals(IInvoiceLineItem other) { return(Product == other.Product && Description == other.Description && Quantity.Equals(other.Quantity) && Rate.Equals(other.Rate) && TaxPercentage.Equals(other.TaxPercentage) && DiscountPercentage.Equals(other.DiscountPercentage) && Total.Equals(other.Total) && Subtotal.Equals(other.Subtotal) && Tax.Equals(other.Tax) && LineIdx == other.LineIdx); }