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

  • Home
  • SEARCH
  • 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 6865789
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T03:05:52+00:00 2026-05-27T03:05:52+00:00

In our current project I am using a generic interface iService which is inherited

  • 0

In our current project I am using a generic interface iService which is inherited by all other service interfaces. For instance IService is inherited by ILogService.

The ILogService interface is then implemented by LogService as below:

Public Interface IService(Of T)
    Sub Save(ByVal T As IEntity)
    Sub Remove(ByVal T As IEntity)
    Function FindBy(ByVal Id As Guid) As T
    Function FindAll() As IEnumerable(Of T)
End Interface

Public Interface ILogService
    Inherits IService(Of Log)


    Function FindLogsByOwner(ByVal Owner As Guid, ByVal visibility As LogVisibility) As IList(Of Log)
    Function FindAllLogsByVisibility(ByVal visibility As LogVisibility) As IList(Of Log)
    Function FindAllLogsByType(ByVal type As LogType) As IList(Of Log)

End Interface

Public Class LogService
    Implements ILogService


    Public Function FindAll() As System.Collections.Generic.IEnumerable(Of Model.CSLS.Log) Implements Infrastructure.Domain.IService(Of Model.CSLS.Log).FindAll

    End Function

    Public Function FindBy(Id As System.Guid) As Model.CSLS.Log Implements Infrastructure.Domain.IService(Of Model.CSLS.Log).FindBy

    End Function

    Public Sub Remove(T As Infrastructure.Domain.IEntity) Implements Infrastructure.Domain.IService(Of Model.CSLS.Log).Remove

    End Sub

    Public Sub Save(T As Infrastructure.Domain.IEntity) Implements Infrastructure.Domain.IService(Of Model.CSLS.Log).Save

    End Sub

    Public Function FindAllLogsByType(type As Model.CSLS.LogType) As System.Collections.Generic.IList(Of Model.CSLS.Log) Implements Model.CSLS.ILogService.FindAllLogsByType

    End Function

    Public Function FindAllLogsByVisibility(visibility As Model.CSLS.LogVisibility) As System.Collections.Generic.IList(Of Model.CSLS.Log) Implements Model.CSLS.ILogService.FindAllLogsByVisibility

    End Function

    Public Function FindLogsByOwner(Owner As System.Guid, visibility As Model.CSLS.LogVisibility) As System.Collections.Generic.IList(Of Model.CSLS.Log) Implements Model.CSLS.ILogService.FindLogsByOwner

    End Function
End Class

Help Needed: I am trying to understand that when I am implementing ILogService interface I still get the functions/subs in the LogService class containing:

  • method parameter T of Type IEntity instead of Log

How can I update the method signature so T is displayed as Log?

What am I doing wrong?

  • 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-05-27T03:05:52+00:00Added an answer on May 27, 2026 at 3:05 am

    Are you talking about these?

    Sub Save(ByVal T As IEntity)
    Sub Remove(ByVal T As IEntity)
    

    This is very confusing, because in the above methods T is the name of a method parameter, not a generic type parameter. It could just as easily have been foo or bar. In each case the type of T is IEntity.

    If the intention here was that Save and Remove should each accept an argument of type T, but that type T must implement IEntity, this is how you would express that:

    Public Interface IService(Of T As IEntity)
        Sub Save(ByVal entity As T)
        Sub Remove(ByVal entity As T)
        Function FindBy(ByVal Id As Guid) As T
        Function FindAll() As IEnumerable(Of T)
    End Interface
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

For the current project we're using JSR-303 annotations to validate our interface parameters. I
in our current project we are using ADO.NET Entity Framework as data layer for
So while we're using foreign keys in our current project, I've heard the argument
In my current project we are testing our ASP.NET GUI using WatiN and Mbunit
For our current J2EE project based on JBoss, we need to interface with a
On our current WPF project, we've been performing dependency injection using the Ninject IOC
Our current project does not use Hibernate (for various reasons) and we are using
We are using CDO interop (cdont.dll) in our current project for parsing incoming mime
Our current project has ran into a circular dependency issue. Our business logic assembly
In our current project we are providing a PDF download that can be customized

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.