public person CreatePerson(person person)
        {
            var CreatedPerson = _context.People.Add(person).Entity;

            _context.SaveChanges();
            return(CreatedPerson);
        }
 public Person CreatePerson(Person person)
 {
     try
     {
         _context.People.Add(person);
         _context.SaveChanges();
         return(person);
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex.Message);
         return(null);
     }
 }
Exemple #3
0
 public Person CreatePerson(Person person)
 {
     try
     {
         _context.People.Add(person);
         _context.SaveChanges();
         return(person);
     }
     catch (Exception ex)
     {
         Console.WriteLine("Henkilön lisääminen epäonnistui" + ex.Message);
         return(null);
     }
 }