/// <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); } }
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; } } }
/// <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; } } }