Hello, I'am trying with DataObjects and I have a problem with simplest task.
My code:
namespace Model
{
public class Place : Entity
{
[Key]
[Field]
public int Id { get; private set; }
[Field]
public string Name { get; set; }
}
}
namespace DataObjectsTest
{
class Program
{
static void Main(string[] args)
{
var domainConfig = new DomainConfiguration("sqlserver",
@"Data Source=localhost\SQLEXPRESS;Initial Catalog=DataObjectsTest;Persist Security Info=True;User ID=db;Password=db");
domainConfig.Types.Register(typeof (Place).Assembly);
domainConfig.UpgradeMode = DomainUpgradeMode.Recreate;
var domain = Domain.Build(domainConfig);
using (var s = domain.OpenSession())
{
s.Activate();
using (var t = s.OpenTransaction())
{
new Place {Name = "PL1"};
t.Complete();
}
}
}
}
}
And there is an error "Type 'Place' is not registered." at line "new Place {Name = "PL1"};"
I can see that in my database no one domain table was created after Domain.Build but there was not any errors or warnings too.
Only three Metadata tables exists.
DomainConfiguration.Types contains Place type after Register call, but Domain.Model doesnt contains it.
I tried it at last stable release and now I'am trying it with 5 version.
asked
Dec 16 '13 at 09:07
Valentin Polezhaev
7●1●1●2