Example #1
0
        public async Task<IHttpActionResult> createClass(Class a)
        {
            a.standard = a.standard.ToUpper();
            g.Connect();
            NodeReference<Class> node = g.Create(a);
            long x = node.Id;
            a.self = x.ToString();
            g.Update<Class>(node, a);
            await h.PostAsync(uri + "node/" + x + "/labels", new StringContent("\"class\""));

            Relation r = new Relation { to = uri + "node/" + a.school, type = "institute" };
            await h.PostAsync(uri + "node/" + x + "/relationships", new StringContent(JsonConvert.SerializeObject(r).ToString(), Encoding.UTF8, "application/json"));

            r = new Relation { to = uri + "node/" + x, type = "class" };
            await h.PostAsync(uri + "node/" + a.school + "/relationships", new StringContent(JsonConvert.SerializeObject(r).ToString(), Encoding.UTF8, "application/json"));
            return Ok(a);
        }
Example #2
0
 protected bool Equals(Class other)
 {
     return (standard == other.standard && section== other.section && school==other.school);
 }