Copy a database

May 23, 2011 at 4:26 AM

Is there an easy way to make a copy of a database with all its tables and rows?

Coordinator
May 23, 2011 at 11:08 AM

There is no Copy function, no.  You would need to do someting like

if (!DoesDatabaseExist(newName))

var newDb = Database.Create(newName);

newDb.CreateTable<SomeType>();

newDb.Table<SomeType>().AddRange(oldDb.Table<SomeType>());

 

Thanks.