Empty datarows in database

Topics: General, Troubleshooting, Writing modules
Apr 25, 2014 at 1:36 AM
Edited Apr 25, 2014 at 1:39 AM
So I have a content part, with its corresponding record, driver etc. It seems to work just fine and writes data to the database just like I would expect.

by the way I create a new record by doing the following:
    public void CreateAddress(IAddressRecord objAddressRecord) {

            var addressesContentItem = _orchardServices.ContentManager.New("AddressItem");
            var objAddressPart = addressesContentItem.As<AddressesPart>();

            objAddressPart.Address1 = objAddressRecord.Address1;
            objAddressPart.Address2 = objAddressRecord.Address2;
            objAddressPart.Address3 = objAddressRecord.Address3;
            objAddressPart.Address4 = objAddressRecord.Address4;
            objAddressPart.City = objAddressRecord.City;
            objAddressPart.State = objAddressRecord.State;
            objAddressPart.ZipCode = objAddressRecord.ZipCode;

             //create record in database
            _orchardServices.ContentManager.Create(addressesContentItem);

    }

I am not sure why but sometimes in a loop of creating addresses I get empty rows in my table.
example: When I try to create 5-10 of these address records and do the same for some other content items I get the douplicates.

Should I be saving them to the database by some other way? I am not able to breakpoint on it when it creates these empty rows, so I am not sure where they are coming from. Any pointers or suggestions would be welcome.
Apr 28, 2014 at 6:23 PM
The blank entries were coming from the other parts in the content item, which when created they all had an entry created. Silly n00b orchard user!