2

I have always seen that in all tutorials, databases are made in the form of code-first, but already there is a sqlite database that I want to use in my project. And I want to use entity 7 too. To do so, I made some classes from my database by means of a dll but it didn't work. In fact, I made these classes so that I could use my own database. I didn't want it to create a new database. Any suggestions? Can you recommend me any links,because I couldn't find any useful link

I install Install-Package EntityFramework.SQLite –Pre and Install-Package EntityFramework.Commands –Pre and Install-Package SQLite.Net.Async-PCL /next step: with Extension ،SQL Server Compact/SQLite Toolbox generate classes from db and import my db into project in visual studio and set buildaction to content and in final add

 private async Task CopyDatabase()
{
    bool isDatabaseExisting = false;

    try
    {
        StorageFile storageFile = await ApplicationData.Current.LocalFolder.GetFileAsync("people.db");
        isDatabaseExisting = true;
    }
    catch
    {
        isDatabaseExisting = false;
    }

    if (!isDatabaseExisting)
    {
        StorageFile databaseFile = await Package.Current.InstalledLocation.GetFileAsync("people.db");
        await databaseFile.CopyAsync(ApplicationData.Current.LocalFolder);
    }
}

into pp.xaml

je30ca
  • 96
  • 10
  • Possible duplicate of [Is there an Entity Framework 7 Database-First POCO Generator?](http://stackoverflow.com/questions/29300777/is-there-an-entity-framework-7-database-first-poco-generator) – Joel Brown Apr 01 '16 at 16:56
  • Please post specifically what you have tried and what specifically didnt work. "I made some classes from my database by means of a dll but it didn't work. " is not enough information to help. And if the thread Joel linked to is not relevant to you, explain why not. It sure looks relevant from here. – esmoore68 Apr 01 '16 at 19:50
  • @esmoore68 ok,I edit my question... – je30ca Apr 01 '16 at 20:13
  • You are mixing two technologies - EFCore has it's own class generator, as linked above.. – ErikEJ Apr 02 '16 at 12:22

0 Answers0