[wix-users] Difference's accessing record in DTF

Joseph L. Casale jcasale at activenetwerx.com
Tue Jul 11 16:19:03 PDT 2017


Given the code below:

using (Database database = session.Database)
using (View view = database.OpenView("SELECT * FROM IIsWebAddress"))
{
    view.Execute();

    // Fails.
    Record[] records = view.ToArray();
    view.Modify(ViewModifyMode.Delete, records[0]);

    // Works.
    foreach (Record record in view)
    {
        view.Modify(ViewModifyMode.Delete, record);
    }
}

You can successfully delete records by iterating the view, but if you
attempt to index a collection of the resulting records and remove
one, it throws?

What is the rationale for this behavior?

Thanks,
jlc


More information about the wix-users mailing list