//--- public static List <LoaiBangGiaNo> DocTatCa() { //Xài automapper var logic = new LoaiBangGiaLogic(); var config = new MapperConfiguration(cfg => cfg.CreateMap <LoaiBangGiaBDO, LoaiBangGiaNo>()); var mapper = config.CreateMapper(); List <LoaiBangGiaNo> nguon = mapper.Map <List <LoaiBangGiaBDO>, List <LoaiBangGiaNo> >(logic.DocTatCa()); return(nguon); }
public static LoaiBangGiaNo DocTheoTen(string ten) { var logic = new LoaiBangGiaLogic(); var objBDO = logic.DocTheoTen(ten); var config = new MapperConfiguration(cfg => cfg.CreateMap <LoaiBangGiaBDO, LoaiBangGiaNo>() ); var mapper = config.CreateMapper(); var objModel = mapper.Map <LoaiBangGiaNo>(objBDO); //Trả về return(objModel); }