コード例 #1
0
        public void Update(Governorates governoratesParam)
        {
            var governorates = _context.Governorates.Find(governoratesParam.Code);

            if (governorates == null)
            {
                throw new AppException("User not found");
            }


            // update user properties
            governorates.ArabicName = governoratesParam.ArabicName;
            governorates.Code       = governoratesParam.Code;
            governorates.Name       = governoratesParam.Name;
            governorates.SortOrder  = governoratesParam.SortOrder;
            _context.Governorates.Update(governorates);
            _context.SaveChanges();
        }
コード例 #2
0
 public Governorates Create(Governorates governorates)
 {
     _context.Governorates.Add(governorates);
     _context.SaveChanges();
     return(governorates);
 }