public void Delete(string id, string commandId, string version, string requesterId = default(string)) { try { var value = new DeleteContactMechDto(); value.CommandId = commandId; value.RequesterId = requesterId; value.Version = (long)Convert.ChangeType(version, typeof(long)); ContactMechesControllerUtils.SetNullIdOrThrowOnInconsistentIds(id, value); _contactMechApplicationService.When(value as IDeleteContactMech); } catch (Exception ex) { var response = ContactMechesControllerUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); } }
public async Task WhenAsync(DeleteContactMechDto c) { var idObj = (c as IDeleteContactMech).ContactMechId; var uriParameters = new ContactMechUriParameters(); uriParameters.Id = idObj; var q = new ContactMechDeleteQuery(); q.CommandId = c.CommandId; q.RequesterId = c.RequesterId; q.Version = Convert.ToString(c.Version); var req = new ContactMechDeleteRequest(uriParameters); req.Query = q; var resp = await _ramlClient.ContactMech.Delete(req); ContactMechProxyUtils.ThrowOnHttpResponseError(resp); }
public void When(DeleteContactMechDto c) { WhenAsync(c).GetAwaiter().GetResult(); }