Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Library does not work on Xamari.iOS #367

Closed
MartinLeist opened this issue Aug 6, 2020 · 4 comments
Closed

Library does not work on Xamari.iOS #367

MartinLeist opened this issue Aug 6, 2020 · 4 comments

Comments

@MartinLeist
Copy link

The option with UseOnlyDataTable does not work on SQLite.

On Xamarin.iOS one usually uses SQLite. The SQLite path uses FastMember no matter what. The way without fastmember is only included on SQL Server. So the cominbation Xamarin.iOS and SQLite does not work.

Originally posted by @MartinLeist in #320 (comment)

@borisdj
Copy link
Owner

borisdj commented Sep 13, 2020

SQLite does not use ObjectReaderEx at all, for which DataTable was alternative.
However it does use TypeAccessor from FastMember.
But it could be done without it, using plane Reflection.

@MartinLeist
Copy link
Author

My solution was removing the FastMember reference completely and changing the TypeAccessor to the type.
var typeAccessor = typeof(T); //TypeAccessor.Create(type, true);

value = typeAccessor.GetProperty(propertyColumn.Key).GetValue(entity) ?? null;
//value = typeAccessor[entity, propertyColumn.Key] ?? DBNull.Value;

That way I was able to use it in my Xamarin.Forms project. I suppose removing the reference would not have been necessary, but it was the fastest way to find all usages.

@borisdj
Copy link
Owner

borisdj commented Sep 14, 2020

That was the idea, I see you have already implemented it.
I have been considering to remove FastMember completely, since it is not necessary, and there have been more then one issue with it. Will see to clean it as soon as I find the time.

@borisdj
Copy link
Owner

borisdj commented Sep 17, 2020

FastMember dependency is now removed.
Version 3.2.0+

@borisdj borisdj closed this as completed Sep 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants