EF query receives generics, dynamically creates instances based on table names and generic parameters for EF

public static void CreateInstance()
{
    using (var ru = new RepositoryUse())
    {
        //
        var list1 = ru.SysUserRepository.IQueryable().ToList();
        //SQL
        var list2 = ru.Context.Set<SysUser>().FromSql("select * from sysuser").ToList();
                
        //

        //SysUser 

        // 
        string tableName = "SysUser";

        //tableNameSysUserSet<TEntity>
        //stringToTEntity(tableName)

        //C-sharpdmobject  as SysUser
        var dm = Activator.CreateInstance(Type.GetType("Domain.SysUser"));
        var domain = dm as SysUser;

        //Set
    }
}
Mar.04,2021
  • C-sharp WinFor project link database problem

    just got a C-sharp Mini Program who wants to run it on his computer and import data. But I haven t contacted EF, before and want to ask you how to match the database link of this project to your own SQL SERVER. the following is the code in App.con...

    Mar.04,2021
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b34a56-2bf12.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b34a56-2bf12.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?