This is the first time i deal with custom validations, but I need to create a unique email validation using sitecore 9.0.2 and SXA 1.7.1 so i was following this tutorial
but i have a problem with this method:
protected virtual IFormDataProvider FormDataProvider
{
get
{
IFormDataProvider formDataProvider = this._dataProvider;
if (formDataProvider == null)
{
IFormDataProvider service = ServiceLocator.ServiceProvider.GetService<IFormDataProvider>();
IFormDataProvider formDataProvider1 = service;
this._dataProvider = service;
formDataProvider = formDataProvider1;
}
return formDataProvider;
}
}
specifically this line:
IFormDataProvider service = ServiceLocator.ServiceProvider.GetService<IFormDataProvider>();
saying that:
'IServiceProvider' does not contain a definition for 'GetService' and the best extension method overload 'DependencyResolverExtensions.GetService(IDependencyResolver)' requires a receiver of type 'IDependencyResolver'
Any ideas what might be the cause ?
Microsoft.Extensions.DependencyInjection.Abstractions.dll
?