示例#1
0
        public IActionResult GetFeatureStatus(Guid id)
        {
            var src = _keyValueRepository.LoadData($"{id}-file");

            if (src != null)
            {
                var csv = _keyValueRepository.LoadData($"{id}-csv");
                if (csv != null)
                {
                    var result = _keyValueRepository.LoadData($"{id}-result");
                    if (result != null)
                    {
                        BinaryFormatter bf = new BinaryFormatter();
                        using (MemoryStream ms = new MemoryStream(result))
                        {
                            object responce = bf.Deserialize(ms);
                            return(Ok(responce));
                        }
                    }
                    else
                    {
                        return(Accepted());
                    }
                }
                else
                {
                    var error = _keyValueRepository.LoadData($"{id}-error");
                    if (error != null)
                    {
                        BinaryFormatter bf = new BinaryFormatter();
                        using (MemoryStream ms = new MemoryStream(error))
                        {
                            object responce = bf.Deserialize(ms);
                            return(BadRequest(responce));
                        }
                    }
                    else
                    {
                        return(Accepted());
                    }
                }
            }
            else
            {
                return(NotFound());
            }
        }