Class WorkPiece
- Namespace
- Loehnert.TypeAndResult
- Assembly
- Loehnert.TypeAndResult.dll
Type represents a work piece (test item).
[SuppressMessage("Design", "RCS1170", Justification = "Private setters are needed for entity framework")]
public class WorkPiece : EntityBase, INotifyPropertyChanged, ITrackable, ICanApplyID<WorkPiece>, IEquatable<WorkPiece>
- Inheritance
-
WorkPiece
- Implements
- Inherited Members
- Extension Methods
Constructors
WorkPiece(string)
Initializes a new instance of the WorkPiece class and sets the ItemIdentifier.
public WorkPiece(string itemIdentifier)
Parameters
itemIdentifierstringSerial number.
Exceptions
- ArgumentNullException
Thrown when
itemIdentifieris null or Empty.
Properties
Batch
Gets or sets the batch for the item. Can be null.
public Batch Batch { get; set; }
Property Value
BatchID
Gets the foreign key for Batch.
[JsonIgnore]
[IgnoreMember]
public int? BatchID { get; }
Property Value
- int?
ItemIdentifier
Gets the serial number.
public string ItemIdentifier { get; }
Property Value
MeasureCycles
Gets the measure cycles.
public virtual ObservableCollection<MeasureCycle> MeasureCycles { get; }
Property Value
Order
Gets or sets the batch for the item. Can be null.
public Order Order { get; set; }
Property Value
OrderID
Gets the foreign key for Order.
[JsonIgnore]
[IgnoreMember]
public int? OrderID { get; }
Property Value
- int?
Parameters
Gets the collection for additional parameters.
public virtual EntityCollection<WorkPieceParameter> Parameters { get; }
Property Value
Methods
ApplyID(WorkPiece)
Copies the ID from source and those Parameters
to this ID and its Parameters.
public void ApplyID(WorkPiece source)
Parameters
sourceWorkPieceSource object.
Exceptions
- InvalidOperationException
Thrown when this doesn't equals with
source.
Equals(WorkPiece)
Indicates whether the current object is equal to another object of the same type.
public bool Equals(WorkPiece other)
Parameters
otherWorkPieceAn object to compare with this object.
Returns
- bool
true if the current object is equal to the other parameter; otherwise, false.
ToString()
Returns a string that represents the current object.
public override string ToString()
Returns
- string
A string that represents the current object.