use DbEntry.Net in WebService

Mar 4, 2009 at 10:38 AM
Edited Mar 4, 2009 at 11:26 AM
1, Is it possible? since it seems an abstract object can't be a parameter or return value of a WebMethod.
2, if i define class inherit from DbObject, does it mean that all extra functions can't work, including Relation and SpecialName?
Coordinator
Mar 4, 2009 at 12:05 PM
The abstract model doesn't work for web serverice. There is a plan to make it work but not finished and the priority of it is not high for me.

If you define class inherits from DbObject, the relation doesn't work, but SpecialName still work.
Mar 4, 2009 at 12:28 PM
I think maybe using DbObject is a good idea.
So my suggestion is improving the DbObject, like adding FindXXX functions.
Coordinator
Mar 5, 2009 at 12:02 AM
I don't think so.
But you can implement your DbObjectEx in your assembly to add FindXXX fucntions by yourself.
Mar 5, 2009 at 1:34 AM
Edited Mar 5, 2009 at 7:06 AM
OK. i see.
1, Any suggestion when use multiple data source in WebService? like store DbContext in Application or instantiate everytime.
2, is DbEntry.Net thread safe?
Coordinator
Mar 5, 2009 at 4:42 AM
1.Whatever you want.
2.DbEntry.Net is thread safe.
Apr 17, 2009 at 4:29 PM
Edited Apr 17, 2009 at 10:47 PM
I'm trying to use the DBEntry in a web service scenario.  I get the error below:

Lephone.Data.Definition.BelongsTo`1[ExPub.BOL.EDMS.Collection] cannot be serialized because it does not have a parameterless constructor.

ExPub.BOL.EDMS.Collection is a class that inherits from DBObject.  After reading the previous posts it seems that using DBEntry in a web service is possible but I don;t see how to get around the error I got.  Any suggestions?

Thanks.
Coordinator
Apr 18, 2009 at 10:02 AM
For now, the model who support web service must implements IDbObject directly and the relation stuff doesn't work for it.
Such as :
public class User : IDbObject
{
    public string Name;
    public int Age;
}
Apr 20, 2009 at 1:52 AM
to shawnmullen:
 Have you try to give your DbObject a public parameterless constructor?