コード例 #1
0
 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()));
 }
コード例 #2
0
 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()));
 }