示例#1
0
        public IHttpActionResult GetAbonnementById(int id)
        {
            Abonnement abonnement = abonnementService.getAbonnementById(id);

            if (abonnement == null)
            {
                return(NotFound());
            }

            AbonnementViewModel abm = new AbonnementViewModel
            {
                IdAbonnementM        = abonnement.IdAbonnement,
                typeM                = (AbonnementViewModel.typeAbonnement)abonnement.type,
                DateDebutAbonnementM = abonnement.DateDebut,
                DateFinAbonnementM   = abonnement.DateFin,
                ImageAbonnementM     = abonnement.Image,
                StateM               = abonnement.State,
                UtilisateurId        = abonnement.UserID
            };


            return(Ok(abm));
        }