public static BllUserEntity ToBal(this DalUserEntity user) { if (user == null) { return(null); } return(new BllUserEntity { Id = user.Id, Name = user.Name, Password = user.Password, BllRole = user.DalRole.ToBal(), }); }
public static User ToModel(this DalUserEntity item) { if (item == null) { return(null); } User userEntity = new User { Id = item.Id, Name = item.Name, Password = item.Password, RoleId = item.DalRole.Id }; return(userEntity); }
public static DalUserEntity ToDal(this User item) { if (item == null) { return(null); } DalUserEntity userDalEntity = new DalUserEntity { Id = item.Id, Name = item.Name, Password = item.Password, DalRole = item.Role.ToDal() }; return(userDalEntity); }
//public static IDalEntity ToDal(this IBllEntity itemEntity) //{ // return null; //} public static DalUserEntity ToDal(this BllUserEntity itemUserEntity) { if (itemUserEntity == null) { return(null); } DalUserEntity dalUserEntity = new DalUserEntity { Id = itemUserEntity.Id, Name = itemUserEntity.Name, Password = itemUserEntity.Password, DalRole = itemUserEntity.BllRole.ToDal() }; return(dalUserEntity); }