AnantLabs / codesmith

Automatically exported from code.google.com/p/codesmith
1 stars 0 forks source link

Add Support for GetItem, Remove, Contains and Contains Deleted by PK #539

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Here are the examples from ProjectTracker.

public ProjectResource GetItem(int resourceId)
{
  foreach (ProjectResource res in this)
    if (res.ResourceId == resourceId)
      return res;
  return null;
}

public void Remove(int resourceId)
{
  foreach (ProjectResource res in this)
  {
    if (res.ResourceId == resourceId)
    {
      Remove(res);
      break;
    }
  }
}

public bool Contains(int resourceId)
{
  foreach (ProjectResource res in this)
    if (res.ResourceId == resourceId)
      return true;
  return false;
}

public bool ContainsDeleted(int resourceId)
{
  foreach (ProjectResource res in DeletedList)
    if (res.ResourceId == resourceId)
      return true;
  return false;
}

Original issue reported on code.google.com by eslater%...@gtempaccount.com on 20 Dec 2010 at 1:09

GoogleCodeExporter commented 9 years ago

Original comment by bniemyjski on 27 Dec 2010 at 2:16

GoogleCodeExporter commented 9 years ago
Issue 538 has been merged into this issue.

Original comment by bniemyjski on 27 Dec 2010 at 2:17

GoogleCodeExporter commented 9 years ago
This issue was updated by revision r2528.

Added support for GetItem, Remove, Contains and Contains Deleted by PK

Original comment by bniemyjski on 9 Mar 2012 at 7:04

GoogleCodeExporter commented 9 years ago

Original comment by bniemyjski on 9 Mar 2012 at 7:06