Exemple #1
0
        static void Main(string[] args)
        {
            SingleSrcModel model = new SingleSrcModel();

            model.Age         = 100;
            model.LongLongAgo = 1111111111;
            model.Money       = 1000;
            model.Name        = "小明";
            model.Time        = DateTime.Now;
            model.Title       = "gagagag";
            var result = MapperOperator <SingleDestModel> .MapFrom(model);

            var result1 = MapperOperator <SingleConvertDestModel> .MapFrom(result);

            var result2 = MapperOperator <SingleConvertSrcModel> .MapFrom(result1);

            SingleConvertSrcModel a = new SingleConvertSrcModel();

            a.Age = Convert.ToInt32(result1.Age);
            Console.ReadKey();
        }
Exemple #2
0
 public static TDest Map <TSrc, TDest>(this TSrc src)
 {
     return(MapperOperator <TDest> .MapFrom(src));
 }