Is ViewModel in asp.net comparable to ViewModel in WPF

If you know the MVVM template for WPF, then you know the Josh smith msdn article, where CustomerViewModel does not have a simple property, for example:

public string FirstName {get;set;}

Rather, the ViewModel wraps the model and delegates access to the resource as follows:

public string FirstName
{
    get { return _customer.FirstName; }
    set
    {
        if (value == _customer.FirstName)
            return;
        _customer.FirstName = value;
        base.OnPropertyChanged("FirstName");
    }
}

I have not seen this in asp.net mvc. Is this due to the lack of an INotifyPropertyChanged interface?

+2
source share
2 answers

I have not seen this in asp.net mvc

This is normal. You should not see him. MVC is a different template than MVVM. In MVC, no one should notify of any changes in the view. The MVVM template is not adapted to the statelessness of the website.

+2
source

ViewModel Model MVVM , MVC

MVVM ViewModel - , View . MVC View - , ViewModel , Controller .

. MVC M , , MVVM M .

, MVC M+C MVVM VM, MVC M MVVM M, VM

INotifyPropertyChanged WPF . MVC, .

+2

All Articles