We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Custom DataAdaptor with parameters

Thread ID:

Created:

Updated:

Platform:

Replies:

148304 Oct 14,2019 08:06 PM UTC Nov 13,2019 12:31 PM UTC Blazor 4
loading
Tags: Grid
Gereon Arz
Asked On October 14, 2019 08:06 PM UTC

Dear Syncfusion Team,

I try to create a Custom DataManager Adaptor where I have access to the IHttpContextAccessor or can use constructor injection.

But it seems like the DataAdaptor is only allowing a parameterless constructor.

Is there a way to either create the DataAdaptor instance through injection, so that it's possible to inject as many parameters as needed or initialize the AdaptorInstance in the own code and bind the 
AdaptorInstance instead of the type. (e.g. AdaptorInstance="@new TestAdapter(...)")

Or maybe there is an other way to solve my problem?

Regards, 
Gereon Arz







...
<EjsDataManager AdaptorInstance="@typeof(TestAdapter)" Adaptor="Adaptors.CustomAdaptor"></EjsDataManager>
...

@code {

      public class TestAdapter : DataAdaptor
     {    
            public TestAdapter(IHttpContextAccessor HttpContextAccessor) {  }
     }
}

Vignesh Natarajan [Syncfusion]
Replied On October 15, 2019 10:06 AM UTC

Hi Gereon,  
 
Thanks for contacting Syncfusion support.  
 
Query1: “so that it's possible to inject as many parameters as needed or initialize the AdaptorInstance in the own code. 
 
Currently we do not have  support to achieve your requirement. But since it is a known requirement, we have considered it as an improvement “Provide support to inherit DataAdaptor from OwningComponentBase”. At the planning stage for every release cycle, we review all open features and identify features for implementation based on specific parameters including product vision, technological feasibility, and customer interest. We have planned this feature for our 2019 Volume 3 Service pack 1 release (Bi-Weekly Nuget release) which is expected to be rolled out on or before 31st October 2019. We will let you know when this feature is implemented. 
 
You can track the current status of this feature request and also communicate with us regarding the open features any time using our Feature Report page. 
 
 
Till then we appreciate your patience. 
 
Regards,
Vignesh Natarajan.
 
 


Gereon Arz
Replied On October 16, 2019 08:30 PM UTC

Thanks for the reply. 

I'm looking forward to Volume 3 Service pack 1.

Regards, 
Gereon Arz

Vignesh Natarajan [Syncfusion]
Replied On October 17, 2019 04:56 AM UTC

Hi Gereon,  

Thanks for the update.  

We will get back to you once our Bi-Weekly Nuget release gets successfully rolls out.  

Regards,
Vignesh Natarajan. 


Vignesh Natarajan [Syncfusion]
Replied On November 13, 2019 10:00 AM UTC

Hi Gereon,  
 
We are glad to inform that our latest Nuget package (17.3.0.27-beta) has been successfully rolled out. In this release, we have migrated our Components to .Net Core 3.1 Preview 2 and also provided “Support to inherit dataadaptor from owingcomponentbase and to use dependency injection”. Please find the latest Nuget package from below and also find the release notes regarding the fixes we have included in this release.  
 
 
 
Also ensure that you have referred the latest version script and css as below  
 
  <link rel='nofollow' href="https://cdn.syncfusion.com/ej2/17.3.27/fabric.css" rel="stylesheet" /> 
 
 
Kindly refer our UG documentation for your reference  
 
 
Please get back to us if you have further queries. 
 
Regards, 
Vignesh Natarajan.

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon