Esempio n. 1
0
 public EvidenceDb(Evidence e)
 {
     this.CustomerID = e.CustomerID;
     this.ChallengeID = e.ChallengeID;
     this.Type = e.Type;
     this.MediaURL = e.MediaURL;
     this.UniqueID = e.UniqueID;
     this.Content = e.Content;
 }
Esempio n. 2
0
        public EvidenceDb(Evidence e)
        {
            this.PartitionKey = e.ChallengeStatusID;
            this.RowKey = e.UniqueID;

            this.Type = e.Type;
            this.MediaURL = e.MediaURL;
            this.UniqueID = e.UniqueID;
            this.Content = e.Content;
        }
Esempio n. 3
0
        private Evidence DbEvidenceToEvidence(EvidenceDb item)
        {
            Evidence e = new Evidence();

            e.ChallengeStatusID = item.ChallengeStatusID;
            e.MediaURL = item.MediaURL;
            e.Type = item.Type;
            e.UniqueID = item.UniqueID;
            e.Content = item.Content;

            return e;
        }
Esempio n. 4
0
        public void Add(Evidence e)
        {
            EvidenceDb d = EvidenceToDbEvidence(e);

            d.PartitionKey = DbPartKey(e.ChallengeID, e.CustomerID);
            d.RowKey = e.UniqueID;

            context.AttachTo(TableName, d, null);
            context.UpdateObject(d);
            context.SaveChangesWithRetries();
            context.Detach(d);
        }
Esempio n. 5
0
        private EvidenceDb EvidenceToDbEvidence(Evidence item)
        {
            EvidenceDb d = new EvidenceDb();

            d.CustomerID = item.CustomerID;
            d.Content = item.Content;
            d.MediaURL = item.MediaURL;
            d.UniqueID = item.UniqueID;
            d.Type = item.Type;
            d.ChallengeID = item.ChallengeID;

            return d;
        }
Esempio n. 6
0
        public void Post(Evidence value)
        {
            if (value.ChallengeID == 0)
                throw new HttpResponseException("You have to supply a challenge ID.", System.Net.HttpStatusCode.Forbidden);

            if (value.Content == null)
                value.Content = "";

            if (value.MediaURL == null)
                value.MediaURL = "";

            value.UniqueID = System.Guid.NewGuid().ToString();

            EvidenceRepo.Add(value);
        }
Esempio n. 7
0
        private EvidenceDb EvidenceToDbEvidence(Evidence item)
        {
            EvidenceDb d = new EvidenceDb();

            d.ChallengeStatusID = item.ChallengeStatusID;
            d.Content = item.Content;
            d.MediaURL = item.MediaURL;
            d.UniqueID = item.UniqueID;
            d.Type = item.Type;
            d.ChallengeID = item.ChallengeID;

            d.PartitionKey = item.ChallengeID + "_" + item.UniqueID;
            d.RowKey = item.UniqueID;

            return d;
        }
Esempio n. 8
0
 public void Add(Evidence e)
 {
     EvidenceDb d = EvidenceToDbEvidence(e);
     context.AttachTo(TableName, d);
     context.SaveChangesWithRetries();
 }