public static async Task SaveToFileAsync <TEntity, TIdentity>(this EntityContainer <TEntity, TIdentity> me, string fileName) where TEntity : class, IEntity <TIdentity> { await FileUtilities.WriteAllTextAsync(fileName, await DataContractSerialization.SerializeAsync(me.Collection.ToList())); }
public static void SaveToFile <TEntity, TIdentity>(this EntityContainer <TEntity, TIdentity> container, string fileName) where TEntity : class, IEntity <TIdentity> { FileUtilities.WriteAllText(fileName, DataContractSerialization.Serialize <List <TEntity> >(container.Collection.ToList())); }