CSLA .NET

Vibrant discussion about CSLA .NET and using the framework to build great business applications.

Forum has moved

New location: CSLA .NET forum


CSLA .NET Resources:
  • CSLA .NET forum
  • CSLA .NET home page
  • Passing nullable types to DataPortal.Fetch

    rated by 0 users
    Answered (Verified) This post has 1 verified answer | 2 Replies | 1 Follower

    Not Ranked
    2 Posts
    MikePolito posted on Fri, Jun 12 2015 9:49 AM

    I am fairly new to CSLA4 and in general I have had no issues working with it until I tried to create Fetch method that passed a Nullable<Boolean> value. I can pass either 'true' or 'false' however if I pass in 'null', I get a DataPortal Exception.

    An unhandled exception of type 'Csla.DataPortalException' occurred in Csla.dll

    Additional information: DataPortal.Fetch failed (Invalid operation - fetch not allowed)

    It seems reasonable to be able to do this.

    Is this a bug or simply just not supported? - Why not?

    Answered (Verified) Verified Answer

    Top 10 Contributor
    4,106 Posts
    Answered (Verified) Andy replied on Fri, Jun 12 2015 9:55 AM
    Verified by MikePolito

    I think null means use parameter-less Fetch method, which you've not implemented.  Change your DPF to take a SingleCriteria<bool?> and call it passing an instance of that class.

    All Replies

    Top 10 Contributor
    4,106 Posts
    Answered (Verified) Andy replied on Fri, Jun 12 2015 9:55 AM
    Verified by MikePolito

    I think null means use parameter-less Fetch method, which you've not implemented.  Change your DPF to take a SingleCriteria<bool?> and call it passing an instance of that class.

    Not Ranked
    2 Posts

    Thanks!

    Page 1 of 1 (3 items) | RSS

    Copyright (c) 2006-2014 Marimer LLC. All rights reserved.
    Email admin@lhotka.net for support.
    Powered by Community Server (Non-Commercial Edition), by Telligent Systems