public async Task <IActionResult> PutMusik(int id, Musik musik)
        {
            if (id != musik.Id)
            {
                return(BadRequest());
            }

            _context.Entry(musik).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!MusikExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
        public async Task <ActionResult <Musik> > PostMusik(Musik musik)
        {
            _context.musik.Add(musik);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetMusik", new { id = musik.Id }, musik));
        }
Пример #3
0
 private void Awake()
 {
     if (instance != null)
     {
         Destroy(gameObject);
     }
     else
     {
         instance = this;
         GameObject.DontDestroyOnLoad(gameObject);
     }
 }