c# - The entity type ApplicationUser is not part of the model for the current context after swapping server from local to external -


i have error after transfer whole data local external server. both databases have same tables etc. how fix this? work correctly before change server local external. data different register or login adding correctly.

connecton string

<add name="defaultconnectionentities" connectionstring="metadata=res://*/models.biuromodel.csdl|res://*/models.biuromodel.ssdl|      res://*/models.biuromodel.msl;      provider=system.data.sqlclient;      provider connection string=&quot;      data source=db-mssql;initial catalog=inzs9776;      persist security info=true;user id=inzs9776;      password=xxxxx&quot;"       providername="system.data.entityclient" /> 

defaultconnectionentities class

public partial class defaultconnectionentities : dbcontext {     public defaultconnectionentities()         : base("defaultconnectionentities")     {     }      protected override void onmodelcreating(dbmodelbuilder modelbuilder)     {         throw new unintentionalcodefirstexception();     }      public virtual dbset<c__migrationhistory> c__migrationhistory { get; set; }     public virtual dbset<aspnetroles> aspnetroles { get; set; }     public virtual dbset<aspnetuserclaims> aspnetuserclaims { get; set; }     public virtual dbset<aspnetuserlogins> aspnetuserlogins { get; set; }     public virtual dbset<aspnetusers> aspnetusers { get; set; }     public virtual dbset<hotel> hotel { get; set; }     public virtual dbset<klient> klient { get; set; }     public virtual dbset<oferta> oferta { get; set; }     public virtual dbset<opinia> opinia { get; set; }     public virtual dbset<osoba> osoba { get; set; }     public virtual dbset<pensjonat> pensjonat { get; set; }     public virtual dbset<pracownik> pracownik { get; set; }     public virtual dbset<pracownik_biurowy> pracownik_biurowy { get; set; }     public virtual dbset<przewodnik> przewodnik { get; set; }     public virtual dbset<region> region { get; set; }     public virtual dbset<transport> transport { get; set; }     public virtual dbset<ubezpieczenia> ubezpieczenia { get; set; }     public virtual dbset<wybrana_wycieczka> wybrana_wycieczka { get; set; }     public virtual dbset<wybraneubezpieczenie> wybraneubezpieczenie { get; set; }     public virtual dbset<wycieczka_fakultatywna> wycieczka_fakultatywna { get; set; }     public virtual dbset<zakwaterowanie> zakwaterowanie { get; set; }     public virtual dbset<zamowienie> zamowienie { get; set; }     public virtual dbset<zlozonezamowienie> zlozonezamowienie { get; set; } } 

application user:

 public class applicationuser : identityuser {     public async task<claimsidentity> generateuseridentityasync(usermanager<applicationuser> manager)     {         var useridentity = await manager.createidentityasync(this, defaultauthenticationtypes.applicationcookie);         return useridentity;     } } 

application dbcontext:

 public class applicationdbcontext : identitydbcontext<applicationuser> {     public applicationdbcontext()         : base("defaultconnectionentities", throwifv1schema: false)     {     }      public static applicationdbcontext create()     {         return new applicationdbcontext();     } } 

account controller:

  public class accountcontroller : controller {     private applicationusermanager _usermanager;     private defaultconnectionentities db = new defaultconnectionentities();     public accountcontroller()     {     }      public accountcontroller(applicationusermanager usermanager)     {         usermanager = usermanager;     }      public applicationusermanager usermanager {                 {             return _usermanager ?? httpcontext.getowincontext().getusermanager<applicationusermanager>();         }         private set         {             _usermanager = value;         }     }................... 


Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -