AppConfig.cs 887 B

1234567891011121314151617181920212223242526272829303132
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. namespace Dfs.WayneChina.FairbanksRTData.UniversalApiModels
  6. {
  7. public class AppConfig
  8. {
  9. public string SiteId { get; set; } = "testSite1";
  10. public string DeviceId { get; set; } = "900001";
  11. public string Host { get; set; } = "localhost";
  12. public int Port { get; set; } = 22;
  13. public string UserName { get; set; } = "tester";
  14. public string Password { get; set; } = "P@ssw0rd";
  15. public int TankReadInterval { get; set; } = 30;
  16. public int UploadInterval { get; set; } = 1;
  17. public override string ToString()
  18. {
  19. return GetType().GetProperties().Aggregate(string.Empty,
  20. (result, next) => result + $"{next.Name} : {(next.GetValue(this)?.ToString()) ?? string.Empty} ");
  21. }
  22. }
  23. }