Menu

PDB MVC

lcnvdl

PhantomDb MVC

PhantomDb MVC es una extensión que permite poder configurar y utilizar PDB en ASP.NET y ASP.NET MVC de una manera sencilla. Incluye un ejemplo en el que se integran las DLL nombradas anteriormente. Requiere .NET Framework 4.0.

Configuración

Para realizar la configuración, se deben realizar dos pasos:

1. Web Config

Dentro de Web.config agregar:

En configSections:

<section name="Phantom" type="PhantomDb.MVC.Configuration.Phantom, PhantomDb.MVC" />

Luego agregar la sección:

<Phantom>
  <Schemas>
    <Schema
      name=<Nombre del esquema>
      connection=<String connection>
      context=<Referencia al contexto>
      handler=<Referencia al manejador>
      />
  </Schemas>
</Phantom>

Ejemplo de configuración para MySQL:

<?xml version="1.0" encoding="utf-8"?>
<configuration>

  <configSections>
    <section name="Phantom" type="PhantomDb.MVC.Configuration.Phantom, PhantomDb.MVC" />
    ...
  </configSections>

  ...
  
  <Phantom>
    <Schemas>
      <Schema
        name="mysql"
        connection="Server=127.0.0.1;Database=testdb;Uid=root;Pwd=;"
        context="PhantomDb.Mysql.MysqlContext, PhantomDb.Mysql"
        handler="PhantomDb.Mysql.MysqlHandler, PhantomDb.Mysql"
        />
    </Schemas>
  </Phantom>
  
</configuration>

2. Global.asax

Ejecutar en la clase Global, dentro de Application_Start:

PhantomDb.MVC.PhantomConfigurator.Configure();


Related

Wiki: Home

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.