.net - skipping over potential nulls c# -


I have a block of code that eventually ends up with J.K. The full calender plugin has been serialized for use in JSN. The ToUnixTimeSpan method works in a DateTime object and returns the number of seconds from 1970

The date-column may be blank in this section of the code how I'll test for the null and leave the end = toUnixTimespan (e.DateEnd) if the date is blank? Is groovy equal operator of c #?

list var listEvents = from eventRepository.GetAllEvents () new {id = e.EventID, title = e.EventTitle, start = toUnixTimespan (E.Dart Start), and = Tunics Timesman (edited), url = "/ events / description /" + e. AVEEND}; Further information about ToUnixTimespanMethod:

  Private toUnixTimespan {datepace tspan = date.ToUniversalTime (). Subtract (New DateTime (1970), 1, 1, 0, 0, 0)); Return (Long) Mathematics. Reposition (tspan numeric); } 

Wait - one minute ... why am I commenting on this, When I can take advantage of John's work for some representative ..;)

  end = e.DateEnd == null? (Long?) Tap: ToUnixTimespan (e.DateEnd.Value)  

It should resolve "system. Can not be changed from datetime?" For 'System.DateTime' "Error.


Comments

Popular posts from this blog

c# - sqlDecimal to decimal clr stored procedure Unable to cast object of type 'System.Data.SqlTypes.SqlDecimal' to type 'System.IConvertible' -

Calling GetGUIThreadInfo from Outlook VBA -

Obfuscating Python code? -