public void Put(EntityWithGUID e) { e.PartitionKey = ""; // all in the same partition e.RowKey = e.GUID.ToString(); TableOperation to = TableOperation.InsertOrReplace(e); var result = Table.Execute(to); }
public void Delete(Guid guid) { EntityWithGUID ew = new EntityWithGUID() { GUID = guid, PartitionKey = "", RowKey = guid.ToString(), ETag="*" }; TableOperation to = TableOperation.Delete(ew); var result = Table.Execute(to); }
// GET api/SQLServers/{guid} public EntityWithGUID Get(string id) { try { Guid gID = Guid.Parse(id); var dt = PerformCommand(gID, "SQLDashboard.TSQL.InstanceSummary.sql"); var ret = new EntityWithGUID() { Number = (int)dt.Rows[0][0], Entity = null }; return ret; } catch (Exception exce) { return new EntityWithGUID() { Number = -1, Entity = exce.Message }; } }