Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public ObservableCollection<ParentModel> ParentCollection { get; set; }
- public List<Parent> ParentList { get; set; }
- public ParentModel ParentModel { get; set; }
- public MainViewModel()
- {
- Load();
- }
- public void Load()
- {
- using (RegistrationEntities registrationContext = new RegistrationEntities())
- {
- ParentList = registrationContext.Parents.ToList();
- for (int i = 0; i < ParentList.Count; i++)
- {
- ParentModel = new ParentModel()
- {
- PId = ParentList[i].P_Id,
- PLastName = ParentList[i].P_LastName,
- PFirstName = ParentList[i].P_FirstName,
- PMiddleName = ParentList[i].P_MiddleName,
- PAddress = ParentList[i].P_Address,
- PContactNo = ParentList[i].P_ContactNo,
- PEmail = ParentList[i].P_Email,
- PUsername = ParentList[i].P_Username,
- PPassword = ParentList[i].P_Password,
- PCreatedOn = ParentList[i].P_CreatedOn,
- PUpdatedAt = ParentList[i].P_UpdatedAt
- };
- ParentCollection.Add(ParentModel);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement