コード例 #1
0
        public async Task <int> Update(ClientAllowedGrantTypes clientAllowedGrantTypes)
        {
            var info = await GetInfo(clientAllowedGrantTypes.Id);

            if (info == null)
            {
                return(-1);
            }

            info.AllowedGrantType = clientAllowedGrantTypes.AllowedGrantType;
            return(await Context.SaveChangesAsync());
        }
コード例 #2
0
        public async Task <int> Insert(ClientAllowedGrantTypes clientAllowedGrantTypes)
        {
            var isExists =
                await CheckExists(clientAllowedGrantTypes.ClientId, clientAllowedGrantTypes.AllowedGrantType);

            if (isExists)
            {
                return(-1);
            }

            _clientAllowedGrantTypeRepository.Create(clientAllowedGrantTypes);
            return(await Context.SaveChangesAsync());
        }