public IFeature Find(object value, string primaryKey) { lock (_syncRoot) { return(Features.FirstOrDefault(f => ((f[primaryKey] != null) && (value != null)) && f[primaryKey].Equals(value))); } }
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))); } }
public IFeature Find(object value, string primaryKey) { return(Features.FirstOrDefault(f => f[primaryKey] != null && value != null && f[primaryKey].Equals(value))); }
/// <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)); }