Questions tagged [generic-interface]
42 questions
                    
                    23
                    
            votes
                
                1 answer
            
        How to bind Generic-type interfaces in Ninject
I'm fairly new to Ninject, and found myself stumbling when I came to implement a generic repository pattern.  I want to bind a dependency IRepository to a class ConcreteRepository where ConcreteRepository implements…   
         
    
    
        McGarnagle
        
- 101,349
- 31
- 229
- 260
                    12
                    
            votes
                
                1 answer
            
        Generic interface overloading. Valid terminology?
Here is a very basic example of method overloading , two methods with the same name but with different signatures :
int MyMethod(int a)
int MyMethod(int a, string b)
Now let's say I define two generic interfaces, sharing the exact same name but…
         
    
    
        darkey
        
- 3,672
- 3
- 29
- 50
                    11
                    
            votes
                
                1 answer
            
        Unchecked call to method as a member of raw type
Following warning is shown in my project -
Unchecked call to 'getWeatherData(T,Boolean,String)' as a member of raw type 'IWeatherCallbackListener'.
I have created following interface - 
public interface IWeatherCallbackListener {
 void… 
         
    
    
        Akash Bisariya
        
- 3,855
- 2
- 30
- 42
                    7
                    
            votes
                
                2 answers
            
        Avoid displaying 3 time a struct
I have define a struct as below,
(struct vector (x y z)
  #:methods gen:custom-write
  [(define (write-proc vector port mode)
     (let ([print (if mode write display)])
       (write-string "<")
       (print (vector-x vector))
       (write-string…
         
    
    
        mathk
        
- 7,973
- 6
- 45
- 74
                    6
                    
            votes
                
                3 answers
            
        Generic interfaces
Here is my code
public interface ITranslator
{       
    E ToEntity(R record);
}
class Gens : ITranslator
{
    #region ITranslator Members
    public string ToEntity(int record)
    {
       …     
         
    
    
        ram
        
- 11,468
- 16
- 63
- 89
                    4
                    
            votes
                
                1 answer
            
        How to deserialize generic interface to generic concrete type with Json.Net?
I have below interface:
public interface IInterface
{
    M Message { get; }
    string Str { get; }
}
And its implementation:
public class Implementation : IInterface
{
    public M Message;
    public string Str;
    public…   
         
    
    
        AbbasFaisal
        
- 1,428
- 2
- 18
- 21
                    4
                    
            votes
                
                2 answers
            
        interface generic hierarchy
I have some generic interface linked one to each other.
public interface IA
{
    int val { get; set; }
}
public interface IB where T:IA
{
    T a_val { get; set; }
}
public interface IC where T : IB
{
    T b_val { get; set; }
}
public…   
         
    
    
        Alex Troto
        
- 651
- 6
- 18
                    3
                    
            votes
                
                2 answers
            
        Using isAssignableFrom() with generic interface
I try to find a way to do it but i didn't find out, please let me know if my question has already been asked.
Basically i have a generic interface Evaluator with a single method E evaluate(T a, T b) which will be implemented by lot of classes… 
         
    
    
        Faylixe
        
- 478
- 6
- 12
                    3
                    
            votes
                
                1 answer
            
        Using nested type declared in a generic class within the generic interface that the class is implementing
I have a generic List-like class tMyList with a method Each() which iterated over each element and calls anonymous procedure tMyList.enumProc with paramenter - the current item of type .
I want to implement the class as an Interface for…
         
    
    
        iPath ツ
        
- 2,468
- 20
- 31
                    2
                    
            votes
                
                2 answers
            
        Use IsAssignableTo with open generic interfaces
I'm trying to get all the interfaces (they are all open generic) derived from IService that a Random class implements. I'm sure that at least one interface Random is implementing inherits from IService<,> but no items is being added to the…
         
    
    
        Guido Glielmi
        
- 73
- 1
- 5
                    2
                    
            votes
                
                1 answer
            
        How to get user related data with Generic Interface in OTRS 6?
I wonder how to get User Data with Generic Interface. It seems that there is no Controller to get User Data...
these are the only controllers:
So how can I add user methods to my webservices?
I tried adding a User section in my webservice.yml and…
         
    
    
        artgrohe
        
- 3,082
- 2
- 25
- 31
                    2
                    
            votes
                
                2 answers
            
        Java generic interface calling with abstract parameter
I know there's many similar question but I had no luck finding a nice and clean solution if it's possible at all.
I'm implementing a generic interface with subclasses of an abstract type. Problem is that when I'm calling them I either must do type…
         
    
    
        David Horáček
        
- 67
- 6
                    2
                    
            votes
                
                2 answers
            
        C# Check for implementation of generic interface
How do I check that a class implements a generic interface in any way?
I have the following:
public class SomeQueryObject : IQueryObject
{
    public SomeQueryDto query { get; set; } = new SomeQueryDto();
}
public class SomeQueryDto :… 
         
    
    
        lanky393
        
- 292
- 4
- 12
                    2
                    
            votes
                
                2 answers
            
        Using generic interface as typeparameter for a method or function
Assuming the following interface which I use to define the parameter type and return type for a stored procedure...
public interface IStoredProcedure
    where TReturn : class 
    where TParameter : class
{
    TReturn… 
         
    
    
        Dib
        
- 2,001
- 2
- 29
- 45
                    2
                    
            votes
                
                1 answer
            
        Generic Interface missing implementation
I have a generic interface, even if I state the type when I implement it, it says the implemented classes misses all implementation of members.
The interface
Interface IBuilder(Of T)
    Function Number(ByVal literal As String) As T
End…
         
    
    
        Insecurefarm
        
- 391
- 5
- 16