예제 #1
0
        public async Task <IActionResult> PutSession(string id, Session session)
        {
            if (id != session.SessionToken)
            {
                return(BadRequest());
            }

            context.Entry(session).State = EntityState.Modified;

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

            return(NoContent());
        }
예제 #2
0
        public async Task <IActionResult> PutUserType(string id, UserType userType)
        {
            if (id != userType.UserTypeId)
            {
                return(BadRequest());
            }

            context.Entry(userType).State = EntityState.Modified;

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

            return(NoContent());
        }
예제 #3
0
        public async Task <IActionResult> PutAddress(string id, Address address)
        {
            if (id != address.AddressId)
            {
                return(BadRequest());
            }

            context.Entry(address).State = EntityState.Modified;

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

            return(NoContent());
        }
예제 #4
0
        public async Task <IActionResult> PutStore(int id, Store store)
        {
            if (id != store.StoreId)
            {
                return(BadRequest());
            }

            context.Entry(store).State = EntityState.Modified;

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

            return(NoContent());
        }