Пример #1
0
        ActionResult PutInternal(string nameSpace, string name, byte[] value)
        {
            var actionStr = Request.Params["action"];

            if (string.Equals(actionStr, "create", StringComparison.OrdinalIgnoreCase))
            {
                try {
                    _dictService.Create(nameSpace, name, value);
                } catch (DictionaryKeyException ex) {
                    var toThrow = new HttpException((int)HttpStatusCode.BadRequest,
                                                    ex.Message, ex);
                    Util.LogBeforeThrow(toThrow, _log_props);
                    throw toThrow;
                }
            }
            else
            {
                _dictService.Put(nameSpace, name, value);
            }
            return(new EmptyResult());
        }