private IEnumerable <string> CreateTypeProperties(string separator, IEnumerable <Type> types) { types.CheckArgument(nameof(types)); var result = new List <string>(); foreach (var type in types) { var entityName = CreateEntityNameFromInterface(type); var categoryKey = $"{SolutionProperties.SolutionName}{separator}{entityName}"; if (result.Any(e => e.StartsWith(categoryKey)) == false) { var dialogOptions = new DialogOptions() { ShowTitle = true, ShowClose = true, Left = string.Empty, Top = string.Empty, Bottom = string.Empty, Width = "800px", Height = string.Empty, }; var modelSetting = new ModelSetting(); var dataGridSetting = new DataGridSetting(); var dataGridHandlerSetting = new DataGridHandlerSetting(); result.Add($"{categoryKey}{separator}Setting{separator}{separator}{JsonSerializer.Serialize<ModelSetting>(modelSetting)}"); result.Add($"{categoryKey}DataGrid{separator}Setting{separator}{separator}{JsonSerializer.Serialize<DataGridSetting>(dataGridSetting)}"); result.Add($"{categoryKey}DataGrid{separator}HandlerSetting{separator}{separator}{JsonSerializer.Serialize<DataGridHandlerSetting>(dataGridHandlerSetting)}"); result.Add($"{categoryKey}DataGrid{separator}EditOptions{separator}{separator}{JsonSerializer.Serialize<DialogOptions>(dialogOptions)}"); result.Add($"{categoryKey}DataGrid{separator}DeleteOptions{separator}{separator}{JsonSerializer.Serialize<DialogOptions>(dialogOptions)}"); var contractHelper = new ContractHelper(type); var relations = contractHelper.GetDetailTypes(types); if (relations.Any()) { foreach (var relation in relations) { var detailEntityName = CreateEntityNameFromInterface(relation.To); //result.Add($"{categoryKey}{detailEntityName}DataGrid{separator}Setting{separator}{separator}{JsonSerializer.Serialize<DataGridSetting>(dataGridSetting)}"); } } } foreach (var pi in type.GetAllPropertyInfos()) { var fullKey = $"{categoryKey}{separator}{pi.Name}{separator}"; if (result.Any(e => e.StartsWith(fullKey)) == false) { var propertyHelper = new ContractPropertyHelper(pi); var displaySetting = new DisplaySetting() { ScaffoldItem = true, IsModelItem = false, ReadonlyMode = GetReadonlyMode(propertyHelper), VisibilityMode = GetVisibilityMode(propertyHelper), ListSortable = true, ListFilterable = true, ListWidth = GetListWitdh(propertyHelper), FormatValue = GetFormatValue(propertyHelper), Order = 10_000, }; result.Add($"{fullKey}{separator}{JsonSerializer.Serialize<DisplaySetting>(displaySetting)}"); } } } return(result); }