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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T13:15:44+00:00 2026-06-11T13:15:44+00:00

I wrote services class. public partial class ProductService : IProductService { #region Constants private

  • 0

I wrote services class.

 public partial class ProductService : IProductService
    {
        #region Constants

        private const string PRODUCTVARIANTPRICERANGE_PATTERN_KEY = "Nop.productVariantPriceRange.";
        #endregion

        #region Fields


        private readonly IRepository<ProductVariantPriceRange> _productVariantPriceRangeRepository;

        public ProductService(ICacheManager cacheManager,

            IRepository<ProductVariantPriceRange> productVariantPriceRangeRepository,
            )
        {

            this._productVariantPriceRangeRepository = productVariantPriceRangeRepository;

        }

        #endregion

Then write a function

 public virtual void CheckProductVariantPriceRange(int productVariantPriceRangeId)
        {
            bool flage=true;
            var query = _productVariantPriceRangeRepository.Table;

               query = query.Where(m => m.ProductVariantId.Contains(productVariantPriceRangeId));


            var ProductVariantPriceRangeS = query.ToList();
            if (ProductVariantPriceRangeS.Count == 0)
            {
                flage = false;
            }

        }

but It occur the flowing error..

  1. Instance argument: cannot convert from 'int' to 'System.Linq.IQueryable<int>'

  2. ‘int’ does not contain a definition for ‘Contains’ and the best extension method overload
    ‘System.Linq.Queryable.Contains(System.Linq.IQueryable, TSource)’ has some invalid arguments

I don’t know what is this error.
How can I solve this..
Plz help

  • 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-06-11T13:15:45+00:00Added an answer on June 11, 2026 at 1:15 pm

    The ProductVariantId property is not a collection, it’s a single value. You should compare the value in the property for each record to the desired value:

    query = query.Where(m => m.ProductVariantId == productVariantPriceRangeId);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In the project im working on, people wrote services class to access DAO. Almost
I wrote an application that runs a service(class MyService) when BOOT_COMPLETED received. public class
I wrote a windows service to call my class library every 10 mins interval,it
I am newbie. I wrote a class, that implements service and uses gps, but
I wrote a web service API which services REST requests in php. It didn't
I am writing for my desktop some application for handling some services. I wrote
I wrote a windows service in C# that does some functionality (a public method)
I have a class that implements an interface. The interface is public interface IRiskFactory
I wrote a small tcp client using boost::asio, providing the following function: typedef boost::function<void(const
I am trying to setup my MessageServer class so that it services each client

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.