CANNOT IMPLICITLY CONVERT TYPE 'LONG?' TO 'LONG'.

Total Post:5

Points:35
 495  View(s)
Ratings:
Rate this:

Error 1 Cannot implicitly convert type 'long?' to 'long'. An explicit conversion exists (are you missing a cast?) 

  select new post

          {
          ID = r.ID,
        Title = r.Title,
          PostedDate = r.CreationDate,
      DeletedOn = r.ModificationDate,
      ModifiedBy = r.ModifiedBy

      })

in modifiedBy its showing error of typecast

please help me 

  1. Post:9

    Points:63
    Re: CANNOT IMPLICITLY CONVERT TYPE 'LONG?' TO 'LONG'.

    write following code 

     select new post
    
                    {
            ID = r.ID,
          Title = r.Title,
            PostedDate = r.CreationDate,
            DeletedOn = r.ModificationDate,
            ModifiedBy = (long)r.ModifiedBy
          })

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!