Beispiel #1
0
        /// <summary>
        ///     Crée un level
        /// </summary>
        /// <param name="CreateLevelDto"></param>
        /// <returns></returns>
        internal FindLevelDto PostLevel(CreateLevelDto value)
        {
            Level levelModel   = TransformDtoToModel(value);
            Level levelCreated = this.LevelRepository.Create(levelModel);

            return(TransformModelToDto(levelCreated));
        }
Beispiel #2
0
        /// <summary>
        ///     Mets à jour un Level
        /// </summary>
        /// <param name="id"></param>
        /// <param name="CreateLevelDto"></param>
        /// <returns></returns>
        internal FindLevelDto PutLevel(int id, CreateLevelDto lev)
        {
            Level levelModel   = TransformDtoToModel(lev);
            Level levelUpdated = this.LevelRepository.Update(id, levelModel);

            return(TransformModelToDto(levelUpdated));
        }
Beispiel #3
0
 public FindLevelDto Put(int id, [FromBody] CreateLevelDto lev)
 {
     return(levelServices.PutLevel(id, lev));
 }
Beispiel #4
0
 public FindLevelDto Post([FromBody] CreateLevelDto value)
 {
     return(levelServices.PostLevel(value));
 }
Beispiel #5
0
 /// <summary>
 ///    Permet de transformer un DTO en Model
 /// </summary>
 /// <param name="CreateLevelDto"></param>
 /// <returns></returns>
 private Level TransformDtoToModel(CreateLevelDto lev)
 {
     return(new Level(null, lev.NameLevel));
 }