예제 #1
0
        public async Task <UbigeoModel> Post(UbigeoModel entity)
        {
            _context.Set <UbigeoModel>().Add(entity);
            await _context.SaveChangesAsync();

            return(entity);
        }
예제 #2
0
        public async Task <UbigeoModel> Put(UbigeoModel entity)
        {
            _context.Set <UbigeoModel>().Attach(entity);
            _context.SetEntityState(entity);
            await _context.SaveChangesAsync();

            return(entity);
        }
예제 #3
0
        public static UbigeoResponse ToUbigeoResponse(UbigeoModel entity)
        {
            UbigeoResponse representation = new UbigeoResponse();

            if (entity != null)
            {
                representation.Id          = entity.Id;
                representation.Codigo      = entity.Codigo;
                representation.Descripcion = entity.Descripcion;
            }
            return(representation);
        }