Issue with MCV 4 and Postgresql Devart connector

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for PostgreSQL
Post Reply
chaoscode
Posts: 1
Joined: Mon 26 Aug 2013 23:29

Issue with MCV 4 and Postgresql Devart connector

Post by chaoscode » Mon 26 Aug 2013 23:35

I am having a issue where case on the userprofile table is causing an issue with WebSecurity.Login

When using WebSecurity its using the lowercase version of the table.

When I attempt to use db.UserProfiles it uses the UserProfiles table. These tables should be one in the same. I attmpeted to mod the code to sync them but I either get bad logins becuase I cant change what WebSecurity uses as a table name or I get Extent1.ColumnName not found.

Please fix. This is causing serious issues and making the connector unusable.

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: Issue with MCV 4 and Postgresql Devart connector

Post by Shalex » Fri 30 Aug 2013 17:05

The database was initialized in the following way (names of the tables and its two columns are user-defined):

Code: Select all

WebSecurity.InitializeDatabaseConnection("DotConnection", "UserProfile", "UserId", "UserName", autoCreateTables: true);
Please open AccountModels.cs in your MVC 4 application and fix the default code generation taking into account the names you have used in InitializeDatabaseConnection:

Code: Select all

 [Table("UserProfile")] // change "UserProfile" to the name of your table
  public class UserProfile {
    [Key]
    [DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)]
    public int UserId // change property name or add the [Column("new_column_name_for_UserId")] attribute
   {
      get;
      set;
    }
    public string UserName // change property name or add the  [Column("new_column_name_for_ UserName")] 
    {
      get;
      set;
    }
  }

Post Reply