public ActionResult <IEnumerable <Car> > GetCarsByMake(int?id) { if (id.HasValue && id.Value > 0) { return(Ok(((ICarRepo)MainRepo).GetAllBy(id.Value))); } return(Ok(MainRepo.GetAllIgnoreQueryFilters())); }
//-init //-view //-call //-return //-viewname <> public static void Main(string[] args) { IBonsaiStructureRepository MainRepo = null; var readerRepo = new ProjectReaderRepository(new FileService()); var commandParameters = from arg in args where arg.StartsWith('-') select arg; List <string> commandList = commandParameters.ToList(); var argument = "-viewname"; var functionParamaters = from arg in args where !arg.StartsWith('-') select new { argument, arg }; var str = functionParamaters.ToDictionary(key => key.argument, value => value.arg); foreach (var arg in commandParameters) { if (arg.Equals("-init", System.StringComparison.OrdinalIgnoreCase)) { MainRepo = new BonsaiFrameworkRepository( new FileService(), new SimpleCSharpProjectFactory(readerRepo), readerRepo); Console.WriteLine(str["-viewname"]); } if (arg.Equals("-view", System.StringComparison.OrdinalIgnoreCase)) { MainRepo = new BonsaiViewControlStructureRepository( new FileService(), new SimpleCSharpProjectFactory(readerRepo), readerRepo, str["-viewname"]); } if (arg.Equals("-call", System.StringComparison.OrdinalIgnoreCase)) { MainRepo = new BonsaiCallingStructureRepository( new FileService(), new SimpleCSharpProjectFactory(readerRepo), readerRepo, str["-viewname"]); } if (arg.Equals("-return", System.StringComparison.OrdinalIgnoreCase)) { MainRepo = new BonsaiReturnCallingStructureRepository( new FileService(), new SimpleCSharpProjectFactory(readerRepo), readerRepo, str["-viewname"]); } if (MainRepo != null) { MainRepo.RunSteps(); } else { Console.WriteLine("Please use paramters -init -view -call -return -viewname"); } } }
public AdminProductsController() { mainRepo = new MainRepo(db); }
public MainMenuController() { main = new MainRepo(new MyModel()); }
public ShoesController() { mainRepo = new MainRepo(db); }