在C#中交换类

时间:2016-04-08 10:45:32

标签: c#

我在服务器上有一个带有虚拟属性的类,我必须在移动应用程序中用另一个替换。

虚拟属性定义为

SELECT
    *
FROM
    (
        SELECT
            i.imei_id,
            i.imei_no,
            p.post_id,
            p.post_title,
            p.post_desc,
            p.date,
            1 AS STATUS
        FROM
            imei i,
            post p,
            VIEW v
        WHERE
            i.imei_id = v.imei_id
        AND p.post_id = v.post_id
        AND i.imei_no = 356554064098771
        UNION
            SELECT
                i.imei_id,
                i.imei_no,
                p.post_id,
                p.post_title,
                p.post_desc,
                p.date,
                0 AS STATUS
            FROM
                imei i,
                post p
            WHERE
                i.imei_no = 356554064098771
            AND p.post_id NOT IN (
                SELECT
                    v.post_id
                FROM
                    imei i,
                    post p,
                    VIEW v
                WHERE
                    p.post_id = v.post_id
                AND v.imei_id = (
                    SELECT
                        i.imei_id
                    FROM
                        imei i
                    WHERE
                        imei_no = 356554064098771
                )
            )
    ) AS temp
WHERE
    date >= DATE_SUB(
        (
            SELECT
                date
            FROM
                imei
            WHERE
                imei_no = 356554064098771
        ),
        INTERVAL 1 WEEK
    )
ORDER BY
    date DESC

我必须替换为

public virtual List<object> Collection { get; set; }

我怎样才能以最有效的方式做到这一点?

我能想到的唯一方法是创建一个转换它的方法,但因为它深入集合的集合......,我想知道是否有更好的方法

0 个答案:

没有答案