ActiveRecordValidationBase<T> + Scaffolding = "Could not save ***."

1 view
Skip to first unread message

deerchao

unread,
Sep 15, 2007, 11:58:48 PM9/15/07
to Castle Project Users
ActiveRecordBase<T> works just fine, but if I change it to
ActiveRecordValidationBase<T>, there will be a error says "Could not
save ***. 发现不明确的匹配。" wheneven I update a record. Is this a bug or I
did something wrong?

here is the code:

[ActiveRecord]
public abstract class EntityBase<T> :
ActiveRecordValidationBase<T>
where T : class
{
private string note;
private DateTime createTime;
private int id;

public EntityBase()
{
CreateTime = DateTime.Now;
}

[PrimaryKey]
public int Id
{
get { return id; }
set { id = value; }
}

[Property]
public string Note
{
get { return note; }
set { note = value; }
}

[Property]
public DateTime CreateTime
{
get { return createTime; }
set { createTime = value; }
}
}

[ActiveRecord]
public class Customer : EntityBase<Customer>
{
#region fields
private string name;
private bool isSupplier;
private bool isBuyer;
private int importance;
#endregion

[Property]
public string Name
{
get { return name; }
set { name = value; }
}

[Property]
public bool IsSupplier
{
get { return isSupplier; }
set { isSupplier = value; }
}

[Property]
public bool IsBuyer
{
get { return isBuyer; }
set { isBuyer = value; }
}

[Property]
public int Importance
{
get { return importance; }
set { importance = value; }
}

public override string ToString()
{
return name;
}
}

And the controller:
[Scaffolding(typeof(Customer))]
public class CustomerController : SmartDispatcherController
{
}

Hamilton Verissimo

unread,
Sep 30, 2007, 10:54:30 AM9/30/07
to castle-pro...@googlegroups.com
Is this tried on RC3 ?


--
Cheers,
hamilton verissimo
ham...@castlestronghold.com
http://www.castlestronghold.com/

Mark Quinn

unread,
Oct 2, 2007, 4:54:36 AM10/2/07
to castle-pro...@googlegroups.com
I experienced the same on RC2 and on the build-server compile of various
trunk builds over the last few weeks.
Every time I try to use the generic base class, I always get the
reflection "ambiguous match" error when using scaffolding - also when
not using scaffolding.

I don't understand how to resolve the problem. I have just given up on
using the generic base class - which is annoying. Must I build
monorail/castle from source? Is this something to do with the build
server compiling against the old proxy. I tried changing my references
to dp2, but this didn't seem to affect anything.

Mark

Hamilton Verissimo

unread,
Oct 2, 2007, 9:26:11 AM10/2/07
to castle-pro...@googlegroups.com
I'm not sure is related to proxy right now. Might be a silly bug some
where. I'll investigate as soon as get my energy back.

Reply all
Reply to author
Forward
0 new messages