public Task <bool> SetProfileImageAsync(Guid profileId, byte[] profileImage) { ISQLDatabase database = ServiceRegistration.Get <ISQLDatabase>(); ITransaction transaction = database.BeginTransaction(); try { bool result; using (IDbCommand command = UserProfileDataManagement_SubSchema.SetUserProfileImageCommand(transaction, profileId, profileImage)) result = command.ExecuteNonQuery() > 0; transaction.Commit(); return(Task.FromResult(result)); } catch (Exception e) { ServiceRegistration.Get <ILogger>().Error("UserProfileDataManagement: Error creating user profile '{0}')", e, profileId); transaction.Rollback(); throw; } }