public Field AsField(Process process) { if (_loadedField != null) return _loadedField; if (string.IsNullOrEmpty(Entity)) { _loadedField = process.GetAllFields().FirstOrDefault(f => f.Alias == Field) ?? process.GetAllFields().FirstOrDefault(f => f.Name == Field); return _loadedField; } Entity entity; if (process.TryGetEntity(Entity, out entity)) { if (entity.TryGetField(Field, out _loadedField)) { return _loadedField; } } return null; }
public Field AsField(Process process) { if (_loadedField != null) { return(_loadedField); } if (string.IsNullOrEmpty(Entity)) { _loadedField = process.GetAllFields().FirstOrDefault(f => f.Alias == Field) ?? process.GetAllFields().FirstOrDefault(f => f.Name == Field); return(_loadedField); } Entity entity; if (process.TryGetEntity(Entity, out entity)) { if (entity.TryGetField(Field, out _loadedField)) { return(_loadedField); } } return(null); }
public Field AsField(Process process) { if (_loadedField != null) { return(_loadedField); } if (string.IsNullOrEmpty(Entity)) { _loadedField = process.GetAllFields().FirstOrDefault(f => f.Alias.Equals(Field, StringComparison.OrdinalIgnoreCase)) ?? process.GetAllFields().FirstOrDefault(f => f.Name.Equals(Field, StringComparison.OrdinalIgnoreCase)); return(_loadedField); } Entity entity; if (process.TryGetEntity(Entity, out entity)) { if (entity.TryGetField(Field, out _loadedField)) { return(_loadedField); } } return(null); }