Hi hikanlkan,
I met the error 'The sequence does not contain any matching elements' when I did the unit test of abp. I took me a long time to find the error code. My entity has the column attribute for one property like that: [Column(TypeName = "varchar")] public virtual string Picture { get; set; }
When I used the method of UsingDbContext of AppTestBase , the error was throw. I don't konw why the column attribute causes the error?
4 Answer(s)
-
0
This can be related to EF rather than ABP. I found that when I search it: <a class="postlink" href="http://stackoverflow.com/questions/12500625/entity-framework-migrations-error-sequence-contains-no-elements">http://stackoverflow.com/questions/1250 ... o-elements</a>
Can you share the stack trace?
-
0
Stack Trace is like below: [External code]
Abp.EntityFramework.dll!Abp.EntityFramework.AbpDbContext.Initialize() line 137 C# [External code] Abp.dll!Abp.Dependency.IocManager.Resolve<AndHuang.HWWL.EntityFramework.HWWLDbContext>() line 159 C# AndHuang.HWWL.dll!AndHuang.HWWL.Tests.AppTestBase.UsingDbContext(System.Action<AndHuang.HWWL.EntityFramework.HWWLDbContext> action) line 67 C# AndHuang.HWWL.dll!AndHuang.HWWL.Tests.AppTestBase.AppTestBase() line 34 C# AndHuang.HWWL.dll!AndHuang.HWWL.Test.Sms.SmsManager_Tests.SmsManager_Tests() line C# [External code]
I viewed the link you provided ,I guess it may be a bug of EF CodeFirst. .
-
0
Thanks a lot , it gave me much help.