Skip to content

Instantly share code, notes, and snippets.

@straubt1
Created August 21, 2015 12:28
Show Gist options
  • Save straubt1/de868ca8d842bd6147da to your computer and use it in GitHub Desktop.
Save straubt1/de868ca8d842bd6147da to your computer and use it in GitHub Desktop.
AOPinIoC_ProjectDataLocal
public class ProjectDataLocal : IProjectData
{
private List<ProjectItem> _masterList;
public ProjectDataLocal()
{
_masterList = new List<ProjectItem>
{
new ProjectItem { Id = Guid.Parse("5843b73d-45f7-4284-86cf-c2f07821e01d"), Name ="Item 1", ItemType = "A" },
new ProjectItem { Id = Guid.Parse("9815b73d-45f7-4284-86cf-c2f07821e01d"), Name ="Item 2", ItemType = "A" },
new ProjectItem { Id = Guid.Parse("2100b73d-45f7-4284-86cf-c2f07821e01d"), Name ="Item 3", ItemType = "B" },
new ProjectItem { Id = Guid.Parse("8688b73d-45f7-4284-86cf-c2f07821e01d"), Name ="Item 4", ItemType = "C" }
};
}
public List<ProjectItem> GetAllItems()
{
return _masterList;
}
public ProjectItem GetItemById(Guid id)
{
return _masterList.Single(x => x.Id == id);
}
public ProjectItem GetItemByName(string name)
{
return _masterList.Single(x => x.Name == name);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment