Is object creation in getters bad practice?
问题 Let's have an object created in a getter like this : public class Class1 { public string Id { get; set; } public string Oz { get; set; } public string Poznamka { get; set; } public Object object { get { // maybe some more code return new Object { Id = Id, poznamla = Poznamka, Oz = OZ }; } } } Or should I rather create a Method that will create and return the object ? 回答1: Properties look like fields but they are methods. This has been known to cause a phenomenal amount of confusion. When a