I have a MongoDB helper class, which accepts generic types to simplify CRUD operations. I'm having some trouble figuring out the update method, however. From everything I've read, it seems that I need to individually update each field.
For example: Update.Set("Field", "New Value").Set("Other field", "Other value");
But what I'd like to do is something like this:
void Update(T entity)
{
collection.Update<T>(entity);
}
Is this possible? Or will I need to include an update method in each entity's class specific to that entity?