Esempio n. 1
0
 public GuestViewModel(Guest guest)
 {
     this.Id = guest.Id;
     this.FirstName = guest.FirstName;
     this.LastName = guest.LastName;
     this.Address = guest.Address;
 }
Esempio n. 2
0
 public IHttpActionResult PostGuest(Guest guest)
 {
     return StatusCode(HttpStatusCode.MethodNotAllowed);
 }
Esempio n. 3
0
 /// <summary>
 /// Inserts or update Guest.
 /// </summary>
 /// <param name="model">The model.</param>
 public void InsertOrUpdate(Guest model)
 {
     if (model.Id == 0)
     {
         _context.Guests.Add(model);
     }
     else
     {
         _context.Entry(model).State = EntityState.Modified;
     }
 }