Esempio n. 1
0
        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="objectId">The persistent object unique id.</param>
        protected PersistentObject(Id objectId)
        {
            if(!objectId.IsValid)
                throw new ArgumentException("The persistent object unique id passed as an argument is not valid.", "objectId");

            Id = objectId;
        }
Esempio n. 2
0
        public ObjectNotFoundException(Type objectType, Id objectId, string message = null)
            : base(message ?? @"Persistent object of type: '{0}' with Id: '{1}' is not found in the database."
			.Form(objectType.Name, objectId))
        {
            ExpectedType = objectType;
            ObjectId = objectId;
        }
Esempio n. 3
0
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="accountId">The account unique id.</param>
 internal Account(Id accountId)
     : base(accountId)
 {
 }
Esempio n. 4
0
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="addressId">Address unique id.</param>
 internal USPostalAddress(Id addressId)
     : base(addressId)
 {
 }
Esempio n. 5
0
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="addressId">Address unique id.</param>
 internal ForeignPostalAddress(Id addressId)
     : base(addressId)
 {
 }
Esempio n. 6
0
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="addressId">Address unique id.</param>
 protected PostalAddress(Id addressId)
     : base(addressId)
 {
 }
Esempio n. 7
0
 public void TestForeignPostalAddress_IdArg()
 {
     var addressId = new Id(123456789);
     var address = new ForeignPostalAddress(addressId);
     Assert.AreEqual(addressId, address.Id);
     Assert.IsFalse(address.IsNew);
     Assert.IsTrue(address.IsBlank);
 }