The easiest way to remember C# Constraints is to write them down
For example having two generic parameters with different Constraints will be written like this:
1 2 3 4 5 6 7 8 9 10 11 12 13 | public class SqlRepository<T, T2> : IRepository<T> where T : class, IEntity where T2 : struct { DbContext _ctx; DbSet<T> _set; public SqlRepository(DbContext ctx) { _ctx = ctx; _set = _ctx.Set<T>(); } } |