/// <summary> /// Post API/Classe /// </summary> /// <param name="Classe">Classe à insérer</param> public IHttpActionResult Post(ClasseModel Classe) { if ((new[] { "Admin" }).Contains(ValidateTokenAndRole.ValidateAndGetRole(Request), StringComparer.OrdinalIgnoreCase)) { if (Classe == null || Classe.NameEN == null || Classe.NameFR == null) { return(BadRequest()); } else { repo.Create(Classe.MapTo <ClasseEntity>()); return(Ok()); } } else { return(Unauthorized()); } }