Hi Josh,

I do it a little bit different, I create a completly new class not
inherited from anything. I have static methods that will create me
this object form any source.

public class AjaxOrder
{
    #region Properties

    public string Property1;

    #endregion

    public AjaxOrder FromDataSet(DataSet ds)
    {
        AjaxOrder o = new AjaxOrder();
        o.Property1 = ds.Tables[0].Rows[0]["Property1"];
        return o;
    }
    public AjaxOrder FromJSON(string json)
    {
        // ...
    }
}


If I'm using a list of object I everytime use DataTables:

[AjaxMethod]
public static DataTable GetOrders()
{
    DataTable dt = new DataTable();

    dt.Columns.Add("FirstName", typeof(string));
    dt.Columns.Add("Age", typeof(int));
    dt.Columns.Add("OrderDetails", typof(MyCustomOrderDetails));

    DataRow row = dt.NewRow();

    row["FirstName"] = "Michael";
    row["Age"] = 28;
    row["OrderDetails"] = Backend.GetOrderDetails("Michael");

    dt.Rows.Add(row);

    return dt;
}


Regards,
Michael




On 4/4/06, Josh <[EMAIL PROTECTED]> wrote:
>
> Ok it is still running thru each prop of my dataobject, here is what I
> have:
>
>    public class AjaxCartUtil
>    {
>        [AjaxPro.AjaxMethod(AjaxPro.HttpSessionStateRequirement.Read)]
>        public static AjaxObjects.AjaxCart GetSessionCart()
>        {
>            return new
> AjaxObjects.AjaxCart(Util.CartUtil.GetSessionCart());
>        }
>    }
>
> //GetSessionCart() returns a Cart object, when this happens, it steps
> into this class and goes thru all the properties. I was expecting it to
> just continue on and instantiate the new AjaxCart object....
>
> //This test class just copies a couple properties from the Cart
> object....
>    public class AjaxCart : DataObjects.Cart
>    {
>        public AjaxCart(DataObjects.Cart cart)
>        {
>            this._id = cart.ID;
>            this.Type = cart.Type;
>        }
>    }
>
> So, it for some reason is still runnign thru the entire Cart class, all
> properties, etc.... any ideas how to fix this?
>
> Thanks!
>
>
> >
>


--
Kind regards,
Michael Schwarz

Microsoft MVP - Most Valuable Professional
Microsoft MCAD - Certified Application Developer

http://www.schwarz-interactive.de/
mailto:[EMAIL PROTECTED]

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Ajax.NET Professional" group.

To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]

For more options, visit this group at http://groups.google.com/group/ajaxpro

The latest downloads of Ajax.NET Professional can be found at 
http://www.ajaxpro.info
-~----------~----~----~----~------~----~------~--~---

Reply via email to