Generic Repository Pattern C