bonjour chers tous,
j'ai écris une fonction dans un projet DLL qui est censé me fournir une liste d'objet suite à l'exécution d'une requête.
lorsque j'appelle cette fonction dans le projet appelant j'ai une exception qui est levé. Alors si quelqu'un pourrait m'aider car je comprends pas où est le problème.
ci-après le code

code du projet DLL

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
public class PhonetToRecorder
    {
        public List<PosteICInformations> LstposteIC { get; set; }
 
        /// <summary>
        /// Get IC phone number list
        /// </summary>
        /// <returns>lstPosteICInfos</returns>
        public List<PosteICInformations> GetIcPhoneNumberList()
        {
            ERROR_CODE eError = ERROR_CODE.NONE;
 
            SqlQueriesService sqlQueriesService = new SqlQueriesService();
 
            // get and format needed information to return as Phone number and Phone number in internationnal format            
            SqlResponseBase response = sqlQueriesService.GetformatedPosteICInformations();
            if (response.Count > 0)
            {
                // transform first sql response to object for DTO
                foreach (SqlRow row in response.GetRows())
                {
                    PosteICInformations posteIC = new PosteICInformations();
                    posteIC.NumeroInterne = row.GetString("Numero interne");
                    posteIC.NumeroPublic = !string.IsNullOrEmpty(row.GetString("Numero public")) ? "+" + row.GetString("Numero public") : "0";
 
                    LstposteIC.Add(posteIC);
                }
            }
            else
                eError = ERROR_CODE.FUNCT_NO_RESULT;
 
            return LstposteIC;
        }
    }
 
code de l'appelant:
public List<PosteICInformations> GetListePosteIC()
        {
            PhonetToRecorder phoneTorecorder = new PhonetToRecorder();           
            return phoneTorecorder.GetIcPhoneNumberList();
        }
exception levée:
Severity Code Description Project File Line Suppression State
Error CS0029 Cannot implicitly convert type 'System.Collections.Generic.List<CDM.GTELBORG.DTO.getPosteIC.PosteICInformations>' to 'System.Collections.Generic.List<CDM.Ordinateur.App_CSharp.Commands.PosteICInformations>' Ordinateur c:\priv\projects\experimental\Ordinateur\Ordinateur\App_CSharp\Commands\EmptyPage.cs 144 Active
merci de votre aide!