public void UpdateCompount(Compount entity)
        {
            var compount = GetById(entity.CompountId);

            if (compount != null)
            {
                compount.Order   = entity.Order;
                compount.Message = entity.Message;
            }
            context.SaveChanges();
        }
 public void SaveCompount(Compount entity)
 {
     if (entity.CompountId == 0)
     {
         context.Compounts.Add(entity);
     }
     else
     {
         var compount = GetById(entity.CompountId);
         if (compount != null)
         {
             compount.Order   = entity.Order;
             compount.Message = entity.Message;
         }
     }
     context.SaveChanges();
 }
 public IActionResult Index(Compount model)
 {
     _compountRepository.SaveCompount(model);
     return(View("Onay", model));
 }
 public void AddCompount(Compount entity)
 {
     context.Compounts.Add(entity);
     context.SaveChanges();
 }