示例#1
0
 public void Create(ContactInfo contactInfo)
 {
     try
     {
         dbContext.Add(contactInfo);
         //dbContext.
         dbContext.SaveChanges();
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
示例#2
0
        public void Create(Warning warning)
        {
            try
            {
                bool validWarning = Validate(warning);

                if (validWarning)
                {
                    dbContext.Add(warning);
                    dbContext.SaveChanges();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        public void Create(RecipeIngredient recipeIngredient)
        {
            try
            {
                bool validWarning = Validate(recipeIngredient);

                if (validWarning)
                {
                    dbContext.Add(recipeIngredient);
                    dbContext.SaveChanges();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
示例#4
0
        public void Create(BlockedWord blockedWord)
        {
            try
            {
                bool validBlockedWord = Validate(blockedWord);

                if (validBlockedWord)
                {
                    dbContext.Add(blockedWord);
                    dbContext.SaveChanges();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
示例#5
0
        public void Create(Food food)
        {
            try
            {
                bool validFood = Validate(food);

                if (validFood)
                {
                    dbContext.Add(food);
                    dbContext.SaveChanges();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
示例#6
0
        public void Create(Recipe recipe)
        {
            try
            {
                bool validrecipe = Validate(recipe);

                if (validrecipe)
                {
                    dbContext.Add(recipe);
                    dbContext.SaveChanges();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        public void Create(RegisteredUserRecipe registeredUserRecipe)
        {
            try
            {
                bool validWarning = Validate(registeredUserRecipe);

                if (validWarning)
                {
                    dbContext.Add(registeredUserRecipe);
                    dbContext.SaveChanges();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
示例#8
0
        public void Create(RegisteredUser registeredUser)
        {
            try
            {
                bool validregisteredUser = Validate(registeredUser);

                if (validregisteredUser)
                {
                    dbContext.Add(registeredUser);

                    dbContext.SaveChanges();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }