public static DapperProject GlobalSelection(this DapperProject project, Action <DapperProjectSettings> action = null) { var settings = new DapperProjectSettings(); var selection = project.Selections.FirstOrDefault(item => item.IsGlobal); if (selection == null) { selection = new ProjectSelection <DapperProjectSettings> { Pattern = ProjectSelection <DapperProjectSettings> .GlobalPattern, Settings = settings }; project.Selections.Add(selection); } else { settings = selection.Settings; } action?.Invoke(settings); return(project); }
public static DapperProjectSettings RemoveAction <TAction>(this DapperProjectSettings settings) where TAction : IEntityAction { settings.Actions.Remove(settings.Actions.First(item => item is TAction)); return(settings); }