/// <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);
     }
 }
 /// <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);
     }
 }
Exemple #3
0
        public static void SetCreated(this IModified modified, int userId)
        {
            if (modified == null)
            {
                return;
            }

            modified.CreatedBy   = userId;
            modified.CreatedDate = DateTime.Now;
        }
 /// <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;
         }
     }
 }
Exemple #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;
                }
            }
        }