Esempio n. 1
0
 public static ServiceConfig?LoadFile(string path)
 {
     try
     {
         if (!File.Exists(path))
         {
             return(null);
         }
         using var fileStream = new FileStream(path, FileMode.Open);
         var entity = YamlHelper.ReadStream <ServiceConfigEntity>(fileStream);
         return(entity.Export());
     }
     catch (Exception e)
     {
         _logger.Error(e);
         return(null);
     }
 }