CSLA .NET

From Rockford Lhotka's Expert C# 2005 and VB 2005 Business Objects books

Welcome to CSLA .NET Sign in | Join | Help
in Search

Bug in templates? - Date handling

Last post 11-21-2006, 12:26 AM by rasupit. 1 replies.
Sort Posts: Previous Next
  •  11-15-2006, 1:15 PM 9276

    Bug in templates? - Date handling

    Hi

    Toaday in the templates all SmartDate (DateTime) objectecs are
    initialized like

            private SmartDate _lastVisit = new SmartDate(DateTime.Today);

    The problem is that Today does not provide any time information, so entires
    in the DB gets a bit wrong as there's no time information provided if I do not
    set it by my self.

    Would it not be better /consistent to change that to DateTime.Now instead?

    //Andy

  •  11-21-2006, 12:26 AM 9416 in reply to 9276

    Re: Bug in templates? - Date handling

    Andy,
    code generater will never accurately predict how will you use datetime property therefore choosing Now over Today won't be any better either, since there is time that you're only interested in date not time.

    You can use the dataportal_create to initialize default values
    Ricky
View as RSS news feed in XML

Please contact Magenic for your .NET consulting and CSLA .NET mentoring needs.
Please consider making a donation to help support the ongoing development of CSLA .NET.

Make donation through PayPal - it's fast, free and secure!
Why donate?
Powered by Community Server, by Telligent Systems