private bool Validate(CompanyModel companyModel) { if (dbContext.Companies.Any(x => x.Name == companyModel.Name && x.Id != companyModel.Id.ToString())) { base.HandleError(companyModel, CommonLayer.LookUps.ErrorType.Business, null, string.Format(Resources.AlreadyExists, companyModel.GetDisplayName(x => x.Name)), companyModel.nameof(x => x.Name)); } return(companyModel.HasErrorByType()); }