Beispiel #1
0
 public void InsertJobDetails()
 {
     using (var context = new CRUDOperationContext())
     {
         var job = new Job();
         Console.WriteLine("Insert Job details");
         Console.WriteLine("Job Id:");
         job.Id = int.Parse(Console.ReadLine());
         Console.WriteLine("Job Role:");
         job.Role = Console.ReadLine();
         Console.WriteLine("Job PersonId:");
         job.PersonId = int.Parse(Console.ReadLine());
         context.jobs.Add(job);
         context.SaveChanges();
         Console.WriteLine("Records successfully installed into Job table.....");
     }
 }
Beispiel #2
0
        public void InserPersonDetails()
        {
            var context = new CRUDOperationContext();
            var person  = new Person21()
            {
                FirstName = Console.ReadLine(),

                LastName = Console.ReadLine(),

                Age = int.Parse(Console.ReadLine()),

                Gender = Console.ReadLine(),
                Mobile = long.Parse(Console.ReadLine())
            };

            context.persons.Add(person);
            context.SaveChanges();
            Console.WriteLine("Records successfully installed into Person table.....");
        }
Beispiel #3
0
 public void InserPersonDetails()
 {
     using (var context = new CRUDOperationContext())
     {
         var person = new Person();
         Console.WriteLine("Insert Person details");
         Console.WriteLine("PersonID:");
         person.PersonId = int.Parse(Console.ReadLine());
         Console.WriteLine("FirstName:");
         person.FirstName = Console.ReadLine();
         Console.WriteLine("LastName:");
         person.LastName = Console.ReadLine();
         Console.WriteLine("Age:");
         person.Age = int.Parse(Console.ReadLine());
         Console.WriteLine("Gender:");
         person.Gender = Console.ReadLine();
         Console.WriteLine("Mobile:");
         person.Mobile = long.Parse(Console.ReadLine());
         context.persons.Add(person);
         context.SaveChanges();
         Console.WriteLine("Records successfully installed into Person table.....");
     }
 }