0

ASP .NET MVC4

第一类:

public class F61BPROD
{
    public int WPDOCO { get; set; }
    public string WPDCTO { get; set; }
    public string WPMCU { get; set; }
    public string WPLOCN { get; set; }
    public string WPDCT { get; set; }
    public int WPTRDJ { get; set; }
    public string WPKYPR { get; set; }
    public string WPLITM { get; set; }
    public decimal WPTRQT { get; set; }
    public string WPKYFN { get; set; }
    public string WPLOTN { get; set; }
    public string WPLRP1 { get; set; }
    public string WPLRP2 { get; set; }
    public string WPLRP3 { get; set; }
    public string WPLRP4 { get; set; }
    public string WPLRP5 { get; set; }
    public string WPLRP6 { get; set; }
    public string WPLRP7 { get; set; }
    public string WPLRP8 { get; set; }
    public string WPLRP9 { get; set; }
    public string WPLRP0 { get; set; }
    public string WPFLAG { get; set; }
    public string WPLOT1 { get; set; }
    public string WPLOT2 { get; set; }
}

对于 #1 类的属性之一,我需要获取 #2 类之一:

    public class JDEItemBasic
    {
        public int itm { get; set; }
        public string litm { get; set; }
        public string dsc { get; set; }
        public string dsce { get; set; }
        public string ean14 { get; set; }
        public string cc { get; set; }
        public string uom1 { get; set; }
        public string uom2 { get; set; }
        public int uom1ea { get; set; }
        public int bxuom1 { get; set; }
        public int uom1gr { get; set; }
}

有一个获得上述类的 DAL。我需要将这些类组合成一个新类,该类将具有上述类的大部分属性。

我应该创建第三类并在 BLL 中工作吗?

或者我应该在获取它们之后使用 LINQ to Entities 在 UI 中执行它?

4

1 回答 1

1

我应该创建第三类并在 BLL 中工作吗?

或者我应该在获取它们之后使用 LINQ to Entities 在 UI 中执行它?

这将取决于你需要这门课的地方。如果它是为了显示目的,那么它应该存在于 UI 中。在这种情况下,此类甚至有一个名称:它称为视图模型,是您的控制器操作在查询 DAL 层并将各种结果投影到此视图模型后可以传递给视图的内容。

于 2013-09-27T08:17:27.833 回答