very similar... but you need an adapter to fetch/update:
DataAccessAdapter adapter = new DataAccessAdapter();
CustomerEntity customer = new CustomerEntity();
adapter.FetchUsingUsingUniqueConstraint(new PredicateExpression(CustomerFields.CompanyName == "Chop-suey Chinese"));
customer.ContactName = ......;
customer.AnotherField = ....;
adapter.SaveEntity(customer);
And... for your second question...
I read that you can start an update without reading from the database by creating an entity, then assigning values and then setting the IsNew property based on whether this is a new record, but I'm still stuck on what the best pattern in LLBLGen is to first check if there is matching record and if not insert one or if there is, update the one that is there.
Yes you can. The approximate code is:
// instantiate a new customer... no fetch here.
Customer toUpdate = new Customer("ALFKI");
// some changes...
toUpdate.CompanyName = "something...";
// mark the entity as not new. So at save, this will generate an UPDATE, no INSERT
toUpdate.IsNew = false;
// now save the entity
adapter.SaveEntity(toUpdate);