namespace OnlineAssessment.Data
{
    //https://stackoverflow.com/questions/31162576/entity-framework-add-if-not-exist-without-update

    //public static class DbSetExtensions
    //{
    //    public static T AddIfNotExists<T>(this DbSet<T> dbSet, T entity, Expression<Func<T, bool>> predicate = null) where T : class, new()
    //    {
    //        var exists = predicate != null ? dbSet.Any(predicate) : dbSet.Any();
    //        return !exists ? dbSet.Add(entity) : null;
    //    }
    //}
}
