public dynamic SaveServant([FromBody] Servant servant) { var cc = new CreationCandidate <Servant>(servant); var validationResults = ServantCreationValidator.Validate(cc); if (validationResults.IsValid) { ServantRepository.SaveServant(servant); return(Ok("Servant Created")); } else { return(validationResults.Errors); } }
public dynamic SaveMage([FromBody] Mage mage) { var cc = new CreationCandidate <Mage>(mage); var validationResults = MageCreationValidator.Validate(cc); if (validationResults.IsValid) { MageRepository.SaveMage(mage); return(Ok("Mage Created")); } else { return(validationResults.Errors); } }