public List <Book> GetAllBooks() { List <Book> lstBooks = null; try { lstBooks = dt.GetAllBookDetails(); } catch (Exception ex) { log.LogError("Error while fetching all book details", ex.Message, ex.StackTrace.ToString()); lstBooks = JsonConvert.DeserializeObject <List <Book> >(System.IO.File.ReadAllText(AppSettings.SampleFile)); } return(lstBooks); }