Hello
Interface using in another project interface and hasn't implementation
Query.All<interface> throw exception
Interface
public interface IMyInterface : IEntity
{
[Key]
[Field(Nullable = false)]
Guid Id { get; set; }
[Field]
string Name { get; set; }
}
Next code throw exception
public static class Program
{
static void Main(string[] args)
{
var dc = new DomainConfiguration("sqlserver://localhost/DO40-Tests");
dc.Types.Register(typeof(IMyInterface));
dc.UpgradeMode = DomainUpgradeMode.Recreate;
using (var domain = Domain.Build(dc))
{
using (var s = domain.OpenSession())
{
using (s.Activate())
{
using (s.OpenTransaction())
{
s.Query.All<IMyInterface>().ToArray();
}
}
}
}
}
}
"Unable to translate 'Query.All()' expression. See inner exception for details."
"Type 'ConsoleApplication1.IMyInterface' is not found in model."
After register implementation, no more errors
[HierarchyRoot]
public class Ent : Entity, IMyInterface
{
public Guid Id { get; set; }
public string Name { get; set; }
}
public static class Program
{
static void Main(string[] args)
{
var dc = new DomainConfiguration("sqlserver://localhost/DO40-Tests");
dc.Types.Register(typeof(IMyInterface));
dc.Types.Register(typeof(Ent));
dc.UpgradeMode = DomainUpgradeMode.Recreate;
using (var domain = Domain.Build(dc))
{
using (var s = domain.OpenSession())
{
using (s.Activate())
{
using (s.OpenTransaction())
{
s.Query.All<IMyInterface>().ToArray();
}
}
}
}
}
}
Maybe should return empty result instead exception
DO 4.6.6
asked
May 26 '14 at 06:45
Anton Guschin
73●30●30●35