tags:

views:

77

answers:

0

case1: int categoryID = 1

DB db = new DB(); Shop_Category o = db.Shop_Category.SingleOrDefault(cat => cat.CategoryID == categoryID); get value of o.Status

have error; No mapping exists from object type ShopVN.CategoryMgt+<>c__DisplayClass0 to a known managed provider native type.

case2: const int categoryID = 1 DB db = new DB(); Shop_Category o = db.Shop_Category.SingleOrDefault(cat => cat.CategoryID == categoryID); get value of o.Status is OK

case3: string categoryName = "ABC" DB db = new DB(); Shop_Category o = db.Shop_Category.SingleOrDefault(cat => cat.CategoryName == categoryName ); have error; No mapping exists from object type ShopVN.CategoryMgt+<>c__DisplayClass0 to a known managed provider native type.

case4: DB db = new DB(); Shop_Category o = db.Shop_Category.SingleOrDefault(cat => cat.CategoryName == "ABC"); get value of o.Status is OK

please help!!!.