locked
LINQ issue looking filtering by last hour RRS feed

  • Question

  • User-755551556 posted

    I am not much of a LINQ person and I have a contact <g class="gr_ gr_37 gr-alert gr_gramm gr_inline_cards gr_run_anim Grammar multiReplace" id="37" data-gr-id="37">select</g>, but I only want to get the contacts modified within the last hour...

    The field I need to find if it was modified in the last hour <g class="gr_ gr_251 gr-alert gr_gramm gr_hide gr_inline_cards gr_run_anim Grammar multiReplace replaceWithoutSep replaceWithoutSep" id="251" data-gr-id="251">is oddly enough <g class="gr_ gr_241 gr-alert gr_gramm gr_inline_cards gr_disable_anim_appear Grammar only-ins replaceWithoutSep" id="241" data-gr-id="241">call</g></g> ModifedOn. This newbie to LINQ appreciates it, I searched around and <g class="gr_ gr_341 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling ins-del multiReplace" id="341" data-gr-id="341">didnt</g> see anything

     var contactEntites = from contacts in svc.CreateQuery("contact")
                                     select contacts;

    Tuesday, June 26, 2018 3:37 AM

All replies

  • User1992938117 posted

    Try as below

     var contactEntites = from contacts in svc.CreateQuery("contact")
    		      where contacts.LastModified >= DateTime.Now.AddHours(-1)
                          select contacts;

    Tuesday, June 26, 2018 4:55 AM