28.12.2017, 01:15
|
#28
|
Забанен за кидаловo/обман/развод
Регистрация: 29.08.2012
Возраст: 29
Сообщений: 538
Отблагодарили 6 раз(а)
Рейтинг мнений:
|
Re: c# entity framework
Пробую использовать EntityFranework Code-First . но столкнулся с ошибкой
Свернуть ↑
Код:
[Error] Правила безопасности наследования нарушены типом: "MySql.Data.Entity.MySqlEFConfiguration". Производные типы должны либо соответствовать по доступности в контексте безопасности базовому типу, либо быть менее доступными.
в System.Reflection.CustomAttribute._CreateCaObject(RuntimeModule pModule, IRuntimeMethodInfo pCtor, Byte** ppBlob, Byte* pEndBlob, Int32* pcNamedArgs)
в System.Reflection.CustomAttribute.CreateCaObject(RuntimeModule module, IRuntimeMethodInfo ctor, IntPtr& blob, IntPtr blobEnd, Int32& namedArgs)
в System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeModule decoratedModule, Int32 decoratedMetadataToken, Int32 pcaCount, RuntimeType attributeFilterType, Boolean mustBeInheritable, IList derivedAttributes, Boolean isDecoratedTargetSecurityTransparent)
в System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeType type, RuntimeType caType, Boolean inherit)
в System.RuntimeType.GetCustomAttributes(Type attributeType, Boolean inherit)
в System.Attribute.GetCustomAttributes(MemberInfo element, Type type, Boolean inherit)
в System.Reflection.CustomAttributeExtensions.GetCustomAttributes[T](MemberInfo element, Boolean inherit)
в System.Data.Entity.Infrastructure.DependencyResolution.DbConfigurationFinder.TryFindConfigurationType(Assembly assemblyHint, Type contextTypeHint, IEnumerable`1 typesToSearch)
в System.Data.Entity.Infrastructure.DependencyResolution.DbConfigurationManager.EnsureLoadedForAssembly(Assembly assemblyHint, Type contextTypeHint)
в System.Data.Entity.Infrastructure.DependencyResolution.DbConfigurationManager.EnsureLoadedForContext(Type contextType)
в System.Data.Entity.DbContext.InitializeLazyInternalContext(IInternalConnection internalConnection, DbCompiledModel model)
в System.Data.Entity.DbContext..ctor(String nameOrConnectionString)
в PiercingBlow.Core.Database.AccountContext..ctor() в D:\Development\PiercingBlow\Server\Testing\PiercingBlow\PiercingBlow.Core\Database\AccountContext.cs:строка 9
в PiercingBlow.Core.Database.AccountDB.loadAccount(String Token) в D:\Development\PiercingBlow\Server\Testing\PiercingBlow\PiercingBlow.Core\Database\AccountDB.cs:строка 11
в PiercingBlow.Login.Emu.Network.Recv.PROTOCOL_LOGIN_REQ.RunImpl() в D:\Development\PiercingBlow\Server\Testing\PiercingBlow\PiercingBlow.Login\Emu\Network\Recv\PROTOCOL_LOGIN_REQ.cs:строка 29
в PiercingBlow.Core.Packet.ClientPacket.Init(Byte[] buffer) в D:\Development\PiercingBlow\Server\Testing\PiercingBlow\PiercingBlow.Core\Packet\ClientPacket.cs:строка 22
в PiercingBlow.Login.Emu.Network.ClientConnection.BeginRead(IAsyncResult asyncResult) в D:\Development\PiercingBlow\Server\Testing\PiercingBlow\PiercingBlow.Login\Emu\Network\ClientConnection.cs:строка 64
Свернуть ↑Развернуть ↓
Свернуть ↑
Код:
[DbConfigurationType(typeof(MySqlEFConfiguration))]
class AccountContext : DbContext
{
public AccountContext(): base("testdb")
{ }
public virtual DbSet<AccountModel> account { get; set; }
}
}
Свернуть ↑Развернуть ↓
|
|
|