I have a code which works in .Net 4.6 with EF6 but won't work with ef.core. Compiler reports
No overload for method 'Set' takes 1 arguments (CS1501)
Type type = Type.GetType("ContextName.SomeModel");
if (type == null) return null;
var entity = db.Set(type).Find(id);
Basically, I am getting an object by a string name. How to achieve this in .core (v 2.0)?
My imports:
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Linq.Dynamic.Core;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.ChangeTracking;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Identity;
using Shared.Web.MvcExtensions;
db
variable?