예제 #1
0
 /// <summary>
 /// This method supports the framework directly and should not be used from your code
 /// </summary>
 /// <param name="handler">The handler.</param>
 /// <param name="context">The context.</param>
 /// <returns></returns>
 public static void Impl(IModified handler, IContext context)
 {
     if (handler.LastModified.HasValue)
     {
         context.Response.SetLastModified(handler.LastModified.Value);
     }
 }
예제 #2
0
 /// <summary>
 /// This method supports the framework directly and should not be used from your code
 /// </summary>
 /// <param name="handler">The handler.</param>
 /// <param name="context">The context.</param>
 /// <returns></returns>
 public static void Impl(IModified handler, IContext context)
 {
     if (handler.LastModified.HasValue)
     {
         context.Response.SetLastModified(handler.LastModified.Value);
     }
 }
예제 #3
0
        public static void SetCreated(this IModified modified, int userId)
        {
            if (modified == null)
            {
                return;
            }

            modified.CreatedBy   = userId;
            modified.CreatedDate = DateTime.Now;
        }
예제 #4
0
 /// <summary>
 /// This method supports the framework directly and should not be used from your code
 /// </summary>
 /// <param name="handler">The handler.</param>
 /// <param name="context">The context.</param>
 /// <returns></returns>
 public static void Impl(IModified handler, IContext context)
 {
     var header = context.Request.Headers["If-Modified-Since"].FirstOrDefault();
     if (!string.IsNullOrWhiteSpace(header))
     {
         DateTime time;
         if (DateTime.TryParse(header, out time))
         {
             handler.IfModifiedSince = time;
         }
     }
 }
예제 #5
0
        /// <summary>
        /// This method supports the framework directly and should not be used from your code
        /// </summary>
        /// <param name="handler">The handler.</param>
        /// <param name="context">The context.</param>
        /// <returns></returns>
        public static void Impl(IModified handler, IContext context)
        {
            if (!context.Request.Headers.ContainsKey("If-Modified-Since"))
            {
                return;
            }
            var header = context.Request.Headers["If-Modified-Since"].FirstOrDefault();

            if (!string.IsNullOrWhiteSpace(header))
            {
                DateTime time;
                if (DateTime.TryParse(header, out time))
                {
                    handler.IfModifiedSince = time;
                }
            }
        }