Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8334525
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T03:23:07+00:00 2026-06-09T03:23:07+00:00

I am trying to implement a generic interface with vb. Public Interface IGenericRepository(Of T)

  • 0

I am trying to implement a generic interface with vb.

Public Interface IGenericRepository(Of T)

    Function getAll() As IQueryable(Of T)
    Function [get](ByVal id As Integer) As T
    Sub saveOrUpdate(BaseDTO As T)
    Sub delete(BaseDTO As T)
End Interface

Public Interface IWorkItemRepository
    Inherits IGenericRepository(Of WorkItem)

    Function getWorkItemsByRequestor(ByVal username As String) As IList(Of WorkItem)
End Interface

Public Class WorkItemRepository
    Inherits genericRepository(Of WorkItem)
    Implements IWorkItemRepository

End Class

I don’t want to replicate the concrete implementations of the shared methods in Iworkitemrepository.

How do I achieve this with inheritance?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T03:23:08+00:00Added an answer on June 9, 2026 at 3:23 am

    If you have shared code you don’t want to reproduce, you need a base implementation.

    Public Interface IInterface(Of T)
      Sub X
      Sub Y
    End Interface
    
    Public MustInherit Class BaseImpl
     Implements IInterface(Of MyClass)
    
     Sub X() Implements IInterface(Of MyClass)
       '//stuff here
     End Sub
    
     MustOverride Sub Y() Implements IInterface(Of MyClass)
    
    End Class
    
    Public Class DerivedImpl
      Inherits BaseImpl
    
      Overrides Sub Y()
         'do different stuff
      End Sub
    End Class
    
    Public Class AnotherImpl
      Inherits BaseImpl
    
      Overrides Sub Y()
         'do different stuff
      End Sub
    End Class
    

    All of the above should be able to case to IInterface(Of MyClass)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to implement a generic java interface in scala. I have looked at:
I am trying to implement a generic timer function in OCaml which will take
I am trying to implement generics in Java using Comparable<T> interface. public static <T>
So I'm trying to create an interface with a generic function to be overrided
I am trying to implement generic repository pattern using LINQ to SQL data context.
I'm trying to implement a generic configuration file parser and I'm wondering how to
I am trying to implement a generic repository pattern. I found this site which
I'm trying to implement a generic way of adding remote validation to xVal /
When using ASP.NET MVC plus Entity Framework, and trying to implement a generic repository
I'm trying to implement the repository pattern using a generic repository like the one

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.