public void AddRelatedField(Field field) { if (!RelatedFields.Contains(field)) { RelatedFields.Add(field); } }
public void UpdateIndependentFieldsList(IFieldDependenciesRepository repository, FormGeneratorContext context) { var allDependFields = repository.GetAllDependFields(); var allIndependedFields = context.Field.AsNoTracking() .ToList() .Where(f => { return((!allDependFields.Contains(f)) && (f.Name != SuperiorFieldName) && (!RelatedFields.Contains(f))); }); AllIndependentFieldsName = JsonConvert.SerializeObject(allIndependedFields.Select(f => f.Name).ToList()); }