FirstOrDefault() will work fine. Of course you could do the same with SingleOrDefault since in this instance we should only be expecting one result anyway.
I prefer using the lambda because it's less code to write - just personal preference really.
In the instructions for Third-party integration (file Administration\Modules\ThirdPartyIntegration.ascx), the XML for the example QWC file(.qwc) doesn't appear to be well formed on line #117 (missing ending tag).
Two pages have incorrect class names: Administration\Forums.aspx and Administration\ForumsHome.aspx and their respective designer files (Administration\Forums.aspx.designer.cs and Administration\ForumsHome.aspx.designer.cs), the code behind files are correct though.
I have a importer that i am importing my products, customers and orders from a classic asp site into nop. Everything moved over to 1.7 ok. All I had to do was change the collection stuff, CategoryCollection etc....
But, When I call CustomerManager.AddCustomerForced then CustomerManager.InsertAddress with Shipping Address true , the context.SaveChanges(); generates a new copy of the customer in the database with the exact same info. Like CustomerGuid etc.. But a new customerID
Then I call InsertAddress for the with shipping address false of the same customer then that doesnt generate another record. its only after the first address.
I think then its causing a null ref exception when then try to AddCustomerToRole with the same Customer object from the addCustomerForced but its id has now changed to the 2nd one.
The only change I made to the nop code was in the CustomerManager.CustomerManager.AddCustomerForced @ line 1352 context.SaveChanges(System.Data.Objects.SaveOptions.None);, This fixed this first error i got.
"The changes to the database were committed successfully, but an error occurred while updating the object context. The ObjectContext might be in an inconsistent state. Inner exception message: AcceptChanges cannot continue because the object's key values conflict with another object in the ObjectStateManager. Make sure that the key values are unique before calling AcceptChanges."
I removed the change I made to InsertCustomer, then just simply selected AddNew from the customers page in admin and this also creates 2 records for each customer when you save. the first customer added is missing the name, password etc, but the 2nd customer is complete.
I removed the change I made to InsertCustomer, then just simply selected AddNew from the customers page in admin and this also creates 2 records for each customer when you save. the first customer added is missing the name, password etc, but the 2nd customer is complete.
Both are set to active
Thanks -Keith
build 54692 took care of the duplicate issue. The resource issue was me, I didnt run the resource sql on the docs folder. Going forward now