You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In a project I'm involved in, we're using it when importing products from a webshop to a local database. When importing a product, we don't know beforehand if it already exists in the database. If it doesn't exist, we want to insert it. If it already exists, we want to know which product category it belongs to:
varupsertedProduct=await_productRepository.UpdateOrInsertOneAsync(filter: x =>x.Id==newProduct.Id||x.Sku==newProduct.Sku,update: x =>x.Set(y =>y.DescriptionHtml,newProduct.DescriptionHtml).Set(y =>y.Sku,newProduct.Sku)/* set more fields */,entityToInsertIfNoMatch:newProduct,returnProjection: x =>newMatchedProduct(x.Id,x.ProductCategoryId)
Hi John, is there an example on how to use UpdateOrInsertOneAsync ?
thanks
The text was updated successfully, but these errors were encountered: