Hi There,
I am facing the error as "Error CS0655 'Entities' is not a valid named attribute argument because it is not a valid attribute parameter type"
Here my code:
using AndroidX.Room;// it is definition of Xamarin.AndroidX.Room.Common, Version=1.0.0.0 (from Nuget)
namespace Profilecreator.Persistent
{
[Database(Entities = new Java.Lang.Class[] { Java.Lang.Class.FromType(typeof(Profile)) },Version = 1, ExportSchema = false)]
public abstract class ProfileCreatorDatabase : RoomDatabase
{
public abstract ProfileDao ProfileDao();
ProfileCreatorDatabase() { } private static readonly object padlock = new object(); private static ProfileCreatorDatabase instance = null; public static ProfileCreatorDatabase GetDatabase(Context context) { if (instance == null) { lock (padlock) { if (instance == null) { instance = (ProfileCreatorDatabase)Room.DatabaseBuilder(context.ApplicationContext, Java.Lang.Class.FromType(typeof(ProfileCreatorDatabase)), Constant.DATABASE_NAME). FallbackToDestructiveMigration(). Build(); } } } return instance; } }
}
Need help: Could any everyone help me to solve this trouble? It means how to value for Entities field of the DatabaseAttribute.
Many thanks, Hoang.
'entities' is not a valid named attribute argument because it is not a valid attribute parameter typ