Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

'entities' is not a valid named attribute argument because it is not a valid attribute parameter typ

$
0
0

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


Viewing all articles
Browse latest Browse all 204402

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>