public int Insert <T>(T entity) { if (typeof(T) == typeof(Bought)) { return(_boughtController.Insert(entity as Bought)); } if (typeof(T) == typeof(CompanyEndings)) { return(_companyEndingsController.Insert(entity as CompanyEndings)); } if (typeof(T) == typeof(CompanyNames)) { return(_companyNamesController.Insert(entity as CompanyNames)); } if (typeof(T) == typeof(DummyCompany)) { return(_dummyCompanyController.Insert(entity as DummyCompany)); } if (typeof(T) == typeof(Merchant)) { return(_merchantController.Insert(entity as Merchant)); } if (typeof(T) == typeof(Names)) { return(_namesController.Insert(entity as Names)); } if (typeof(T) == typeof(Sold)) { return(_soldController.Insert(entity as Sold)); } if (typeof(T) == typeof(Stock)) { return(_stockController.Insert(entity as Stock)); } if (typeof(T) == typeof(StockHistory)) { return(_stockHistoryController.Insert(entity as StockHistory)); } if (typeof(T) == typeof(StockMarket)) { return(_stockMarketController.Insert(entity as StockMarket)); } if (typeof(T) == typeof(Surnames)) { return(_surnamesController.Insert(entity as Surnames)); } if (typeof(T) == typeof(Taxes)) { return(_taxesController.Insert(entity as Taxes)); } return(-1); }