예제 #1
0
        public bool AddEvidence(EvidenceEntity entity)
        {
            if (Exists(entity.RowKey))
            {
                return(false);
            }

            try
            {
                TableOperation insertOperation = TableOperation.Insert(entity);
                table.Execute(insertOperation);
                return(true);
            }
            catch (Exception e)
            {
                Trace.TraceError($"ERROR: {e.Message}");
                return(false);
            }
        }
예제 #2
0
        public bool ReplaceEntity(EvidenceEntity entity)
        {
            if (!Exists(entity.RowKey))
            {
                return(false);
            }

            try
            {
                TableOperation replaceOperation = TableOperation.Replace(entity);
                table.Execute(replaceOperation);
                return(true);
            }
            catch (Exception e)
            {
                Trace.TraceError($"ERROR: {e.Message}");
                return(false);
            }
        }
예제 #3
0
        public bool DeleteEntity(String rowKey)
        {
            if (!Exists(rowKey))
            {
                return(false);
            }

            try
            {
                EvidenceEntity entity          = RetriveSingleEvidence(rowKey);
                TableOperation deleteOperation = TableOperation.Delete(entity);
                table.Execute(deleteOperation);
                return(true);
            }
            catch (Exception e)
            {
                Trace.TraceError($"ERROR: {e.Message}");
                return(false);
            }
        }