All Questions

0
votes
0answers
64 views

To reduce code duplication in controller

This is my simple controller which is dependent on EventsViewModel. After fetching required fields, i am comparing the data returned and fill it into two variable and finally returning back ...
1
vote
1answer
1k views

Post viewmodel with List<T> to controller action method

I know there are a lot of posts out there regarding this, most of which I have read and tried all morning but still can't get it working. I have a view model as such: namespace GrantTracker....
13
votes
1answer
31k views

MVC ViewModel example

I've been doing tutorials and trying to learn best practice when it comes to MVC development. The design I'm using below comes from Pro ASP.Net MVC5 by Apress/Adam Freeman. So far, everything is ...
1
vote
2answers
37 views

What is the performance optimum (or even better coding practise) for writing this Linq query

I am new to linq so please excuse me if I am asking a very basic question: paymentReceiptViewModel.EntityName = payment.CommitmentPayments.First().Commitment.Entity.GetEntityName(); ...
1
vote
1answer
438 views

How to code a viewModel with nested classes

My web page / view will have 1 to many import records. Within each import record will be 0 to many of the following: Purchase Orders Shipping Containers Products Invoices I have coded my view model ...
0
votes
3answers
661 views

MVC2 controller not receiving all data from view on submit

I have an app that calls a web service to display import records based upon criteria entered by the user. Each "import" can have 0 to many PurchaseOrder, 0 to many Containers, 0 to many Products, 0 ...
10
votes
2answers
4k views

ViewData and ViewModel in MVC ASP.NET

I'm new to .Net development, and now are following NerdDinner tutorial. Just wondering if any of you would be able to tell me What is the differences between ViewData and ViewModel (all I know ...