, :
" ID = 53, , , , , , , , ?"
, " . - , , , , ( - , )" :
-, , , . , , , int, , Instrument . , Instrument internal private, factory, , Instrument , .
:
public class Instrument : IEquatable<Instrument>
{
public bool Equals(Instrument other)
{
return other != null && Id == other.Id;
}
public override bool Equals(object other)
{
return Equals(other as Instrument);
}
public override int GetHashCode()
{
return Id;
}
}
, , , , , , ID , , .
:
public InstrumentInfo GetInstrumentInfo(Instrument instrument)
{
return instrumentInfos[instrument];
}
:
public InstrumentInfo GetInstrumentInfo(Instrument instrument)
{
return instrumentInfos[instrument.Id];
}
:
public InstrumentInfo GetInstrumentInfo(Instrument instrument)
{
return GetInstrumentInfo(instrument.Id);
}
private InstrumentInfo GetInstrumentInfo(int instrumentID)
{
return instrumentInfos[instrumentID]
}
, , . , , , . , .
, - ( ) . , , , (, , , ), ; .
, .