コード例 #1
0
        private static void GenericSeed <T>(CheckTimeContext context, string path) where T : class
        {
            if (!File.Exists(path))
            {
                return;
            }

            if (context.Set <T>().Count() > 0)
            {
                return;
            }

            List <T> list = JsonConvert.DeserializeObject <List <T> >(File.ReadAllText(path));

            foreach (var item in list)
            {
                context.Add <T>(item);
            }
        }
コード例 #2
0
 public Check(CheckTimeContext context, IRepository repo)
 {
     _context = context;
     _repo    = repo;
 }
コード例 #3
0
 public Repository(CheckTimeContext context)
 {
     _context = context;
 }
コード例 #4
0
 public ValuesController(CheckTimeContext context, ICheck check)
 {
     _context = context;
     _check   = check;
 }