Asp.net mvc 在数据访问层、业务层或UI中进行简单查找?
ASP.NETMVC4 第1类: 对于类#1的一个属性,我需要获取类#2的一个属性: 有一个DAL可以获取上述类。我需要将这些类合并为一个新类,该类将具有上述类的大部分属性 我是否应该创建第三个类并在BLL中执行该工作 或者,在获取实体后,我应该在UI中使用LINQ to实体来执行此操作吗 我是否应该创建第三个类并在BLL中执行该工作 或者,在获取实体后,我应该在UI中使用LINQ to实体来执行此操作吗Asp.net mvc 在数据访问层、业务层或UI中进行简单查找?,asp.net-mvc,linq-to-entities,data-access-layer,business-logic-layer,Asp.net Mvc,Linq To Entities,Data Access Layer,Business Logic Layer,ASP.NETMVC4 第1类: 对于类#1的一个属性,我需要获取类#2的一个属性: 有一个DAL可以获取上述类。我需要将这些类合并为一个新类,该类将具有上述类的大部分属性 我是否应该创建第三个类并在BLL中执行该工作 或者,在获取实体后,我应该在UI中使用LINQ to实体来执行此操作吗 我是否应该创建第三个类并在BLL中执行该工作 或者,在获取实体后,我应该在UI中使用LINQ to实体来执行此操作吗 这将取决于你在哪里需要这门课。如果是为了显示,那么它应该存在于UI中。在这种情况下,这个类
这将取决于你在哪里需要这门课。如果是为了显示,那么它应该存在于UI中。在这种情况下,这个类甚至有一个名称:它被称为视图模型,是在查询DAL层并将各种结果投影到此视图模型之后,控制器操作可以传递给视图的对象。这个类是类#1的“丰富”类。将项目信息添加到类#1。我想在其他项目中使用它。所以我想我应该在我的BLL类中创建它?是的,如果你需要在其他项目中访问它,那么生活在你的BLL中是有意义的。明白了,谢谢。我会用你的逻辑更新我的问题。
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; }
}
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; }
}