Code Monkey home page Code Monkey logo

culturebase's Introduction

CultureBase

Project designed to study the implementation of Resources of culture seeking information on SQLServer database.

The model used is that of the Nadeem Afana's

A change was made so that the cache is restarted at the desired time, a solution for database, for example, that allows the user to change the culture at any time can not depend on restarting the application to the new cache.

Before attempting to understand the project read the whole post, with it you will better understand the project.

Changes to maintenance Cache

  • The BaseResourceProvider class suffered an inclusion of a method.
public void ResetCache()
{
  resources = null;
}

The variable resources is where the culture data are included and maintained, by annulling the variable you force a new query to the database and new feed variable.

  • The IResourceProvider interface has undergone the inclusion of a new method
void ResetCache();        
  • The ResourceBuilder class has undergone a change in the Create method.

The constant header became thus:

const string header =
@"using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Resources.Abstract;
using Resources.Concrete;
   
namespace {0} {{
       public class {1} {{
           private static IResourceProvider resourceProvider = new {2}();

   {3}

       public static void reset(){{
           resourceProvider.ResetCache();
       }}

}}  
     
}}";

Using the cache reset function

You can see the controller HomeController method including a reset is done only for the test:

public void reset()
{
  Resources.Resources.reset();
}

All implementation of how to test the cache in views were based on the guide also Nadeem Afana's

culturebase's People

Contributors

ricardochaves avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.