2

Basically I have this problem:

var item = 
    from itemCT in listC
    join ditemRef in servRef.Repository.GetQuery(efContext).DefaultIfEmpty()
    on itemCT.specialStringID equals ditemRef.refID
    into DitemRef

The problem is that itemCT.specialStringID is a string ( didnt design it ... can't change it ) Still I am required to make the join work. Any hints ?

Looking for related answers I've tried using SqlFunctions.StringConvert((double)ditemRef.refID without success.

Any hints towards the light at the end of the tunnel helps

Community
  • 1
  • 1
Mihai Labo
  • 1,082
  • 2
  • 16
  • 40
  • 2
    Convert one of the two to the other type using the `Convert.To[Type]` methods. It should be ok to use in those queries. – Jeff Mercado Jan 07 '13 at 17:21
  • You sir are correct . Talk about over thinking it . Please write it as a proper answer so I can mark the question as answered – Mihai Labo Jan 07 '13 at 17:27

1 Answers1

4

Many methods found in the System.Convert class are supported within a LINQ-to-Entities query. Use it to convert one of the two types to the other. Then you'll be able to write your query.

Jeff Mercado
  • 129,526
  • 32
  • 251
  • 272