public List <VSysInfoList> GetUserAllSysInfoList(string userNum, string type) { using (SystemIntegrationEntities db = new SystemIntegrationEntities()) { var sql = @"SELECT [SysInfoID] ,[SysName] ,[SysDesc] ,[SysIcon] ,[SysType] ,[LoginUrl] ,[SysOrder] ,SysUrl ,IsLogin ,(select [BindState] from [UserSys] t where t.UserNum=@userNum and t.SysInfoID=s.SysInfoID) as BindState FROM [SystemIntegration].[dbo].[SysInfo] s where s.SysType=@sysType order by SysOrder"; SqlParameter[] parameter = new SqlParameter[2]; parameter[0] = new SqlParameter("@userNum", userNum); parameter[1] = new SqlParameter("@sysType", type); return(db.Database.SqlQuery <VSysInfoList>(sql, parameter).ToList()); } }
public GenericRepository(SystemIntegrationEntities content) { this.db = content; this.dbset = db.Set <TEntity>(); }