using iWareCommon.Common.Dao; using iWareCommon.Common.Entity; using iWareCommon.Utils; using iWareDataCore.ORM; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace iWareDataCore.DEV.Entity { public class EquipmentTypeEntity :ICommonEntity { public int Id { get; set; } /// /// 设备名称 /// public string Name { get; set; } /// /// 备注 /// public string Remark { get; set; } /// /// 构造函数 /// public EquipmentTypeEntity() { } /// /// 构造函数 /// /// 角色 public EquipmentTypeEntity(DEVEquipmentType role) { EntityPropHelper.CopyProp(role, this, GetColumnMap()); } /// /// 将对象转换成ORM中的类型 /// /// Orm中的角色类型 public DEVEquipmentType ToOrm() { DEVEquipmentType role = new DEVEquipmentType(); EntityPropHelper.CopyProp(this, role, GetColumnMap()); return role; } /// /// 获取自定义角色类中的字段名为键,orm中对象的字段名为值的字段 /// /// public static Dictionary GetColumnMap() { return new Dictionary() { {"Id","id"}, {"Name", "name"}, {"Remark", "remark"}, }; } /// /// 根据RoleEntity的字段转RBAC_Role的字段 /// /// RoleEntity的字段 /// RBAC_Role public static string GetColumnName(string name) { var columnMap = GetColumnMap(); return columnMap.ContainsKey(name) ? columnMap[name] : name; } /// /// 获取RoleEntity对于的表名 /// /// DEVEquipment public static string GetTableName() { return "[dbo].[DEVEquipmentType]"; } } }