model 层 :
public class Equipment{
public Equipment Clone()
{
return this.MemberwiseClone() as Equipment;
}
private Guid _id;
public Guid Id
{
get { return _id; }
set { _id = value; }
}
private int _typeid;
public int TypeId
{
get { return _typeid; }
set { _typeid = value; }
}
}
方法调用 查到一个实体对象时
IQingWei.Model.Equipment addEquipmentModel = new Equipment();
addEquipmentModel = oldEquipmenModel.Clone();
addEquipmentModel.Name = oldEquipmenModel.TypeId;//替换提的类型id
C#model替换从新赋值
最新推荐文章于 2024-04-18 10:39:17 发布