public void AddRole(Role model)
        {
            var roles = roleService.GetAll();

            if (roles.Exists(x => x.RoleName.Equals(model.RoleName)))
            {
                var role = roles.SingleOrDefault(x => x.RoleName.Equals(model.RoleName));
                role.Description  = model.Description;
                role.ModifiedBy   = model.ModifiedBy;
                role.ModifiedDate = DateTime.Now;
                role.RecordStatus = (int)RecordStatus.Active;
                roleService.Update(role);
            }
            else
            {
                roleService.Create(model);
            }
            _unitOfWork.Save();
        }
 public virtual void Edit(TEntity entity)
 {
     _entityRepository.Update(entity);
     SaveChanges();
 }