Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4616556
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T01:59:53+00:00 2026-05-22T01:59:53+00:00

at first I want to make my apologize for my english I’ve a problem

  • 0

at first I want to make my apologize for my english

I’ve a problem with DTOs, I’m using SQLAzure for my DB and I host services on Azure

Some of my objects have ICollection of other objects, typically a country(Country Table) has a collection of airports (Airport Table), I use Entity Framework for DB Connection and DTO for present my object

A this point everything fine but on the client side when I want to use the property Icollection of an object, VS says “ambiguous name”, it seems during the serialization it re-type my object

I’ve DTOAirport on server side

I’ve two sorts of airport on client side after serialization
first the airportservice.airportClient.DTOAirport
second the countryService.countryClient.DTOAirport

I can’t use my classic DTOAirport and it dont support cast…

I’ve a lot of problems whith it, that I don’t have on “classics WCF services”

I can post code if you want it

Thanks a lot for reading me

{
[DataContract]
public class DTOAirport
{
    [DataMember]
    public int IdAirportDTO { get; set; }

    [DataMember]
    public string NameAirportDTO { get; set; }

    [DataMember]
    public string IATACodeDTO { get; set; }

    [DataMember]
    public string ICAOCodeDTO { get; set; }

    [DataMember]
    public string ZoneDTO { get; set; }

    [DataMember]
    public int FKCountryDTO { get; set; }

    [DataMember]
    public string CityDTO { get; set; }

    [DataMember]
    public double LatitudeDTO { get; set; }

    [DataMember]
    public double LongitudeDTO { get; set; }

    [DataMember]
    public Nullable<int> AltitudeDTO { get; set; }
}

}

{
[DataContract]
public class DTOCountry
{
    [DataMember]
    public int IdCountryDTO { get; set; }

    [DataMember]
    public string NameCountryDTO { get; set; }

    [DataMember]
    public ICollection<DTOAirport> AirportsListDTO { get; set; }
}

}

Here are my DTOs, I use a mapper for map it on Entity Framework classes

this is a typical service on server side

        public DTOAirport GetAirportById(int idAirport)
    {
        using (FlexAzureContainer1 context = new FlexAzureContainer1())
        {
            DTOAirport airport = new DTOAirport();
            airport = DTOAirportMapper.MapFrom(context.DM_AIRPORTS.Where(a => a.IdAirport == idAirport).FirstOrDefault());
            return airport;
        }
    }

        public DTOCountry GetCountryById(int idCountry)
    {
        using (FlexAzureContainer1 context = new FlexAzureContainer1())
        {
            DTOCountry country = new DTOCountry();
            country = DTOCountryMapper.MapFrom(context.DM_COUNTRIES.Where(c => c.IdCountry == idCountry).FirstOrDefault());
            return country;
        }
    }

here is a Console test on client side and the errors it gaves me

public class Program
{
    static AirportService.AirportServiceClient myAirportService = new AirportService.AirportServiceClient();
    static CountryService.CountryServiceClient myCountryService = new CountryService.CountryServiceClient();

    public static void Main(string[] args)
    {
         List<DTOAirport>airportsList = myCountryService.GetCountryById(1).AirportsListDTO.ToList();
        DTOCountry country = myCountryService.GetCountryById(1);    
        DTOAirport airport = myAirportService.GetAirportById(1);
        foreach (DTOAirport airport2 in country.AirportsListDTO.ToList())
        {
            Console.WriteLine(airport2.NameAirportDTO);
        }
        Console.WriteLine(country.NameCountryDTO);
        Console.WriteLine(airport.NameAirportDTO);
        Console.ReadLine();

    }
}

}

Error   1   Cannot implicitly convert type 'System.Collections.Generic.List<FlexinergieAircraft.Client.CountryService.DTOAirport>' to 'System.Collections.Generic.List<FlexinergieAircraft.Client.DTOAirport>'  D:\Projects\FlexinergieAicraft.OldVersions\FlexinergieAircraft17\FlexinergieAircraft\FlexinergieAircraft.Client\FlexinergieAircraft.Client\Program.cs   17  45  FlexinergieAircraft.Client

Error   2   Cannot implicitly convert type 'FlexinergieAircraft.Client.CountryService.DTOCountry' to 'FlexinergieAircraft.Client.DTOCountry'    D:\Projects\FlexinergieAicraft.OldVersions\FlexinergieAircraft17\FlexinergieAircraft\FlexinergieAircraft.Client\FlexinergieAircraft.Client\Program.cs   18  34  FlexinergieAircraft.Client

Error   3   Cannot implicitly convert type 'FlexinergieAircraft.Client.AirportService.DTOAirport' to 'FlexinergieAircraft.Client.DTOAirport'    D:\Projects\FlexinergieAicraft.OldVersions\FlexinergieAircraft17\FlexinergieAircraft\FlexinergieAircraft.Client\FlexinergieAircraft.Client\Program.cs   19  34  FlexinergieAircraft.Client

If you need something else

In this exemple exemple I test whith DTOs on Client side, the result was same, it seems the service re-type the objects

Maybe it is the proxy but it not mades a long time I work on azure and .NET in general

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T01:59:53+00:00Added an answer on May 22, 2026 at 1:59 am

    Your error message has a path which includes “.oldversions”.

    Is there a chance that the client and server are two different versions?

    Also I see that you have a nullable int, sometimes nullable types can be a problem. You could try it without this field just in case.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

First let me apologize if this doesn't make any sense. I took me some
i want to make some tests with the Oracle Business Intelligence Webservices. First i
I want insert some articles. I want make a judge first, if the image
I want to make sure the first 4 letters in a eight character code
say I want to make the first row of the excel ss something like
I want to make a user-registration form where I will have fields such first
i want to make a draggable image in jquery. first of all my experience
First of all, I want to make something clear before I get yelled at:
Let's imagine I want to make a templated function that returns the first element
I am creating my first serious project in PHP and I want to make

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.