public UserBuildingViewModel GetViewModel(string userName) { UserBuildingViewModel userBuildingViewModel = new UserBuildingViewModel(); userBuildingViewModel.UserBuildings = context.GetUserBuildings(userName); return(userBuildingViewModel); }
public UserBuildingViewModel GetViewModel() { List <User> users = context.GetUsers(); string userName; if (users.Count > 0) { userName = users[0].UserName; } else { userName = ""; } UserBuildingViewModel userBuildingViewModel = new UserBuildingViewModel(); userBuildingViewModel.Users = users; userBuildingViewModel.UserBuildings = context.GetUserBuildings(userName); return(userBuildingViewModel); }