Hello.
I´m trying to restore a database snapshot to use as design-time data while working with Blend. I´ve succesfully done this
on a previous project with 4 entities using the following code in my ViewModel:
if (DesignerProperties.IsInDesignTool)
{
// query local cache only
Manager.DefaultQueryStrategy = QueryStrategy.CacheOnly;
// load snapshot
var sr = Application.GetResourceStream(new Uri("Director;component/Assets/director.db", UriKind.Relative));
Manager.CacheStateManager.RestoreCacheState(sr.Stream, RestoreStrategy.Normal);
}
Now I´m trying to do the same in a new project that so far has only one entity, however I get this error when opening the View that uses the ViewModel in Blend:
Error in line 1 position 1615. Element 'http://schemas.microsoft.com/2003/10/Serialization/Arrays:anyType' contains data of the
'http://schemas.datacontract.org/2004/07/Manutencao.Models:Usuario' data contract. The deserializar has no knowledge of any type
that maps to this contract. Add the type corresponding to 'Usuario' to the list of known types - for example, by using the
KnownTypeAttribute attribute or by adding it to the list of known types passed to DataContractSerializer.
Can anyone help me with this?
Thanks!