Skip to content

Instantly share code, notes, and snippets.

@cyrilCodePro
Last active March 22, 2018 18:27
Show Gist options
  • Save cyrilCodePro/d348a914427a5291cf06af681b3bb508 to your computer and use it in GitHub Desktop.
Save cyrilCodePro/d348a914427a5291cf06af681b3bb508 to your computer and use it in GitHub Desktop.
public class Student
{
public Guid Id { get; set; }
public string Name { get; set; }
public int Marks { get; set; }
}
///////
public class StudentCrud
{
public static List<Student> GetStudents()
{
List<Student> test = new List<Student>();
var student = new Student
{
Id = Guid.NewGuid(),
Name = "Cyril",
Marks = 100
};
test.Add(student);
return test;
}
public static void AddTolist(string name,int marks)
{
var student = new Student
{
Id=Guid.NewGuid(),
Name=name,
Marks=marks,
};
GetStudents().Add(student);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment