Questions tagged as 'viewmodel'

2
answers

What is a ViewModel in ASP.NET MVC?

I'm used to the MVC approach to frameworks like CakePHP and Laravel. Now that I'm delving into ASP.NET MVC, I'd like to understand what this ViewModel is for. What is the purpose of ViewModels?     
asked by 07.06.2018 / 18:31
2
answers

Difference between DTO and ViewModel?

In this question we can see what ViewModel is: Pra does a ViewModel serve in ASP.NET MVC? In this other question we can see what is DTO: What is a DTO? But after all: What's the difference between DTO and ViewModel? When should w...
asked by 07.06.2018 / 22:04
1
answer

AutoMapper Entities ViewModel

I have a scenario where my context returns a query for two User and CardCreditoUsuario entities, according to the following scenario below. During automapper action in my ViewModel, it is not mapping the entity CardCreditoUsuario for its prope...
asked by 01.12.2016 / 22:42
1
answer

Store content / variables in Model - PHP MVC

Hello, I'm starting to study the MVC standard for PHP. I have read several questions here in StackOverflow, I have already studied the Laravel documentation and read several articles. I chose the concept covered in this post as a basis -...
asked by 12.09.2016 / 03:32
2
answers

View Model should have related classes?

I have three entities: Manager , PersonalData and Address . A Manager has a PersonalData and a PersonalData has a Address . My question is when creating ViewModels , I would have to have a proper...
asked by 12.07.2016 / 23:15
1
answer

How to use ViewModel in MVC 5 C # with Entity Framework?

I'm trying to learn how to use the ViewModel concept, so I did a basic project, but I'm having difficulty. I have the following Models: Person id type document Physics id name surname document Juridica id...
asked by 02.09.2017 / 01:50
2
answers

Where to put the View Model rule

I need to create a View Model to use on the screen. I'm not sure where to put the button rule to be enabled or not. I thought of this implementation, I wonder if it's the best way. Another idea I had was to put the builder content in a...
asked by 05.12.2016 / 16:19
2
answers

Catch a selected item in Dropdownlistfor using an ASP.NET MVC ViewModel

I'm trying to register a Subcategory that needs a Category. I have the SubCategoryViewModel, where I created the public IEnumerable<CategoriaViewModel> Categorias { get; set; } and public Guid CategoriaId { get; set; } fields...
asked by 17.02.2017 / 01:06
0
answers

What is the best technique for using ViewModel with mvc C # lists?

I have two templates: event registration package and subscription package, where the template event registration package has a list of subscription packages (see the code below, I removed some fields). //Model public class PacoteInscricaoEvent...
asked by 09.01.2018 / 13:37
1
answer

How to use AutoMapper 6.2.2 in Asp MVC5?

Hello, how to use AutoMapper 6.2.2 in Asp MVC5 to map my view models to the domain model. Example: In MVC I use UserViewModel and User domain.     
asked by 14.12.2017 / 12:22