/// <summary> /// Get Date modified value of a specified resource. /// </summary> /// <param name="memberResourceId">Id of resource to get modified date.</param> /// <returns>Returns NULL if resource does not exists. /// Returns minimum date value if resource's modified date is empty in data store.</returns> private static DateTime?GetModifiedDate(string memberResourceId) { using (ZentityContext context = CoreHelper.CreateZentityContext()) { Guid resourceId = new Guid(memberResourceId); return(context.ScholarlyWorks() .Where(resource => resource.Id == resourceId) .AsEnumerable() .Select(resource => (null == resource) ? null : (null == resource.DateModified) ? DateTime.MinValue : resource.DateModified) .FirstOrDefault()); } }