// Not sure about the naming of name, its called NameType in AvatarType entity? public AvatarType CreateType(AvatarType avatarType) { if (avatarType.TypeOfAvatar == null) { throw new System.IO.InvalidDataException("You need to put in atleast 1 letter!"); } return(_typeRepository.CreateType(avatarType)); }
public ActionResult CreateType([FromBody] CheckType type) { var id = _typeRepository.CreateType(type); if (id > 0) { return(Ok(new { id })); } return(new UnsupportedMediaTypeResult()); }