如何在MVC中使用automapper比较两个对象? [英] How to compare two objects using automapper in MVC?

查看:77
本文介绍了如何在MVC中使用automapper比较两个对象?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有客户模型

i希望比较 OldCustomerModel NewCustomerModel

如果 NewCustomerModel 我必须返回true





有没有其他方法可以将模型与模型进行比较?



我尝试过:



Mapper.Map(OldCustomerModel,NewCustomerModel);

I have customer model
i want to compare OldCustomerModel and NewCustomerModel
if any changes happened in NewCustomerModel i have to return true


Is there any other way to compare model to model?

What I have tried:

Mapper.Map(OldCustomerModel, NewCustomerModel);

推荐答案

比较两个对象 [ ^ ]


这篇关于如何在MVC中使用automapper比较两个对象?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆