Exemplo n.º 1
0
        public IHttpContext UpdateContacto(IHttpContext context)
        {
            string jsonRAW = context.Request.Payload;
            var    id      = context.Request.QueryString["id"] ?? "what?";

            dynamic dataId = JsonConvert.DeserializeObject <object>(jsonRAW);

            MLoadBalancer data = new MLoadBalancer();

            //data.fecha = DateTime.Now;
            data._id = ObjectId.Parse(id);



            _.Update(id, data);

            context.Response.SendResponse("Updated!");
            return(context);
        }
Exemplo n.º 2
0
        public IHttpContext AddContacto(IHttpContext context)
        {
            string  jsonRAW = context.Request.Payload;
            dynamic dataId  = JsonConvert.DeserializeObject <object>(jsonRAW);

            MLoadBalancer data = new MLoadBalancer();

            data.typeService = dataId.typeService;
            data.url         = dataId.url;
            data.status      = dataId.status;

            _.Create(data);

            string json = JsonConvert.SerializeObject(data, Formatting.Indented);

            context.Response.AppendHeader("Content-Type", "application/json");
            context.Response.SendResponse(json);
            return(context);
        }