private static void InitializeLookups()
        {
            if (!_context.Lookups.Any())
            {
                List <Lookup> lookups = new List <Lookup>();

                var lookup1 = _context.Lookups.Add(
                    new Lookup
                {
                    Key         = "country",
                    Value       = "IND",
                    Name        = "India",
                    Description = ""
                }).Entity;
                var lookup2 = _context.Lookups.Add(
                    new Lookup
                {
                    Key         = "country",
                    Value       = "IND",
                    Name        = "India",
                    Description = ""
                }).Entity;
                var lookup3 = _context.Lookups.Add(
                    new Lookup
                {
                    Key         = "country",
                    Value       = "IND",
                    Name        = "India",
                    Description = ""
                }).Entity;
                var lookup4 = _context.Lookups.Add(
                    new Lookup
                {
                    Key         = "country",
                    Value       = "IND",
                    Name        = "India",
                    Description = ""
                }).Entity;

                lookups.Add(lookup1); lookups.Add(lookup2); lookups.Add(lookup3); lookups.Add(lookup4);

                _context.SaveChanges();
            }
        }
Beispiel #2
0
 public virtual int Commit()
 {
     return(_context.SaveChanges());
 }