public IHttpActionResult Put(int id, FicheroModel model)
        {
            var d = FicheroRepositorio.Get(id);
            if (d == null || d.Id != model.Id)
                return NotFound();


            var data = FicheroRepositorio.Update(model);

            if (data < 1)
                return BadRequest();

            return Ok();
        }
        public IHttpActionResult Post(FicheroModel model)
        {
            /*var data = FicheroRepositorio.Add(model);

            if (data == null)
                return BadRequest();

            return Ok(data);*/


            var cuenta = ConfigurationManager.AppSettings["cuenta"];
            var clave =
            ConfigurationManager.AppSettings["clave"];
            var contenedor = ConfigurationManager.AppSettings["contenedor"];

            var sto = new AzureStorageUtils(cuenta, clave, contenedor);
            var nombre = Guid.NewGuid() + ".png";

            sto.SubirFichero(Convert.FromBase64String(model.Nombre), nombre);

            return Ok(nombre);
        }
        private async void AgregarImagen()
        {
            var f =
                await
                    CrossMedia.Current.TakePhotoAsync(new StoreCameraMediaOptions()
                    {
                        Directory = "Imagenes",
                        Name = "tareaFoto.jpg"
                    });
            if (f != null)
            {
                var st = f.GetStream();
                f.Dispose();

                var l = st.Length;
                byte[] bt = new byte[1];
                st.Read(bt, 0, bt.Length);

                var fichero = new FicheroModel
                {
                    Id = 22,
                    Nombre = Convert.ToBase64String(bt)
                };

                await _servicioDatos.UploadFichero(fichero);

                Imagen = ImageSource.FromStream(() => st);
            }
        }
        public async Task<string> UploadFichero(FicheroModel model)
        {
            var request = new RestRequest();
            request.Method = Method.POST;

            request.AddJsonBody(model);
            var r = await _client.Execute<string>(request);
            return r.Data;
        }