public DataManager(string[] args, IMastRepository mastRepository) { this.mastRepository = mastRepository; //If default entry point contains no arguements if (args == null || args.Length == 0) { args = new string[1] { "No value" } } ; switch (args[0].ToUpper()) { case "MASTS": DatabaseValues = mastRepository.GetMastData(args[1], args[3]); MainWindow = new MainWindow <IVOAType> { DataType = DatabaseValues, ExternalFilePath = args[4] }; break; default: MainWindow = new MainWindow <IVOAType>(); break; } }
public MastQuery(IMastRepository mastService) { Field <FilteredMastType>( "filteredmast", arguments: new QueryArguments( new QueryArgument <IntGraphType> { Name = "pageSize", Description = "size of page" }, new QueryArgument <IntGraphType> { Name = "pageNumber", Description = "page of list data" }, new QueryArgument <IntGraphType> { Name = "lon", Description = "filter params" }, new QueryArgument <IntGraphType> { Name = "lat", Description = "filter params" } ), resolve: context => { int pageSize = context.GetArgument <int>("pageSize"); int pageNumber = context.GetArgument <int>("pageNumber"); int?lon = context.GetArgument <int?>("lon", defaultValue: null); int?lat = context.GetArgument <int?>("lat", defaultValue: null); return(mastService.GetMast(pageSize, pageNumber, lon, lat)); } ); }