internal static IActionResult ApiErrorResult(this MemcachedController controller, Exception ex, ILogger logger) { var error = new { error = "Memcached Error", description = "Memcached server is either unavailable or operation failed." }; logger.LogDebug(ex, "Error : " + JsonConvert.SerializeObject(error)); return(controller.StatusCode(StatusCodes.Status503ServiceUnavailable, error)); }
public static void ClassClean() { MemcachedController.Stop(); var ctx = TestConfiguration.GetDataContext(tablePrefix); ctx.DeleteTable <FullEntity>(); }
internal static IActionResult NullValueErrorResult(this MemcachedController controller, string key, ILogger logger) { var error = new { error = "Null Value", description = "Value passed in body for key:[" + key + "] is either null or invalid." }; logger.LogDebug("Validation Error : " + JsonConvert.SerializeObject(error)); return(controller.StatusCode(StatusCodes.Status400BadRequest, error)); }
internal static IActionResult XmlFormatMismathErrorResult(this MemcachedController controller, string key, XmlException ex, ILogger logger) { var error = new { error = "Format Mismatch", description = "Value in key:[" + key + "] is not xml." }; logger.LogDebug(ex, "Error : " + JsonConvert.SerializeObject(error)); return(controller.StatusCode(StatusCodes.Status400BadRequest, error)); }
public static void ClassInit() { MemcachedController.StartIfRequired(); cacheClient = new MemcachedClient(); var ctx = TestConfiguration.GetDataContext(tablePrefix); ctx.CreateTableIfNotExists ( new CreateTableArgs <FullEntity> ( 5, 5, en => en.HashKey, en => en.RangeKey, null, () => initialEntities ) ); }
public static void ExtraClassClean() { MemcachedController.Stop(); }
public static void ExtraClassInit() { MemcachedController.StartIfRequired(); }