Exemplo n.º 1
0
        public ActionResult <SchemaData> Get(string client)
        {
            client = client.ToLower().Trim();
            if (DataAccess.SchemaDictionary.ContainsKey(client))
            {
                var entry = DataAccess.SchemaDictionary[client];

                // Strip out the Definition because it's huge
                var result = new SchemaData()
                {
                    Client   = entry.Client,
                    Version  = entry.Version,
                    Entitled = entry.Entitled,
                    Objects  = new List <DbObject>()
                };
                foreach (var obj in entry.Objects)
                {
                    result.Objects.Add(new DbObject()
                    {
                        Name     = obj.Name,
                        Type     = obj.Type,
                        CheckSum = obj.CheckSum
                    });
                }
                return(result);
            }
            return(NotFound());
        }
Exemplo n.º 2
0
 public ActionResult <string> PostClientData(string client, [FromBody] SchemaData schema)
 {
     client = client.ToLower().Trim();
     if (string.IsNullOrEmpty(client))
     {
         return(BadRequest("Client not specified"));
     }
     else
     {
         DataAccess.SchemaDictionary[client] = schema;
         DataAccess.Save();
         return(Accepted());
     }
 }