public int Add(string name) { if (_labelRepository.SelectByName(name) != null) { throw new ValidateException(301, "标签已存在"); } var model = new Label(); model.Name = name; return(Add(model)); }