public GoalsController(GoalsContext context)
        {
            _context = context;

            if (_context.GoalsItems.Count() == 0)
            {
                _context.GoalsItems.Add(
                    new GoalsItem
                {
                    MeasureId    = "value",
                    Value        = 7.8,
                    DisplayValue = "7.8",
                    DisplayText  = "number",
                }
                    );
                _context.SaveChanges();
            }
        }
Example #2
0
 public GoalsRepository(GoalsContext context)
 {
     _context = context ?? throw new ArgumentNullException(nameof(context));
 }