Hi Gian Marco!
I saw you have the
BaseClass class with the
BaseMethod in the
ExtDirectHandler.Tests project. So i want to
BaseMethod could be also available by RPC. So i made this pull request
https://github.com/gimmi/extdirecthandler/pull/14 The main difference is new
RegisterType<T>(bool inherit) method that will include inherited members in derived classes.
Sample use case: i have base generic class (let's call it BaseRepository) that can Add, Update and Delete records in my database:
public class BaseRepository<T>
where T: class
{
public IQueryable<T> Get()
{
// get all records
}
public T Add(T item)
{
// adding methods
}
public T Update(T item)
{
// updating methods
}
public void Delete(int id)
{
// deleting methods
}
}
And then i want to create a lot of child repositories that must have base functionality and may have some extra functionality:
public class UserRepository: BaseRepository<User>
{
}
public class OrderRepository: BaseRepository<Order>
{
public IEnumerable<Order> GetOrdersByDate(DateTime date)
{
return this.Get().Where(o => o.Date == date);
}
}
//...
After this i register both UserRepository and OrderRepository and want that all their methods (include inherited) to be available in ExtJS.
I know this example is very simple but you catched the idea :)
That is why a made a fork. What do you think on this?