IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Entity Framework Discussion :

Impossible de convertir implicitement le type 'System.Collections.Generic.List<<anonymous type


Sujet :

Entity Framework

  1. #1
    Membre à l'essai
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Août 2015
    Messages
    21
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 60
    Localisation : Maroc

    Informations professionnelles :
    Activité : Ingénieur développement logiciels

    Informations forums :
    Inscription : Août 2015
    Messages : 21
    Points : 16
    Points
    16
    Par défaut Impossible de convertir implicitement le type 'System.Collections.Generic.List<<anonymous type
    Bonjour,
    j'ai toujours un problème avec les class et leur type de retour;
    dans le fichier ci joint il y a le message d'erreur, merci pour l'aide

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    public List<Sites> GetAllSites()
    {
        var result = from cr in bd.Sites
        let totalAppelSortant =
            (from cr1 in bd.Staxe
            where cr1.Site == cr.Site
            select cr1
            ).Count()
        let totalAppelSortantLocaux =
            (from cr1 in bd.Staxe
            where cr1.Nature_Comm == "L"
              && cr1.Site == cr.Site
            select cr1
            ).Count()
        let totalAppelSortantNationaux =
            (from cr1 in bd.Staxe
            where cr1.Nature_Comm == "N"
              && cr1.Site == cr.Site
            select cr1
        ).Count()
        let totalAppelSortantInternationaux =
            (from cr1 in bd.Staxe
            where cr1.Nature_Comm == "I"
              && cr1.Site == cr.Site
            select cr1
            ).Count()
        let totalAppelSortantGSM =
            (from cr1 in bd.Staxe
            where cr1.Nature_Comm == "M"
              && cr1.Site == cr.Site
            select cr1
            ).Count()
        select new
        {
            CodeSite = cr.Site,
            LibelleSite = cr.Libellé,
            TotalAppelSortant = totalAppelSortant,
            TotalAppelSortantLocaux = totalAppelSortantLocaux,
            TotalAppelSortantNationaux = totalAppelSortantNationaux,
            TotalAppelSortantInternationaux = totalAppelSortantInternationaux,
            TotalAppelSortantGSM = totalAppelSortantGSM
        };
        return result.ToList();
        //return bd.Sites.ToList();
    }
    Images attachées Images attachées  

Discussions similaires

  1. Réponses: 4
    Dernier message: 10/04/2017, 14h59
  2. [Débutant] Message d'erreur "impossible de convertir implicitement le type.."
    Par LIANAZEL dans le forum C#
    Réponses: 9
    Dernier message: 29/06/2016, 18h42
  3. [Débutant] Impossible de convertir implicitement le type 'string' en 'int?'
    Par Mougain's dans le forum ASP.NET
    Réponses: 4
    Dernier message: 19/11/2014, 14h29
  4. Réponses: 15
    Dernier message: 01/03/2011, 16h21
  5. Réponses: 6
    Dernier message: 22/07/2009, 15h27

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo