Unable to create a constant value of type ‘’. Only primitive types or enumeration types are supported in this context.

the problem appears because you are using contains method in non primitive type
here is an example
Audit audit = new Audit();
List<int> ints = userReports.Select(y => y.ReportId).ToList();
List<ReportUserVisit> userReportLastMonthVisit = audit.GetAudit(userId, AuditType.Report)
                .Where(x => ints.Contains((int)x.ObjectId))
                .Select(x=> x.ObjectId)
                .GroupBy(x=>x.Value)
                .Select(x=>new ReportUserVisit { ReportId = x.Key, LastMonthVisitCount= x.Count() })
                .ToList();

note ints object, this will solve the problem.
because ints collection is list of int it can use contains method inside entity framework


How to Get Browser Type

// Opera 8.0+
 var isOpera = (!!window.opr && !!opr.addons) || !!window.opera || navigator.userAgent.indexOf(' OPR/') >= 0;
 // Firefox 1.0+
var isFirefox = typeof InstallTrigger !== 'undefined';
// At least Safari 3+: "[object HTMLElementConstructor]"
var isSafari = Object.prototype.toString.call(window.HTMLElement).indexOf('Constructor') > 0;
 // Internet Explorer 6-11
 var isIE = /*@cc_on!@*/false || !!document.documentMode;
 // Edge 20+
 var isEdge = !isIE && !!window.StyleMedia;
 // Chrome 1+
 var isChrome = !!window.chrome && !!window.chrome.webstore;
 // Blink engine detection
 var isBlink = (isChrome || isOpera) && !!window.CSS;
 var output = 'Detecting browsers by ducktyping:

'; output += 'isFirefox: ' + isFirefox + '
'; output += 'isChrome: ' + isChrome + '
'; output += 'isSafari: ' + isSafari + '
'; output += 'isOpera: ' + isOpera + '
'; output += 'isIE: ' + isIE + '
'; output += 'isEdge: ' + isEdge + '
'; output += 'isBlink: ' + isBlink + '
'; document.body.innerHTML = output;


filter attribute that checks whether current connection is secured

using APS.net Core to mark all website pages working with https protocol we will do this using IAuthorizationFilter. and here is an exampl...