Link to home
Start Free TrialLog in
Avatar of scm0sml
scm0sml

asked on

one interface implementing another

I want to have the two interfaces below.

public interface IWriteable<T>
                where T : class
{
    void Add(T newEntity);
    void Remove(T entity);
}

Open in new window


public interface IReadable<T>
            where T : class
{
    IQueryable<T> FindAll();
    IQueryable<T> FindWhere(Expression<Func<T, bool>> predicate);
    T FindById(int id);
    T FindById(Guid id);
}

Open in new window


Basically I want to control certain elements of different aspects of my website.

So some repositories will only be able to read certain classes, some read/write.

What I want though is for IWriteable to also Implement IReadable as my attitude is if something has the permission to write it is ok to read.

Using my interface above how to I make Iwritebale implement IReadabale?
ASKER CERTIFIED SOLUTION
Avatar of kaufmed
kaufmed
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of scm0sml
scm0sml

ASKER

Thats exactly what I was after thanks!

Probably didint explain myself very well!
Probably didint explain myself very well!
I'd say you explained it just fine  = )

Glad to help!