Convert VB.NET Linq to C# Linq code -
I am converting to C some VB.Net code # and I'm stuck on this linq query:
(to Join query dtx.WebQueries _ wt wt.TaskReportCategory equal dtx.WebTasks query.QueryCategory _ where wt.TaskKey = taskKey _ // legacy code to the bottom of select thekey query re-use, Thekey query = .QueryKey Order query.QueryTitle _ where (Join in qry dtx.WebQueries in dtx.WebPermissions on _ qg qg.QueryKey Join equal dtx.WebQueryGroups on qry.QueryKey _ WP qg.QueryGroupNameKey Equal wp.TaskGroupNameKey Add _wugn.dtx.WebUserGroupNames wp.UserGroupNameKey at wugn.UserGroupNameKey Join _wug add to dtx.WebUserGroups at wugn.UserGroupNameKey wug.UserGroupNameKey _txt wt.TaskReportCategory qt on wt.TaskReportCart in wt. Wt.TaskReportCategory. user category _ where wp.ResourceKey = 4 _ and wt.TaskKey = taskKey _ and wug.UserKey = userKey _ // here they reuse thekey and I choose not specify how it is sure qry.QueryKey. I all but a small piece of code is changed:
(Ditiaks query. Web queries Ditiaks in. Join Vebtaks. Query equals .QueryCategory wt.TaskReportCategory where wt.TaskKey == taskKey // I'm not sure on how new {query later use to assign a variable, var key = query.QueryKey}) OrderBy (X = and I am able to choose gt; x.QueryTitle) .Where (! is the qry in dtx.WebQueries equal join dtx.WebQueryGroups on qg qry.QueryKey qg.QueryKey qg.Q UeryGroupNameKey join dtx.WebPermissions on WP wp.TaskGroupNameKey on wtp in dtx.WebUserGroupNames in wugn is equal to .UserGroupNameKey wugn.UserGroupNameKey equals duties.WebUser group in wugn.UserGroupNameKey equals wug.UserGroupNameKey select where wt.TaskReportCategory on qry.QueryCategory in dtx.WebTasks wp.ResourceKey == 4 and amp; wt.TaskKey == TaskKey & amp ;; wug.UserKey == Upyogkrtaki qry in. Query.QueryKey) == Key / / I need to put the variable here (see above comment); I'm not sure how to do that part where the comments are in C #.
If you need to specify a variable, you can use LINQ. Something
Let key = Kwerikklik to which can be used later in the same area in your case, though, I would say Just by removing the var keyword from an anonymous type, you should reference it later in your section by saying this. Something like this:
select new {query, key = query.QueryKey}. OrderBy (x = & gt; x.query.QueryTitle). Where (q = & gt ;! is Ditiaks equals qry.QueryKey on Hankvibetigugh include Waibati in Kveb queries Ditiaks include WTP in qg.QueryKey equal qg.QueryGroupNameKey in dtx.WebPimissions connect WpkTaskGroupNameKey Wtp Www.dtx.WebUserGroupNames wp.UserGroupNameKey together wugn.UserGroupNameKey together in wt dtx.WebUserGroups on wugn.UserGroupNameKey wug.UserGroupNameKy wt in dtx.WebTasks joins on qry.QueryCategory wt.TaskReportCategory is equal to wp.ResourceKey = = 4 and wt.TaskKey == taskKey & wug.UserKey == userKey Qry.QueryKey.) (Q.key) Select Is found)
Comments
Post a Comment