Beispiel #1
0
        private void TryAddingPeople(TablesDbContext dbContext)
        {
            dbContext.People.Add(new PersonRow {
                Id = Id1, Name = Name1, Surname = Surname1
            });

            dbContext.People.Add(new PersonRow {
                Id = Id2, Name = Name2, Surname = Surname2
            });

            dbContext.SaveChanges();
        }
Beispiel #2
0
 [HttpPost("createpolicy")] // Create New Policy
 public ActionResult <Policies> Post([FromBody] Policies newpolicy)
 {
     if (newpolicy == null)
     {
         return(BadRequest());
     }
     Context.policy.Add(newpolicy);
     Context.SaveChanges();
     return(Ok(newpolicy));
 }