public static DbStead Get(this Stead s)
{
if (s.Number?.Length > 120)
#pragma warning disable 642
; // ловим превышение длины
#pragma warning restore 642
return new DbStead
{
STEADID = s.STEADID,
IFNSUL = s.IFNSUL.ToNullInt(),
OKATO = s.OKATO.ToNullLong(),
RegionCode = s.RegionCode,
PostalCode = s.PostalCode.ToNullInt(),
NORMDOC = s.NORMDOC.ToNullGuid(),
OKTMO = s.OKTMO.ToNullLong(),
TERRIFNSUL = s.TERRIFNSUL.ToNullInt(),
IFNSFL = s.IFNSFL.ToNullInt(),
TERRIFNSFL = s.TERRIFNSFL.ToNullInt(),
STEADGUID = s.STEADGUID,
CADNUM = s.CADNUM,
DIVTYPE = s.DIVTYPE,
ENDDATE = s.ENDDATE,
LIVESTATUS = s.LIVESTATUS,
NEXTID = s.NEXTID.ToNullGuid(),
Number = s.Number,
OPERSTATUS = s.OPERSTATUS,
PARENTGUID = s.PARENTGUID.ToNullGuid(),
PREVID = s.PREVID.ToNullGuid(),
STARTDATE = s.STARTDATE,
UPDATEDATE = s.UPDATEDATE
};
}
/// <summary>Служит хэш-функцией по умолчанию.</summary>
/// <returns>Хэш-код для текущего объекта.</returns>
[__DynamicallyInvokable]
public virtual int GetHashCode()
{
return RuntimeHelpers.GetHashCode(this);
}
FCIMPL1(INT32, ObjectNative::GetHashCode, Object* obj) {
CONTRACTL
{
THROWS;
DISABLED(GC_NOTRIGGER);
INJECT_FAULT(FCThrow(kOutOfMemoryException););
MODE_COOPERATIVE;
SO_TOLERANT;
}
CONTRACTL_END;
VALIDATEOBJECTREF(obj);
DWORD idx = 0;
if (obj == 0)
return 0;
OBJECTREF objRef(obj);
HELPER_METHOD_FRAME_BEGIN_RET_1(objRef); // Set up a frame
idx = GetHashCodeEx(OBJECTREFToObject(objRef));
HELPER_METHOD_FRAME_END();
return idx;
}
FCIMPLEND
see Knuth Vol 2 p16 (3.2.1.2 Theorem A)