I am building a Xamarin.Forms application. I have two libraries:
- MyProj.ViewModels
- MyProj.DataAccess
My DataAccess libary is accessing my Sqlite database and returning a dynamic object like so:
var calls = from customer in conn.Table<Customer>().ToList()
join call in conn.Table<Calls>().ToList()
on customer.Id equals call.CustomerId
group customer by call.CallDate into grouped
select new { Customers = grouped, CallDate = grouped.Key };
I would then like to access the properties of this dynamic object in my ViewModels library but due to dynamic objects being internal I get an exception saying:
object does not contain a definition for 'x'
I thought about adding the InternalsVisibleTo attribute:
[assembly: InternalsVisibleTo("MyProj.ViewModels")]
but this doesn't seem to work. Is it possible to use anonymous / dynamic types and the InternalsVisibleTo attribute to access dynamic objects in a different library to the one they were created in?
but this doesn't seem to work.
PS.
I have also checked whether my assembly is a strongly named assembly using this and I can confirm it isn't a strongly named assembly.
I have also checked that an Internal TestClass is visible to my MyProj.ViewModels libary which it was, so I can confirm the InternalsVisibleTo attribute works, it just doesn't work with dynamic could this be a portable class library bug?