public IResult Save(SubCategoriesDto subCategoriesDto) { SubCategoriesEntity table = new SubCategoriesEntity(subCategoriesDto.Name, subCategoriesDto.Categories); if (_subCategoriesRepository.Get(table) != null) { return(new ValidateResult(table, false, "Mesa informada já existe")); } table.Validate(); if (table.Invalid) { return(new ValidateResult(table.Notifications, false, "Problemas ao cadastrar a SubCategoria")); } _subCategoriesRepository.Add(table); return(new ValidateResult(table, true, "SubCategoria cadastrada com sucessso")); }
public void Save(SubCategories subCategories) { _subCategoriesRepository.Add(subCategories); _unitOfWork.Complete(); }