Исправил с public AccountContext() : base(testdb") на public AccountContext() : base("name=testdb")
[DbConfigurationType(typeof(MySqlEFConfiguration))]
public partial class AccountContext : DbContext
{
public AccountContext() : base("name=testdb")
{ }
public virtual DbSet<AccountModel> account { get; set; }
}
}
Code: C#
Но теперь такая ошибка и хз как от её исправить
[Error] No connection string named 'testdb' could be found in the application config file.
в System.Data.Entity.Internal.LazyInternalConnection.get_ConnectionHasModel()
в System.Data.Entity.Internal.LazyInternalContext.InitializeContext()
в System.Data.Entity.Internal.InternalContext.Initialize()
в System.Data.Entity.Internal.InternalContext.GetEntitySetAndBaseTypeForType(Type entityType)
в System.Data.Entity.Internal.Linq.InternalSet`1.Initialize()
в System.Data.Entity.Internal.Linq.InternalSet`1.get_InternalContext()
в System.Data.Entity.Infrastructure.DbQuery`1.System.Linq.IQueryable.get_Provider()
в System.Linq.Queryable.First[TSource](IQueryable`1 source, Expression`1 predicate)
в PiercingBlow.Core.Database.AccountDB.loadAccount(String Token) в C:\Users\Irbos\source\repos\PiercingBlow\PiercingBlow.Core\Database\AccountDB.cs:строка 23
в PiercingBlow.Login.Emu.Network.Recv.PROTOCOL_LOGIN_REQ.RunImpl() в C:\Users\Irbos\source\repos\PiercingBlow\PiercingBlow.Login\Emu\Network\Recv\PROTOCOL_LOGIN_REQ.cs:строка 29
в PiercingBlow.Core.Packet.ClientPacket.Init(Byte[] buffer) в C:\Users\Irbos\source\repos\PiercingBlow\PiercingBlow.Core\Packet\ClientPacket.cs:строка 22
в PiercingBlow.Login.Emu.Network.ClientConnection.BeginRead(IAsyncResult asyncResult) в C:\Users\Irbos\source\repos\PiercingBlow\PiercingBlow.Login\Emu\Network\ClientConnection.cs:строка 65
Code: XML