示例#1
0
        public void AddJuice(string answer, bool isCustom, bool approved, DateTime juiceDateTime, string username)
        {
            var juiceDb = new JuiceDb();

            juiceDb.Name          = answer;
            juiceDb.IsCustom      = isCustom;
            juiceDb.Approved      = approved;
            juiceDb.JuiceDateTime = juiceDateTime;
            juiceDb.UserName      = username;
            _context.Juices.Add(juiceDb);
            _context.SaveChanges();
        }
        public void AddJuice(string answer, bool isCustom, bool approved, DateTime juiceDateTime, string username)
        {
            var juiceDb = new JuiceDb
            {
                Name          = answer,
                IsCustom      = isCustom,
                Approved      = approved,
                JuiceDateTime = juiceDateTime,
                UserName      = username
            };

            _context.Juices.Add(juiceDb);
            _context.SaveChanges();
        }