示例#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());
        }
        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());
        }