使用实体框架的实体中的计算字段. [英] Calculated field in an entity using the entity framework.

查看:77
本文介绍了使用实体框架的实体中的计算字段.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,

我在添加计算所得的属性"FullName"时遇到了问题到实体的局部类.我使用:

公共部分类Contact
{
公用字符串FullName
}
}

当我尝试使用EntityDataSource将其绑定到GridView时,FullName列不可用.我可以解决这个问题吗?当我手动将实体绑定到gridview时,它可以正常工作.

在此先感谢您,

Evert

Hello,

I have  problem adding the calculated property "FullName" to the partial class of an entity. I use:

public partial class Contact
{
    public string FullName
    {
        get
        {
            return FirstName + LastName;
        }
    }
}

When I try to bind this using a EntityDataSource to a GridView, the FullName column isn't available. I can I solve this problem? When I manually bind the entities to the gridview it is working fine.

Thanks in advance,

Evert

推荐答案

嗨!

使用Entity Framework论坛解决此问题: http://forums .microsoft.com/Forums/ShowForum.aspx?ForumID = 533& SiteID = 1

问候,
Hi!

Use the Entity Framework forum for this issue: http://forums.microsoft.com/Forums/ShowForum.aspx?ForumID=533&SiteID=1

Regards,


这篇关于使用实体框架的实体中的计算字段.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆