Ejemplo n.º 1
0
        public ChallengeStatus(ChallengeStatusDb d)
        {
            // this.UniqueID = d.RowKey;
            this.CustomerID = d.CustomerID;
            this.ChallengeID = d.ChallengeID;
            this.Status = d.Status;
            this.ChallengeOriginatorCustomerID = d.ChallengeOriginatorCustomerID;

            this.Customer = null;
        }
        private void CoreAddOrUpdate(ChallengeStatus value, bool Add=false)
        {
            ChallengeStatusDb targetCust = new ChallengeStatusDb(value);
            ChallengeStatusDb chal = new ChallengeStatusDb(value);

            string targetCustKey = DbCustKey(value.CustomerID);
            string chalKey = DbChalKey(value.ChallengeID);

            targetCust.PartitionKey = targetCustKey;
            targetCust.RowKey=chalKey;

            chal.PartitionKey = chalKey;
            chal.RowKey = targetCustKey;

            context.AttachTo(TableName, chal, null);
            context.UpdateObject(chal);

            context.AttachTo(TableName, targetCust, null);
            context.UpdateObject(targetCust);

            context.SaveChangesWithRetries();

            context.Detach(targetCust);
            context.Detach(chal);
        }