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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T12:16:52+00:00 2026-06-14T12:16:52+00:00

I have class Synonym, below: using System; using System.Collections.Generic; using System.Linq; using System.Text; using

  • 0

I have class Synonym, below:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Linq;


namespace Examples.NET
{
    public class Synonym
    {
        private string _kata;
        private List<string> _sinonim;

        public String Kata
        {
            get { return _kata; }
        }
        public List<string> Sinonim 
        {
            get 
            {
                return _sinonim; 
            }
        }

        public Synonym(string kata)
        {
            _kata = kata;
            List<string> _sinonim = new List<string>();

            XDocument xDoc = XDocument.Load("http://www.stands4.com/services/v2/syno.php?uid=2319&tokenid=LSRyvL5mGsHpEi4&word=" + kata);
            var sinonim = from isi in xDoc.Descendants("result")
                          select new
                          {
                              sinom = isi.Descendants("synonyms").First().Value
                          };
            foreach (var s in sinonim)
            {
                _sinonim.Add(s.sinom);
            }
        }

    }
}

in main program, i have code below:

Synonym Syn = new Synonym("buy");

System.Console.WriteLine(Syn.Kata);

var sinom = from s in Syn.Sinonim
            select s;
foreach (var item in sinom)
{
  System.Console.WriteLine("data: " + item);
}

but, there’s error: IN MAIN PROGRAM : “FROM S IN …..SELECT S”
===========>>Value cannot be null. AND Parameter name: source

I guess there’s error in class

  public List<string> Sinonim 
  {
   get{ return _sinonim;}
  }
  • 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-14T12:16:53+00:00Added an answer on June 14, 2026 at 12:16 pm

    That would indicate that your private list variable is never being assigned, which it is not.

    List<string> _sinonim = new List<string>();

    This hides the private instances because the names are the same. Change that line in your constructor to this and it should work

    _sinonim = new List<string>();

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have class with collection as below public class MyClass:IXmlSerializable { int vesrion; private
I have class with back reference: public class Employee : Entity { private string
I have class like this below shown. which contains the shopping items where the
I have class that looks like this: class A { public: class variables_map vm
I have class: public class EnglishWord implements Serializable, Comparable, Cloneable { static Logger logger
I have a Word model for a dictionary/thesaurus: public class Word { public virtual
I have my text fields defined as follows: <fieldType name=text class=solr.TextField positionIncrementGap=100 omitNorms=false> <analyzer
I have class which implements Countable, ArrayAccess, Iterator and Serializable. I have a public
I have a self-referential model class: public class Word { public virtual int Id
I have class two ViewModels //both IViewModel1 and IViewModel2 inherit from IViewModel public class

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.