private static IEnumerable <Tuple <string, object> > CreateQuery(StatusInsertBatch batch) { return(EnumerableEx.Concat( new[] { Tuple.Create(_statusInserter, (object)batch.Status) }, new[] { _statusEntityCrud.CreateDeleter(batch.Status.Id) }, batch.StatusEntities.Select(e => Tuple.Create(_statusEntityInserter, (object)e)))); }
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 }); }
private static IEnumerable<Tuple<string, object>> CreateQuery(StatusInsertBatch batch) { return EnumerableEx.Concat( new[] { Tuple.Create(_statusInserter, (object)batch.Status) }, new[] { _statusEntityCrud.CreateDeleter(batch.Status.Id) }, batch.StatusEntities.Select(e => Tuple.Create(_statusEntityInserter, (object)e))); }
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 }); }