示例#1
0
        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();
        }
示例#2
0
 public IHttpActionResult SetRight(SetDataModel model)
 {
     return SetData(model, bytes => _dataComparisonService.SetRight(bytes));
 }