如何将我的列表作为工具提示输入

时间:2017-03-28 18:24:11

标签: c# entity-framework-5

在下面的代码中,我想从GetChainDetails返回到我所拥有的地方"我想在这里找到我的名单"在GetChains方法中。不知道如何完成或以其他方式做到这一点。

public static IEnumerable GetChains(int actGroupid, int dispid)
    {
        EEDBEntities db = new EEDBEntities();
        var query = from c in db.Chains                                              
                    where c.Activity_Basis.activity_group_id == actGroupid && c.Activity_Basis.discipline_id == dispid
                    select new
                    {
                        ChainID = c.ChainID,
                        ChainDesc =  @"<span data-toggle=""tooltip"" title =""" + I WANT MY LIST HERE + @""">" + c.ChainID + "</span>"
                    };            
        return query.ToList();
    }

    public string GetChainDetails(string chainID)
    {
        string sStep = null;
        var chainDetailList = from c in db.Chains_Detail
                              where c.chainID == chainID
                              orderby c.Order
                              select new
                              {
                                  Order = c.Order,
                                  Step = c.Step
                              };
        foreach (var oItem in chainDetailList.ToList())
        {
            sStep = sStep + "\n" + oItem.Order + ": " + oItem.Step;
        }
        return sStep;
    }

1 个答案:

答案 0 :(得分:0)

您的方法public string GetChainDetails(string chainID)不是静态的。也许这就是你得到错误的原因。将其设置为静态并尝试运行代码。

SELECT (a + b + c) / (d + e) AS some_computed_column
FROM yourTable
HAVING some_computed_column = 10    -- allowed, and not ugly

您也可以遵循这种方法:

SELECT t.some_computed_column
FROM
(
    SELECT (a + b + c) / (d + e) AS some_computed_column
    FROM yourTable
) t
WHERE t.some_computed_column = 10

和您的主要代码

public static string GetChainDetails(string chainID)

因此在调用GetChains之后,我正在修改每个成员属性。