Basaingeal / Razor.SweetAlert2

A Razor class library for interacting with SweetAlert2

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

'IServiceCollection' does not contain a definition for 'AddSweetAlert2'

boruchsiper opened this issue · comments

After Installing the nuget package, tried adding "services.AddSweetAlert2();" to Startup.cs. Getting this error message

Error CS1061 'IServiceCollection' does not contain a definition for 'AddSweetAlert2' and no accessible extension method 'AddSweetAlert2' accepting a first argument of type 'IServiceCollection' could be found (are you missing a using directive or an assembly reference?) Test C:....\Startup.cs 31 N/A

Did you added using CurrieTechnologies.Razor.SweetAlert2; in the top of your source file?

1- i installed package.
2-add builder.services. and in index page add using CurrieTechnologies.Razor.SweetAlert2;
3- how can I use basically show message.

public void OnPostSave()
{
Swal.FireAsync("Hello world!");
}
Swal does not exist in the current context. :(

Add this at the top of the file:

using CurrieTechnologies.Razor.SweetAlert2;

That was it. Thanks.