public async Task <HttpResponseMessage> RemoveFile(string path, string filename) { try { await local.RemoveFile(path, filename); return(new HttpResponseMessage(System.Net.HttpStatusCode.OK)); } catch (Exception ex) { Console.WriteLine(ex.Message); return(new HttpResponseMessage(System.Net.HttpStatusCode.InternalServerError)); //{ ReasonPhrase = ex.Message }; } }
public async Task <MessageResponse> RemoveFileHandler(Message message, object context) { try { string sourcePath = message.Properties["path"]; string sourceFilename = message.Properties["filename"]; await local.RemoveFile(sourcePath, sourceFilename); } catch (Exception ex) { Console.WriteLine("ERROR: EdgeHub-RemoveFileHandler '{0}'", ex.Message); } finally { ModuleClient mc = (ModuleClient)context; await mc.CompleteAsync(message); } return(MessageResponse.Completed); }