Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SimpleStubs.json file generating stubs for ignored interface #1

Closed
yeasin90 opened this issue Jun 6, 2016 · 3 comments
Closed

SimpleStubs.json file generating stubs for ignored interface #1

yeasin90 opened this issue Jun 6, 2016 · 3 comments

Comments

@yeasin90
Copy link

yeasin90 commented Jun 6, 2016

I have an interface like below :

namespace RepoLib.Data.RepositoryInterface
{
    public interface IRepository<TDomain, TEntity> where TEntity : IEntity
    {
        Task InsertOrUpdateAsync(TDomain domainObject);
        Task InsertOrUpdateAsync(List<TDomain> domainObjects);
    }

    public interface IMyRepository : IRepository<MyDomainClass, MyEntityClass>
    {
        Task<List<MyDomainClass>> GetSomethingExceptional();
    }
}

namespace RepoLib.Data.Repository
{
    public interface MyRepository : IMyRepository 
    {
        // Interface implementation
    }
}

I don't want to generate stubs for IRepository interface, so I did below in SimpleStubs.json

{
    "IgnoredProjects": [
        "MyLib.Common",
        "MyLib.Domain",
        "MyLib.Framework"
      ],
  "IgnoredInterfaces": [
    "RepoLib.Data.RepositoryInterface.IRepository"
  ],
    "StubInternalInterfaces": false    
}

Problem is, when I build, it still generating stubs for IRepository

@nehmebilal
Copy link
Collaborator

nehmebilal commented Jun 6, 2016

Hi Yeasin,

I believe you need to specify the generic parameters as well:

RepoLib.Data.RepositoryInterface.IRepository<TDomain, TEntity>

Otherwise, simplestubs assumes that you are trying to exclude the non-generic interface. You can add both if you want to ignore both.

@yeasin90
Copy link
Author

yeasin90 commented Jun 6, 2016

Yes, now it's working thanks :) . I guess this can be added in the tutorial doc.
I am closing this issue 👍

@yeasin90 yeasin90 closed this as completed Jun 6, 2016
@nehmebilal
Copy link
Collaborator

@yeasin90 Thanks for confirming. Also, please feel free to submit a PR for the tutorial enhancement you're suggesting :)

nehmebilal pushed a commit that referenced this issue Feb 13, 2018
Fix exe path in targets file and update nuspec
nehmebilal pushed a commit that referenced this issue May 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants