private IHttpActionResult SetData(SetDataModel model, Action<byte[]> dataSetter) { if (model == null) return BadRequest(); byte[] data = null; if (model.Data != null && !ConvertEx.TryFromBase64String(model.Data, out data)) return BadRequest("Invalid base-64 string."); dataSetter(data); return Ok(); }
public IHttpActionResult SetRight(SetDataModel model) { return SetData(model, bytes => _dataComparisonService.SetRight(bytes)); }