Dev2.Communication.FutureReceipt.ToKey C# (CSharp) Method

ToKey() public method

public ToKey ( ) : string
return string
        public string ToKey()
        {
            if(PartID < 0)
            {
                throw new Exception("Invalid PartID");
            }

            if(string.IsNullOrEmpty(User))
            {
                throw new Exception("Invalid User");
            }

            if(RequestID == Guid.Empty)
            {
                throw new Exception("Invalid RequestID");
            }

            return RequestID + "-" + PartID + "-" + User + "!";
        }
    }

Usage Example

        public void FutureReceipt_ToKey_WhenRequestIDNotSet_ExpectException()
        {
            //------------Setup for test--------------------------
            var futureReciept = new FutureReceipt { PartID = 1, User = "******" };

            //------------Execute Test---------------------------
            futureReciept.ToKey();
        }
All Usage Examples Of Dev2.Communication.FutureReceipt::ToKey
FutureReceipt