public override int GetHashCode() { const int prime = 37; var result = 17; result = result * prime + Epc.GetHashCode(); result = result * prime + Antenna.GetHashCode(); result = result * prime + ChannalIndex.GetHashCode(); return(result); }
internal static EpcDto Create(Epc epc, short eventId, int requestId) { return(new EpcDto { EventId = eventId, RequestId = requestId, Id = epc.Id, Type = epc.Type.Id, IsQuantity = epc.IsQuantity, Quantity = epc.Quantity, UnitOfMeasure = epc.UnitOfMeasure }); }
private object FormatQuantity(Epc epc) { var dictionary = new Dictionary <string, object> { { "epcClass", epc.Id }, { "quantity", epc.Quantity } }; if (!string.IsNullOrEmpty(epc.UnitOfMeasure)) { dictionary.Add("uom", epc.UnitOfMeasure); } return(dictionary); }
public static EpcisEvent ParseQuantityEvent(XElement eventRoot) { var epcisEvent = ParseBase(eventRoot, EventType.Quantity); var epcQuantity = new Epc { Id = eventRoot.Element("epcClass").Value, Quantity = float.Parse(eventRoot.Element("quantity").Value, NumberStyles.AllowDecimalPoint, new CultureInfo("en-GB")), IsQuantity = true, Type = EpcType.Quantity }; epcisEvent.Epcs.Add(epcQuantity); ParseExtension(eventRoot.Element("extension"), epcisEvent, FieldType.Extension); return(epcisEvent); }