model-view-controller

SignalR call from controller

心已入冬 提交于 2021-01-28 07:51:14
问题 I'm needing to pass strings from my controller to a signalR hub and have it render on my page. I've followed along with the chat tutorial found at: https://docs.microsoft.com/en-us/aspnet/core/tutorials/signalr?view=aspnetcore-2.2&tabs=visual-studio The next step from the chat tutorial is breaking it out message call to my controller like so: [HttpPost] public async Task<IActionResult> Upload(string engineType) { try { var message = "File Upload Failed"; await _errorHub.Clients.All.SendAsync(

How do I get rid of the question mark in an ASP.NET MVC route?

孤者浪人 提交于 2021-01-27 21:22:53
问题 I have the following route defined: {theme}/{subtheme}/{contenttype}/{contentdetail}/Print When I use Url.Action ("PrintLayout","Page",new {contentUrlTitle = Model.ContentUrlTitle} I get the following link: /theme1/subtheme1/contenttype1/myfirstcontenturltitle?action=PrintLayout I'd like for it to be a RESTful URL. /theme1/subtheme1/contenttype1/myfirstcontenturltitle/Print Do you know what im missing here? 回答1: Since you haven't posted your routes Table (hint: Post your routes table), I'll

Posting Back DropDownList from Strongly Typed View

纵饮孤独 提交于 2021-01-07 03:52:42
问题 This is related to an earlier question on binding a dropdownlist from a database. The dropdownlist is being bound and populated but is throwing an "Object reference not set to an instance of an object" error in the browser when submitting the form. When debugging, I added a quick watch on the m => m.SelectedDepartment parameter of the Html.DropDownListFor(...) helper method and got: "Cannot convert lambda expression to type 'object' because it is not a delegate type". View: @model BudgetDemo

Xamarin bug-ish behaviour in CarouselView - CurrentItemChanged event fired unexpectedly?

心不动则不痛 提交于 2021-01-07 00:59:25
问题 While I was trying to implement an infinite scroll page I've encountered a strange behaviour with the CurrentItemChanged event of Xamarin.Forms.CarouselView . While the user scrolls, new items are added to the ItemSource and old items are removed (for low memory consumption). After I encountered the strange behaviour I've debugged and narrowed down the problem. So here are the steps to replicate the situation. Create a CarouselView . Create a ObservableCollection<T> in the code behind and

fetch additional data in to array from database

落爺英雄遲暮 提交于 2021-01-05 07:43:05
问题 i have standings array with team info and calculated points. But also i need to get goals count of each team. Need help how to fetch it to current array. This is my LeaguesController: public function standings(League $league, Team $team) { $standings = [ ]; $matches = Match::where('league_id', '=', $league->id)->get(); foreach($matches as $match) { $homeTeamScore = $match->score->home_team_score; $awayTeamScore = $match->score->away_team_score; if ($homeTeamScore === $awayTeamScore) { if

fetch additional data in to array from database

爷,独闯天下 提交于 2021-01-05 07:43:04
问题 i have standings array with team info and calculated points. But also i need to get goals count of each team. Need help how to fetch it to current array. This is my LeaguesController: public function standings(League $league, Team $team) { $standings = [ ]; $matches = Match::where('league_id', '=', $league->id)->get(); foreach($matches as $match) { $homeTeamScore = $match->score->home_team_score; $awayTeamScore = $match->score->away_team_score; if ($homeTeamScore === $awayTeamScore) { if

Dynamic Link at MVC model

主宰稳场 提交于 2021-01-01 08:46:50
问题 🙏🏻 How at this example send dynamic link to service class any time and after this update view I received link any time and I dont want to use notification and etc View var viewModel = HomeViewModel() func configureViewModel() { viewModel.resultClosure = { [weak self] listModel in guard let image = listModel.uiImage else { return } self?.updateImageViewConstraint(nil, image: image) } } HomveViewModel class HomeViewModel { var service = Services() var listModel = [ListModel]() { didSet {

Dynamic Link at MVC model

Deadly 提交于 2021-01-01 08:44:34
问题 🙏🏻 How at this example send dynamic link to service class any time and after this update view I received link any time and I dont want to use notification and etc View var viewModel = HomeViewModel() func configureViewModel() { viewModel.resultClosure = { [weak self] listModel in guard let image = listModel.uiImage else { return } self?.updateImageViewConstraint(nil, image: image) } } HomveViewModel class HomeViewModel { var service = Services() var listModel = [ListModel]() { didSet {

Dynamic Link at MVC model

一曲冷凌霜 提交于 2021-01-01 08:44:30
问题 🙏🏻 How at this example send dynamic link to service class any time and after this update view I received link any time and I dont want to use notification and etc View var viewModel = HomeViewModel() func configureViewModel() { viewModel.resultClosure = { [weak self] listModel in guard let image = listModel.uiImage else { return } self?.updateImageViewConstraint(nil, image: image) } } HomveViewModel class HomeViewModel { var service = Services() var listModel = [ListModel]() { didSet {

Dynamic Link at MVC model

坚强是说给别人听的谎言 提交于 2021-01-01 08:44:21
问题 🙏🏻 How at this example send dynamic link to service class any time and after this update view I received link any time and I dont want to use notification and etc View var viewModel = HomeViewModel() func configureViewModel() { viewModel.resultClosure = { [weak self] listModel in guard let image = listModel.uiImage else { return } self?.updateImageViewConstraint(nil, image: image) } } HomveViewModel class HomeViewModel { var service = Services() var listModel = [ListModel]() { didSet {