using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Domain;

namespace Dao.Implement
{
	public class SysSettingRepository : RepositoryBase<SysSetting>, ISysSettingRepository
	{
		public object GetValue(string name)
		{
			SysSetting setting = LoadAll().Where(r => r.Name == name).FirstOrDefault();
			if (setting != null)
			{
				return setting.Value;
			}

			return null;
		}

		public SysSetting Get(string name)
		{
			return LoadAll().Where(r => r.Name == name).FirstOrDefault();
		}
	}
}
