TobiasBuchholz / Plugin.Firebase

Wrapper around the native Android and iOS Firebase Xamarin SDKs
MIT License
210 stars 48 forks source link

[Feature] Cover all data types that Cloud Firestore supports #29

Closed Kapusch closed 2 years ago

Kapusch commented 2 years ago

I can see that some of the data types that Cloud Firestore supports cannot be stored in the database.

For example, it is not possible to store a document which contains a reference to another document :

public class SimpleItem
    {
        [FirestoreDocumentId]
        public string Id { get; set; }

        [FirestoreProperty(nameof(Title))]
        public string Title { get; set; }

        [FirestoreProperty(nameof(DocReferencePath))]
        public string DocReferencePath { get; set; }

        [FirestoreProperty(nameof(DocReference))]
        // This is not going to be stored in the database
        public IDocumentReference DocReference { get; set; }
    }
Kapusch commented 2 years ago

Hello @TobiasBuchholz , I have been able to cover the "reference" data type so that it can be stored in Firestore. You can check implementation here.

However, I don't know yet about how to cover the other missing data types. Any idea ?

TobiasBuchholz commented 2 years ago

Hi @Kapusch, thank you very much for your feedback and interest in the library!

Unfortunately it's quite hard for me to see the relevent changes in your implementation because of all the code formatting differences.

On the development branch I've added an .editorconfig file that handles the code formatting and can be used to apply formatting rules by running dotnet format src/Plugin.Firebase.sln in the console.

Please checkout that branch, apply your changes and code formatting and create a Pull Request, so I can merge it into the project if everything works well. For more information on how to contribute, take a look at the README.

Kapusch commented 2 years ago

Sadly I am currently not much available, but I will keep you informed as soon as I can do it.

TobiasBuchholz commented 2 years ago

I will close this issue since it was partially implemented by #35, thanks a lot @Kapusch! :)

For other data types I would suggest to open a new issue with a specific type that should be implemented next.

Kapusch commented 2 years ago

My pleasure ! :) Yes I'm fine with what you proposed. Next missing data type could be "GeoPoint", but I don't know what else next.