While it feels that this question should have been answered many times already, I can not find anything useful (except for BulkInsert addons which I'd like to avoid)
public virtual void AddRange(ICollection<T> entries)
{
_context.Set<T>().AddRange(entries);
}
public virtual void UpdateRange(ICollection<T> entries)
{
_context.Set<T>().UpdateRange(entries);
}
So how to combine these 2 methods together? T is a class and has a key "Id" property (or it can have other composite key, thus I want this solution to be truly generic), but I don't want to make an interface out of it (to check if equals to 0 to mark entry as Added, Modified otherwise) as it complicates design.