مرجع تخصصی برنامه نویسان

انجمن تخصصی برنامه نویسان فارسی زبان

کاربر سایت

zahra_rf

عضویت از 1394/10/24

entityframework

  • یکشنبه 27 تیر 1395
  • 11:23
تشکر میکنم

سلام من دارم یه سایت فروشگاه مینویسم

ولی به Any در این خط گیر میده.. فکر کنم به خاطر ابنه که ParentID , nullable هست

var ProductCategory = context.Categories.Where(x => x.ParentID.Any(z => z.ID== id)).ToList();

حالا چی کار باید کنم که درست بشه؟؟

پاسخ های این پرسش

تعداد پاسخ ها : 3 پاسخ
کاربر سایت

ایمان مدائنی

عضویت از 1392/01/20

  • یکشنبه 27 تیر 1395
  • 16:36

متن خطا را قرار دهید

کاربر سایت

zahra_rf

عضویت از 1394/10/24

  • دوشنبه 28 تیر 1395
  • 11:34

The parameters dictionary contains a null entry for parameter 'id' of non-nullable type 'System.Int32' for method 'System.Web.Mvc.ActionResult Delta(Int32)' in 'Alborz.Controllers.HomeController'. An optional parameter must be a reference type, a nullable type, or be declared as an optional parameter.
Parameter name: parameters

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.ArgumentException: The parameters dictionary contains a null entry for parameter 'id' of non-nullable type 'System.Int32' for method 'System.Web.Mvc.ActionResult Delta(Int32)' in 'Alborz.Controllers.HomeController'. An optional parameter must be a reference type, a nullable type, or be declared as an optional parameter.
Parameter name: parameters

کاربر سایت

ایمان مدائنی

عضویت از 1392/01/20

  • دوشنبه 28 تیر 1395
  • 11:52

فکر کنم id که دادید null هست

چک کنید مقدار داشته باشه

کاربرانی که از این پست تشکر کرده اند

هیچ کاربری تا کنون از این پست تشکر نکرده است

اگر نیاز به یک مشاور در زمینه طراحی سایت ، برنامه نویسی و بازاریابی الکترونیکی دارید

با ما تماس بگیرید تا در این مسیر همراهتان باشیم :)