This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<configuration> | |
<configSections> | |
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" /> | |
</configSections> | |
<connectionStrings> | |
<add name="DataEntities" connectionString="Server=127.0.0.1;Port=5432;Database=testdb;User Id=test;Password=test;" providerName="Npgsql"/> | |
</connectionStrings> | |
<entityFramework> | |
<defaultConnectionFactory type="Npgsql.NpgsqlConnectionFactory, Npgsql" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Data.Entity; | |
namespace PGTest.Models | |
{ | |
public partial class DataContext : DbContext | |
{ | |
protected override void OnModelCreating(DbModelBuilder modelBuilder) | |
{ modelBuilder.HasDefaultSchema("public"); base.OnModelCreating(modelBuilder); } | |
public DataContext() : base("name=DataEntities") { Database.SetInitializer<DataContext>(null); } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.ComponentModel.DataAnnotations; | |
using System.ComponentModel.DataAnnotations.Schema; | |
namespace PGTest.Models | |
{ | |
[Table("public.Region")] | |
public partial class Region | |
{ | |
[Key] | |
[StringLength(10)] | |
public string RegionCode { get; set; } |