Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot resolve symbol AddSingleSoftDeleteQueryFilter #13

Open
MarcoGaribaldi opened this issue Jun 21, 2022 · 1 comment
Open

Cannot resolve symbol AddSingleSoftDeleteQueryFilter #13

MarcoGaribaldi opened this issue Jun 21, 2022 · 1 comment

Comments

@MarcoGaribaldi
Copy link

Ok, I am baffled. No idea why, but VS2022 refuses to recognize AddSingleSoftDeleteQueryFilter. I get the error "cannot resolve symbol AddSingleSoftDelete"

This is my OnModelCreating

        protected override void OnModelCreating(ModelBuilder builder)
        {
            builder.ApplyConfigurationsFromAssembly(Assembly.GetExecutingAssembly());
            base.OnModelCreating(builder);

            AddStronglyTypedIdConversions(builder);
            AddSingleSoftDelete(builder);
            AddDecimalPrecision(builder);
        }

The AddSingleSoftDelete method reports the same code as in your example

        private void AddSingleSoftDelete(ModelBuilder builder)
        {
            foreach (var entityType in builder.Model.GetEntityTypes())
            {
                if (typeof(ISingleSoftDelete).IsAssignableFrom(entityType.ClrType))
                {
                    entityType.AddSingleSoftDeleteQueryFilter();
                }
            }
        }

I double checked everything, even tried a previous version of the NuGet package, VS2022 refuses to resolve AddSingleSoftDeleteQueryFilter.

I have also created a ConfigSingleSoftDelete, as explained in your docs, and have zero problems.
Any idea on what may be wrong?

@JonPSmith
Copy link
Owner

Hi @MarcoGaribaldi,

The AddSingleSoftDeleteQueryFilter isn't part of the EfCore.SoftDeleteServices, but you can find the AddSingleSoftDeleteQueryFilter in the SingleQueryFilterExtensions in the DataLayer project. You need to copy that code and put it in your code.

I didn't include the SingleQueryFilterExtensions and CascadeQueryFilterExtensions in the library because I wanted the library allow the developer to do whatever they want to to, but I see it can cause problems. I'm going to leave this issue open and when I next update this library I will move the SingleQueryFilterExtensions and CascadeQueryFilterExtensions classes into the library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants