use DbEntry.Net in WebService

Mar 4, 2009 at 9:38 AM
Edited Mar 4, 2009 at 10: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?
Mar 4, 2009 at 11:05 AM
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 11:28 AM
I think maybe using DbObject is a good idea.
So my suggestion is improving the DbObject, like adding FindXXX functions.
Mar 4, 2009 at 11:02 PM
I don't think so.
But you can implement your DbObjectEx in your assembly to add FindXXX fucntions by yourself.
Mar 5, 2009 at 12:34 AM
Edited Mar 5, 2009 at 6: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?
Mar 5, 2009 at 3:42 AM
1.Whatever you want.
2.DbEntry.Net is thread safe.
Apr 17, 2009 at 3:29 PM
Edited Apr 17, 2009 at 9: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?

Apr 18, 2009 at 9: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 12:52 AM
to shawnmullen:
 Have you try to give your DbObject a public parameterless constructor?