Page 1 of 1

Issue with MCV 4 and Postgresql Devart connector

Posted: Mon 26 Aug 2013 23:35
by chaoscode
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.

Re: Issue with MCV 4 and Postgresql Devart connector

Posted: Fri 30 Aug 2013 17:05
by Shalex
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;
    }
  }