public int CreateLaw(Law laws) { Guard.NotNullOrEmpty(laws.Name, "Name of Law is required.,"); var law = _repoLaw.GetLawByName(laws.Name); if (law == null) { var lawOut = _repoLaw.CreateLaw(laws); if (lawOut == 0) { throw new Exception("Unable to Add Laws"); } return(lawOut); } else { throw new Exception("This Law is already exists.,"); } }