누군가 내게이에게 설명 제거목록 <Type>
내가 문자열의 다른 목록에 포함 된 ID를 일치 목록에서 항목을 삭제하려합니다.
1 단계는 다음과 같습니다 :
내가 ListingNumber이 lstListingsUpdatedIn24Hrs에 ListingNumbers 일치 myListingSyncIDs에서 항목을 삭제하는 것을 시도하고있다.
의 항목 [0] 단계 2에 나타낸 바와 같이 lstListingsUpdatedIn24Hrs에서 값을 같음 :
을하지만 3 단계에 나타낸 바와 같이 다음 제거는 실패
그럼에서 removeAll을 수행 한 후 (FUNC) 4 단계는 다음 제거는 제거 (항목)이 작동하지 않는 이유
누군가가 설명 작동 ...
코드하십시오 :
myListingSyncIDs.AddRange(myListingSync.Listings);
#region Remove Listing References Fetched In The Last 24Hrs
// Listing References Fetched In The Last 24Hrs
// These will be excluded to optimise the running of the App.
// Basically meaning that a complete sync of all listings
// will only be done once every 24hrs
// So that if this is run every hr, it will not slow down the most recent additions
List<String> lstListingsUpdatedIn24Hrs = DAL.PropertyPortalDAL.GetSahtWebserviceUpdatesIn24Hrs();
List<P24SyncService.ListingSyncItem> myListingsUpdatedIn24Hrs =
lstListingsUpdatedIn24Hrs.Select(p => new P24SyncService.ListingSyncItem()
{
ListingNumber = p,
Status = P24SyncService.ListingState.AddedModified
}).ToList();
foreach (P24SyncService.ListingSyncItem myLSI in myListingsUpdatedIn24Hrs)
{
myListingSyncIDs.Remove(myLSI);
}
myListingSyncIDs.RemoveAll(p => lstListingsUpdatedIn24Hrs.Contains(p.ListingNumber));
#endregion
ListingSyncItem은 다음과 같습니다 추측에서
public partial class ListingSyncItem {
private string listingNumberField;
private ListingState statusField;
/// <remarks/>
public string ListingNumber {
get {
return this.listingNumberField;
}
set {
this.listingNumberField = value;
}
}
/// <remarks/>
public ListingState Status {
get {
return this.statusField;
}
set {
this.statusField = value;
}
}
}
텍스트 대신 스크린 샷과 같이 코드를 삽입 할 수 있다면 더 나은되지 않을 것 – AnarchistGeek