示例#1
0
        /// <summary>
        /// This Creates an Orchestra by takeing in a orchestra object and checks to make sure it is not null the sets
        /// the Id to zero and adds the object to the database, then saves the changes. If the
        /// the object is null then it returns the view object information unsaved.
        /// </summary>
        /// <param name="orchestra"></param>
        /// <returns>orchestra</returns>
        public Orchestra CreateOrchestra(Orchestra orchestra)
        {
            if (orchestra != null)
            {
                orchestra.Id = 0;
                _db.Orchestra.Add(orchestra);
                _db.SaveChanges();
            }

            return(orchestra);
        }
示例#2
0
 public void Post([FromBody] Models.Queue queue)
 {
     _context.Queues.Add(queue);
     _logger.LogInformation("Created a new Queue: { queue } ", queue.ToString());
     _context.SaveChanges();
 }