示例#1
0
 public static async Task StoreStatus(
     DatabaseStatus status,
     IEnumerable<DatabaseStatusEntity> statusEntities,
     DatabaseUser user,
     IEnumerable<DatabaseUserDescriptionEntity> userDescriptionEntities,
     IEnumerable<DatabaseUserUrlEntity> userUrlEntities)
 {
     var batch = new StatusInsertBatch
     {
         Status = status,
         StatusEntities = statusEntities,
         User = user,
         UserDescriptionEntities = userDescriptionEntities,
         UserUrlEntities = userUrlEntities
     };
     await StoreStatuses(new[] { batch });
 }
示例#2
0
 public static async Task StoreStatus(
     DatabaseStatus status,
     IEnumerable<DatabaseStatusEntity> statusEntities,
     DatabaseUser user,
     IEnumerable<DatabaseUserDescriptionEntity> userDescriptionEntities,
     IEnumerable<DatabaseUserUrlEntity> userUrlEntities)
 {
     try
     {
         await StatusCrud.StoreCoreAsync(
             EnumerableEx.Concat(
                 new[]
                 {
                     Tuple.Create(_statusInserter, (object) status),
                     Tuple.Create(_userInserter, (object) user)
                 },
                 new[] { _statusEntityCrud.CreateDeleter(status.Id) },
                 statusEntities.Select(e => Tuple.Create(_statusEntityInserter, (object)e)),
                 new[] { _userDescEntityCrud.CreateDeleter(user.Id) },
                 userDescriptionEntities.Select(e => Tuple.Create(_userDescEntityInserter, (object)e)),
                 new[] { _userUrlEntityCrud.CreateDeleter(user.Id) },
                 userUrlEntities.Select(e => Tuple.Create(_userUrlEntityInserter, (object)e))
                 ));
     }
     catch (Exception ex)
     {
         System.Diagnostics.Debug.WriteLine("# FAIL> storing status " + user.ScreenName + ": " + status.Text + Environment.NewLine + ex);
     }
 }