/// <summary>
		/// Get all modules registred in system.
		/// </summary>
		/// <returns>Array of <c>ModuleItem</c>.</returns>
		public ModuleItem[] GetModulesList()
		{
			using (MasterContext masterDb = new MasterContext())
			{
				IEnumerable<ModuleDescription> modules = masterDb.Modules;
				ModuleItem[] result = new ModuleItem[modules.Count()];

				int index = 0;
				foreach (ModuleDescription moduleDescription in modules)
				{
					ModuleItem moduleItem = new ModuleItem
					{
						Id = moduleDescription.Id,
						Name = moduleDescription.Name
					};
					result[index] = moduleItem;
					index++;
				}
				return result;
			}
		}
		/// <summary>
		/// Register module in system.
		/// </summary>
		/// <param name="moduleName">Module name.</param>
		/// <returns><c>ModuleItem</c></returns>
		public ModuleItem RegisterModule(string moduleName)
		{
			using (MasterContext masterDb = new MasterContext())
			{
				ModuleDescription module = masterDb.Modules.FirstOrDefault(m => string.Equals(m.Name, moduleName, StringComparison.CurrentCultureIgnoreCase));
				ModuleItem result = new ModuleItem();

				if (module == null)
				{
					module = new ModuleDescription();
					module.Name = moduleName;
					masterDb.Modules.Add(module);
					masterDb.SaveChanges();
				}

				result.Id = module.Id;
				result.Name = module.Name;

				return result;
			}
		}