Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
SistemaEscolar: BaseDatos.cs
using Xamarin.Forms;
using Microsoft.EntityFrameworkCore;
using SistemaEscolar.Modelos;
namespace SistemaEscolar.Datos
public class BaseDatos : DbContext
public DbSet<Escuela> Escuelas { get; set; }
public DbSet<Alumno> Alumnos { get; set; }
private readonly string rutaBD;
public BaseDatos(string rutaBD)
this.rutaBD = rutaBD;
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
var dbPath = DependencyService.Get<IBaseDatos>().GetDatabasePath();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment