首页 \ 问答 \ LinQ:具有多个列标识符的多个连接(LinQ: Multiple joins with multiple columns identifiers)

LinQ:具有多个列标识符的多个连接(LinQ: Multiple joins with multiple columns identifiers)

你能帮我理解这个错误信息吗? 我确实做错了什么但是什么?

join子句中某个表达式的类型不正确。 调用“加入”时类型推断失败。

Res.AddRange(from jh in db.Job
             join jd in db.JobDetail on jh.number equals jd.number
             join js in db.JobSection on new { jd.number, jd.ref, jd.product } equals new { js.number, js.ref, js.Product }
             join oh in db.Order on jd.ref equals oh.ref
             join bh in db.Buyer on jh.id equals bh.id
             where jh.dateModify >= InputDate
             select jh);

错误来自这一行

join js in db.JobSection on new { jd.number, jd.ref, jd.product } equals new { js.number, js.ref, js.Product }

Could you help me to understand this error message. I did something wrong for sure but what?

The type of one of the expressions in the join clause is incorrect. Type inference failed in the call to 'Join'.

Res.AddRange(from jh in db.Job
             join jd in db.JobDetail on jh.number equals jd.number
             join js in db.JobSection on new { jd.number, jd.ref, jd.product } equals new { js.number, js.ref, js.Product }
             join oh in db.Order on jd.ref equals oh.ref
             join bh in db.Buyer on jh.id equals bh.id
             where jh.dateModify >= InputDate
             select jh);

The error come from this line

join js in db.JobSection on new { jd.number, jd.ref, jd.product } equals new { js.number, js.ref, js.Product }

原文:https://stackoverflow.com/questions/37698692
更新时间:2023-04-08 08:04

最满意答案

我会考虑使用PHP加载器来处理身份验证,然后返回所需的文件。 例如,而不是执行<img src='picture.jpg' />执行类似<img src='load_image.php?image=picture.jpg' />

您的图像加载器可以验证会话,检查凭据等,然后决定是否将所请求的文件返回到浏览器。 这将允许您将所有安全文件存储在Web可访问的根目录之外,所以没有人会只是将其设置为WGET或“偶然地浏览”。

只需记住在PHP中返回正确的标题,并在php中执行类似readfile()的操作,并将文件内容返回到浏览器。

我在几个大型安全网站上使用了这个设置,它的作用就像一个魅力。

编辑:我目前正在构建的系统使用这种方法来加载Javascript,图像和视频,但CSS我们并不是非常担心得到保护。


I would consider using a PHP loader to handle authentication and then return the files you need. For example instead of doing <img src='picture.jpg' /> Do something like <img src='load_image.php?image=picture.jpg' />.

Your image loader can verify sessions, check credentials, etc. and then decide whether or not to return the requested file to the browser. This will allow you to store all of your secure files outside of the web accessible root so nobody is going to just WGET them or browse there 'accidentally'.

Just remember to return the right headers in PHP and do something like readfile() in php and that will return the file contents to the browser.

I have used this very setup on several large scale secure website and it works like a charm.

Edit: The system I am currently building uses this method to load Javascript, Images, and Video but CSS we aren't very worried with securing.

相关问答

更多
  • 我会考虑使用PHP加载器来处理身份验证,然后返回所需的文件。 例如,而不是执行执行类似 。 您的图像加载器可以验证会话,检查凭据等,然后决定是否将所请求的文件返回到浏览器。 这将允许您将所有安全文件存储在Web可访问的根目录之外,所以没有人会只是将其设置为WGET或“偶然地浏览”。 只需记住在PHP中返回正确的标题,并在php中执行类似readfile()的操作,并将 ...
  • 我想你应该改变: Alias /media/ "/usr/lib/python2.6/site-packages/django/contrib/admin/media" 至: Alias /static/admin/ "/usr/lib/python2.6/site-packages/django/contrib/admin/media" 因为你有 ADMIN_MEDIA_PREFIX = '/static/admin/' I think you should change: Alias /media ...
  • 您可以注册其他路由以从静态文件夹中提供文件: from flask import app, safe_join, send_from_directory @app.route('//') def toplevel_static(folder, filename): filename = safe_join(folder, filename) cache_timeout = app.get_sen ...
  • CREATE TABLE `members` ( `id` int(4) NOT NULL auto_increment, `username` varchar(65) NOT NULL default '', `password` varchar(65) NOT NULL default '', PRIMARY KEY (`id`) ) ENGINE=MyISAM AUTO_INCREMENT=2 ; CREATE TABLE `members` ( `id` int(4) NOT NULL auto_ ...
  • 我真的不明白。 您已经设置了nginx虚拟主机,但您的主配置是针对Apache ??? 除非他们在不同的端口上运行,否则nginx将运行而不是Apache。 因此,如果PHP仅在Apache中启用,但您现在运行nginx,难怪为什么它不起作用。 如果您仍想使用它,请在Apache中设置虚拟主机,这可能就是这种情况,因为在尝试此操作之前您有一个可用的Apache / PHP堆栈。 如果要切换到nginx,请在尝试在其中配置虚拟主机之前正确配置它。 I don't really get it. You've s ...
  • 你为你的形象提供了错误的道路。 它应该是这样的 {% load staticfiles %} left slide 希望这会奏效。 You are giving wrong path for your image. It should be like this {% load staticfiles %}
    这个问题似乎在mod_mime中 。 从Apache mod_mime文档页面引用: 如果您只想将文件名的最后一个点分隔部分映射到特定的元数据,则不要使用Add *指令。 例如,如果希望将文件foo.html.cgi作为CGI脚本处理,而不是文件bar.cgi.html,则不要使用AddHandler cgi-script .cgi,而是使用 SetHandler cgi-script 另外,你可以谷歌的apache mod_mime "m ...
  • 考虑一下......如果您转到您的站点并右键单击该页面并单击查看源。 您将看到整个文档,包括可能包含的任何项目。 以这种方式考虑它。 包含,是一种说法,在文档中的这个位置,应该有其他的东西。 它会查找您包含的文件并获取其内容,无论是什么,并将这些内容粘贴到包含的位置,它将对每个包含执行此操作,直到它最终到达文档的末尾。 通过这种方式,它引入了链接了CSS文件的HTML,然后它读取了它刚刚引入的HTML,并且在加载了所有HTML之后,它将这些CSS文件样式应用于整个文档。 Consider this... I ...
  • 使用以下代码修改.htaccess文件。 RewriteEngine on RewriteCond $1 !^(index.php|public|assets|robots.txt) RewriteRule ^(.*)$ /p_maricarmen/index.php/$1 [L] 您的css文件未加载的原因是您必须为放置了css和js文件的文件夹指定重写条件。 您可以为图像文件夹执行相同的操作。 只需指定我为资产指定的图像父文件夹名称,它应该按预期工作。 希望这可以帮助你...... Modify yo ...
  • 用这两个位置替换您的位置: location / { try_files $uri /index.php?$args; } location ~ [^/]\.php(/|$) { fastcgi_split_path_info ^(.+?\.php)(/.*)$; if (!-f $document_root$fastcgi_script_name) { return 404; } include fastcgi_params; fastcgi_param PATH_INF ...

相关文章

更多

最新问答

更多
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)
  • 是否可以嵌套hazelcast IMaps?(Is it possible to nest hazelcast IMaps? And whick side effects can I expect? Is it a good Idea anyway?)
  • UIViewAnimationOptionRepeat在两个动画之间暂停(UIViewAnimationOptionRepeat pausing in between two animations)
  • 在x-kendo-template中使用Razor查询(Using Razor query within x-kendo-template)
  • 在BeautifulSoup中替换文本而不转义(Replace text without escaping in BeautifulSoup)
  • 如何在存根或模拟不存在的方法时配置Rspec以引发错误?(How can I configure Rspec to raise error when stubbing or mocking non-existing methods?)
  • asp用javascript(asp with javascript)
  • “%()s”在sql查询中的含义是什么?(What does “%()s” means in sql query?)
  • 如何为其编辑的内容提供自定义UITableViewCell上下文?(How to give a custom UITableViewCell context of what it is editing?)
  • c ++十进制到二进制,然后使用操作,然后回到十进制(c++ Decimal to binary, then use operation, then back to decimal)
  • 以编程方式创建视频?(Create videos programmatically?)
  • 无法在BeautifulSoup中正确解析数据(Unable to parse data correctly in BeautifulSoup)
  • webform和mvc的区别 知乎
  • 如何使用wadl2java生成REST服务模板,其中POST / PUT方法具有参数?(How do you generate REST service template with wadl2java where POST/PUT methods have parameters?)
  • 我无法理解我的travis构建有什么问题(I am having trouble understanding what is wrong with my travis build)
  • iOS9 Scope Bar出现在Search Bar后面或旁边(iOS9 Scope Bar appears either behind or beside Search Bar)
  • 为什么开机慢上面还显示;Inetrnet,Explorer
  • 有关调用远程WCF服务的超时问题(Timeout Question about Invoking a Remote WCF Service)