示例#1
0
        private void ImportarInterpretes(JObject obj)
        {
            var arr = obj["interpretes"] as JArray;

            if (arr == null)
            {
                return;
            }

            foreach (var token in arr)
            {
                var id     = token.Value <int>("id");
                var nombre = token.Value <string>("nombre");
                _ctx.DbSetInterprete.AddOrUpdate(new Interprete {
                    Id = id, Nombre = nombre, FchCreacion = _fch
                });
            }
            _ctx.SaveChanges();
        }
示例#2
0
 public void Guardar(Interprete entidad)
 {
     _ctx.DbSetInterprete.AddOrUpdate(entidad);
     _ctx.SaveChanges();
 }