public async Task <int> InsertAsync(string Name, int PersonId, DateTime Created, DateTime Updated) { var person = await _userRepository.GetUserByIdAsync(PersonId); if (person != null) { var Production = new Production(Name, PersonId, Created, Updated); if (Production.isValid()) { var production = await _productionRepository.InsertAsync(Production); if (production > 0) { return(production); } } } _notification.NewNotificationBadRequest("Campos Incorretos"); return(default);