57
1
using System;
2
using System.Linq;
3
using System.Collections.Generic;
4
5
6
public class Program
7
{
8
public static void Main()
9
{
10
// Student collection
11
IList<Student> studentList = new List<Student>() {
12
new Student() { StudentID = 1, StudentName = "John", Age = 18, StandardID = 1 } ,
13
new Student() { StudentID = 2, StudentName = "Steve", Age = 21, StandardID = 1 } ,
14
new Student() { StudentID = 3, StudentName = "Bill", Age = 18, StandardID = 2 } ,
15
new Student() { StudentID = 4, StudentName = "Ram" , Age = 20, StandardID = 2 } ,
16
new Student() { StudentID = 5, StudentName = "Ron" , Age = 21 }
17
};
18
19
IList<Standard> standardList = new List<Standard>() {
20
new Standard(){ StandardID = 1, StandardName="Standard 1"},
21
new Standard(){ StandardID = 2, StandardName="Standard 2"},
22
new Standard(){ StandardID = 3, StandardName="Standard 3"}
23
};
24
Cached Result
Error [Failed to validate 'Program+EmployeeRec' object.
The Id field is required.
] found. Ignoring record...
Id: 2
Name: Carl
Id: 3
Name: Mark
The Id field is required.
] found. Ignoring record...
Id: 2
Name: Carl
Id: 3
Name: Mark