public async Task <Trade> CreateTrade(string name) { //only add a trade if there's a name in the box if (String.IsNullOrEmpty(name)) { return(null); } var newTrade = new Trade { Name = name, Open = true }; await TradesRepository.Add(newTrade); _data.Trades.Add(newTrade); return(newTrade); }