public class Attendance
{
[Key][Column(Order = 1)]public int GigId { get; set; }[Key][Column(Order = 2)]public string AttendeeId { get; set; }public Gigs gig { get; set; }public ApplicationUser Attendee { get; set; }
}
in above Model: we need GigId and AttendeeId .
we are defined in list
but why create object of same class:
public Gigs gig { get; set; }
public ApplicationUser Attendee { get; set; }
this is ViewModel or Model ???

Saravanan VPosted Jun 13, 2017, 11:21 AM
First, you need to understand the purpose of ViewModel and Model classes.
The purpose of a ViewModel is for the view to have an object to render data in the Html page.
Your viewmodel( or presentation model) is specific to the view and you should not have the viewmodel referenced in any other layers of project except the presentation/Web layer.
I found below article which also explains the same.
http://www.c-sharpcorner.com/UploadFile/abhikumarvatsa/what-is-model-and-viewmodel-in-mvc-pattern/
Rajkiran SwainPosted Jun 13, 2017, 3:16 AM
Priyansh BhaliyaPosted Jun 13, 2017, 2:24 AM
Manikandan MurugesanPosted Jun 13, 2017, 2:12 AM