小编Vis*_*iri的帖子

'object'不包含动态定义

我正在使用下面描述的方法.返回动态结果.

public static dynamic GetCouponDetailsbyCouponID(Guid couponID)
        {
            using (var loEntities = new Entities())
            {
                dynamic nonWinnerGift = (from nw in loEntities.CorporateNonWinnerGift
                                         join um in loEntities.Users on nw.UserID equals um.Id
                                         where nw.IsDeleted != true && nw.CouponID == couponID
                                         select new
                                         {
                                             FullName = (um.FirstName + " " + um.LastName),
                                                 Title = nw.Title,
                                                 Description = nw.Description,
                                                 LogoName = nw.LogoName,
                                                 CouponID = nw.CouponID,
                                                 IsDiscount = nw.IsDiscount,
                                                 Discount = nw.Discount,
                                                 Desclaiemer = nw.Desclaiemer
                                             }).SingleOrDefault();    
                return nonWinnerGift;
            }
        }

 dynamic expandDoObject = new ExpandoObject();
Run Code Online (Sandbox Code Playgroud)

当我尝试访问"couponData.LogoName"而不是抛出动态运行时异常时.请在下面找到我的异常"ClosetAuctions.dll中发生类型'Microsoft.CSharp.RuntimeBinder.RuntimeBinderException'的第一次机会异常 …

c# asp.net

9
推荐指数
2
解决办法
1万
查看次数

无法将类型'System.Data.Entity.Core.Objects.ObjectResult <>'隐式转换为'System.Collections.Generic.List <>'

我正在尝试更新EDMX存储过程,我收到此错误:

无法将System.Data.Entity.Core.Objects.ObjectResult类型隐式转换为System.Collections.Generic.List

我正在使用Visual Studio 2013.

c# asp.net edmx

1
推荐指数
1
解决办法
6072
查看次数

标签 统计

asp.net ×2

c# ×2

edmx ×1