c# call object by unique property -
I have a class referrals when you create an object in the class, it checks that the input string is unique (and therefore Does not allow duplicate objects). But when I think the input string str1 is equal to the one already created, instead of creating a new object or just returning false, I want to change the property of the already created object. But I can not figure out how to do this, because the purpose of this method is there is no way to know the name of the object. But I know something unique about it! I feel that anyway should be enough to call it, and I need to.
Any thoughts?
Thanks!
Here is the square:
public category referral {public class referrals {public string URL; Public dictionary & lt; String, int & gt; Keyword = new dictionary & lt; String, int & gt; (); Private Stable Dictionary & lt; String, string & gt; Url = new dictionary & lt; String, string & gt; (); Private Intel Hemnium URL; Private Butt Unique URL; Private Bull Unicache; Public Referral (String My URL, String Mykeyword, Int MyCurrence) // Constructor {if (HowManyURLs == 0} {URL = MyURL; Keywords (Add MyKeyword, MyOcureance); Add URL (My URL, MyKeyword); HowManyURLs ++; } Else {// Reset Phlange unique URL = true; for UniqueKeyword = true; (Int i = 0; I & lt; HowManyURLs; i ++) {if (URLs.ContainsKey (MyURL)) {// TRIP URL Flag Anus URL = false; // Now the URL & lt;
Why do not you make a list of referrals objects outside the referral object ? Thus you can see the list to see if the object with your criteria first From The Ujud. If so, update that item if not, then create a new one and add it to the list.
Either use that or a stable list, which has been declared even outside the referral class.
I 100% make sure where you are going, so hopefully one of those methods will work for you.
Comments
Post a Comment