public void TestGetEnergyItemStatisticViewModelByUserName() { EnergyItemStatisticService service = new EnergyItemStatisticService(); EnergyItemStatisticViewModel ViewModel = service.GetViewModelByUserName("admin"); Console.WriteLine(UtilTest.GetJson(ViewModel)); }
public object Get() { string userName = User.Identity.Name; try { return(service.GetViewModelByUserName(userName)); } catch (Exception e) { return(e.Message); } }