private ICollection <string> GetAllEnvironmentMembers(IWebHostEnvironment env) { var values = new List <string>(); var properties = env.GetType().GetProperties(BindingFlags.Public | BindingFlags.Instance); foreach (var property in properties) { var result = property.GetValue(this.env); if (result.GetType() == typeof(IEnumerable)) { values.Add(string.Join(Environment.NewLine + " -", property.Name + " - " + (IEnumerable)result)); } else { values.Add(property.Name + " - " + result.ToString()); } } return(values); }
public UploadPhotoModel(IWebHostEnvironment Env) // DI { Console.WriteLine(Env.GetType().Name); this.Env = Env; }