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 6776843
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T16:04:37+00:00 2026-05-26T16:04:37+00:00

I have custom control and I have interface this control exposes to it’s users.

  • 0

I have custom control and I have interface this control exposes to it’s users.

public interface ILookupDataProvider
    {
        void GetDataAsync(string parameters, Action<IEnumerable<object>> onSuccess, Action<Exception> onError);
    }

Need to implement it like so:

public class LookupDataProvider<T> : ILookupDataProvider
    {

        public void GetDataAsync(string parameters, Action<IEnumerable<T>> onSuccess, Action<Exception> onError)
        {
            var query = new EntityQuery<T>();
            this.entityManager.ExecuteQueryAsync(
                query,
                op =>
                    { 
                        if (op.CompletedSuccessfully)
                        {
                            onSuccess(op.Results);
                        } 
                        else if (op.HasError)
                        {
                            onError(op.Error);
                        } 
                    });
        }
    }

So, how do I tell that this generic method is really implementation of interface?

  • 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-26T16:04:38+00:00Added an answer on May 26, 2026 at 4:04 pm

    If you can change the class to be a generic method you could do this:

    public class LookupDataProvider : ILookupDataProvider
    {
    
        public void GetDataAsync<T>(string parameters, Action<IEnumerable<T>> onSuccess, Action<Exception> onError)
        {
    
        }
    
        void ILookupDataProvider.GetDataAsync(string parameters, Action<IEnumerable<object>> onSuccess, Action<Exception> onError)        
        {
             this.GetDataAsync<Object>(parameters, onSuccess, onError);
        }
    
    }
    

    Edit
    In regards to Kirk’s comment you need to move the type parameter on the method. While you could leave it on the class as well that can lead to interesting things. Run this code for example:

    class Program
    {
        static void Main(string[] args)
        {
            var b = new Foo<Guid>();
            b.Bar();
    
            Console.ReadLine();
        }
    }
    
    
    
    public class Foo<T> 
    {
    
        public void Bar<T>()
        {
            Console.WriteLine("Bar<T>() : " +typeof(T).Name);
        }
    
       public void Bar()        
        {
    
            Console.WriteLine("Bar() : " + typeof(T).Name);
            this.Bar<string>();
        }
    
    }
    

    This actually is a warning (and I’m surprised it’s not considered an exception)

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

Sidebar

Related Questions

I have custom control and I have interface this control exposes to it's users.
I have a custom WinForms control (inherits from control, i.e. without user interface jsut
I have a custom control that exposes a property. When I set it using
I have created a custom server control with properties implementing the ITemplate interface. It
I have a custom control (ascx) which implements the IPostBackEventHandler interface for intercepting custom
I have a custom button control created using ATL. This control is used by
I have custom server control contains templatefield when an out button clicked the field
I have a custom control that implements IPostBackEventHandler. Some client-side events invoke __doPostBack(controlID, eventArgs).
I have a custom control that inherits from WebControl and implements IValidator, but I
I have a custom control that has the following prototype. Type.registerNamespace('Demo'); Demo.CustomTextBox = function(element)

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.