Esempio n. 1
0
 public IFeature Find(object value, string primaryKey)
 {
     lock (_syncRoot)
     {
         return(Features.FirstOrDefault(f => ((f[primaryKey] != null) && (value != null)) &&
                                        f[primaryKey].Equals(value)));
     }
 }
Esempio n. 2
0
        public IFeature Find(object value)
        {
            lock (syncRoot)
            {
                if (string.IsNullOrEmpty(Features.PrimaryKey))
                {
                    throw new Exception("ID Field was not set");
                }

                return(Features.FirstOrDefault(f =>
                                               ((f[Features.PrimaryKey] != null) && (value != null)) &&
                                               f[Features.PrimaryKey].Equals(value)));
            }
        }
Esempio n. 3
0
 public IFeature Find(object value, string primaryKey)
 {
     return(Features.FirstOrDefault(f => f[primaryKey] != null && value != null &&
                                    f[primaryKey].Equals(value)));
 }
Esempio n. 4
0
 /// <summary>
 /// Search for a feature
 /// </summary>
 /// <param name="value">Value to search for</param>
 /// <param name="fieldName">Name of the field to search in. This is the key of the T dictionary</param>
 /// <returns></returns>
 public T?Find(object?value, string fieldName)
 {
     return(Features.FirstOrDefault(f => value != null && f[fieldName] == value));
 }