Beispiel #1
0
        public async Task <string> PutNativeCity(NativeCity nativeCity)
        {
            _context.Entry(nativeCity).State = EntityState.Modified;
            await _context.SaveChangesAsync();

            return(string.Empty);
        }
Beispiel #2
0
        public async Task <Response> PutCitizen(Citizen citizen)
        {
            NativeCity nativeCity = await _context.NativeCity.FirstOrDefaultAsync(q => q.Id == citizen.IdNativeCity);

            if (nativeCity == null)
            {
                return(new Response {
                    Message = "The Native City does not exists"
                });
            }
            citizen.NativeCity            = nativeCity;
            _context.Entry(citizen).State = EntityState.Modified;
            await _context.SaveChangesAsync();

            return(new Response {
                Message = "Information modified sucefully"
            });
        }