How can I properly use breakpoints when using an object initializer?
问题 For example, doing something like this: foreach (DataRow row in data.Rows) { Person newPerson = new Person() { Id = row.Field<int>("Id"), Name = row.Field<string>("Name"), LastName = row.Field<string>("LastName"), DateOfBirth = row.Field<DateTime>("DateOfBirth") }; people.Add(newPerson); } Setting a breakpoint to an individual assignation is not possible, the breakpoint is set to the entire block. If I want to see specifically where my code is breaking, I have to use: foreach (DataRow row in